Let’s say I have a resource file which exports mc1 with 4 frames in it. I would like to create a new MovieClip and insert frames like this:
mc2:flash.display.MovieClip = new flash.display.MovieClip() mc1.gotoAndStop(2); mc2.gotoAndStop(1); mc2.currentFrame = mc1.currenctFrame mc1.gotoAndStop(1); mc2.gotoAndStop(2); mc2.currentFrame = mc1.currenctFrame mc1.gotoAndStop(2); mc2.gotoAndStop(3); mc2.currentFrame = mc1.currenctFrame mc1.gotoAndStop(4); mc2.gotoAndStop(4); mc2.currentFrame = mc1.currenctFrame
[edit] More details
I am not using Flash IDE. I am using:
- Inkscape (for SVG generation)
- swfmill (to create asset files)
- Haxe (to create animations)
I am not at this point trying to build games or anything interactive. I have managed to create a simple animation where a background sprite is spinning (and that’s it). I used TimerEvents to achieve this. But instead I would really like to be able to construct a MovieClip and attach individual frames on it and then play it on loop.
Alternatively I can create a MovieClip and just draw on it frame by frame programmatically. (and then of course play in loop)
Basically I would like to use ActionScript to generate content instead of swfmill’s XML (not the simple dialect, simple is fine). Since I am a beginner I don’t know what other information I can give you. So please tell me if I can supply any other details?
Without the Flash IDE, there is little point in using gotoAndStop() etc.
As you can’t add your different assets on different frames, you should add them all as layers using addChild(assetToAdd) and set all but one to visible = false. Then add a simple function like this: