categories: actionscript 3, flash, papervision3d, projects
I have a new flash project up that I’ve been working on for a few months on and off.
http://www.gregkepler.com/oscars09/
This is an Oscars ballot site that was set up for my family and friends. I used a bit of practical Papervision3D for the ballot selection and Aftereffects for the transitions. It was a fun project, but now it’s time to move on to the next project, the personal portfolio site redesign.
No Comments »
categories: actionscript 3, flash
In as3, the introduction to of the display list has made the stop() method a little less straightforward. Traditionally, when you used stop() on the timeline of a movieclip, it would do just that, stop the playhead from playing past where that script is. To be fare, this does still work, but only if you place the movieclip on the timeline manually (not via code).
Now to get a movieclip to stop on the first frame when added to the display list via the addChild() method, you must be sure to add stop() once it’s added. Also, note that you cannot call any other timeline based methods such as gotoAndPlay() and gotoAndStop() to a dynamically added movieclip unless it’s on the display list either.
This is specifically useful when you are using a movieclip that has a timeline based rollover and rollout animation as a button.
No Comments »
categories: actionscript 3, flash
To add a library item to a display object using as3, here is the basic method:
var dynamicClass:Class = getDefinitionByName("libraryName") as Class;
var mcFromLibrary:MovieClip = new dynamicClass();
addChild(mcFromLibrary);
dynamicClass is a variable typed as a Class returns a reference to the class object of the class specified by the name parameter.
“libraryName” is the the name given to the MovieClip’s Class in the Symbol Properties options in the flash library.
Don’t forget to import get the definitionByName class using
import flash.utils.getDefinitionByName;
This is especially useful when looping through an array to attach multiple instances of the same movieclip. Most recently I used it to pass the reference of a loader in the library since I wanted to use the same class to potentially attach different loaders depending on what was being loaded where and when in the program.
No Comments »