Take the 2-minute tour ×

How do I create the AS3 equivalent of a moviescript with multiple frames?

If I were using the Flash IDE, I would put whatever stuff I wanted on frame 1, other stuff on frame 2, etc. and step through the frames as the user clicks the "Next" button. Or perhaps put in keyframes and tweens and let the system play through the frames at a fixed rate.

I don't see a way to do this in AS3, even though all the descriptions I've seen say that Flash CS3 turns your timeline and frames into ActionScript, and I would like to know how to do the same without having the Flash IDE (e.g., working in Flex).

Let's take a simple example: I have 3 frames. Frame 1 contains the splash page (a lot of text and a button). Frame 2 contains one image, one label, and one button that says "Next". Frame 3 contains two images and one label.

How would you build that in AS3?

share|improve this question
Just one clarification: Flash Builder supports ActionScript only projects without any explicit dependencies to the Flex Framework. Beyond that; I'm not sure how to help you. –  JeffryHouser Sep 7 '13 at 19:13
Is there any reason you can't use the IDE to create a swc that you could use the symbols from the way you suggest? Also, are you aware that you can create a Flash Pro project in Flash Builder? This allows you to leverage the best of both worlds. –  Amy Blankenship Sep 8 '13 at 16:12
I do agree that he could use the IDE to create a .swc, but I think his question is a good one. He simply wants to know how/if he can create a multi-frame MovieClip using only AS3 code. –  prototypical Sep 8 '13 at 17:38

2 Answers 2

up vote 0 down vote accepted

Flash CS

You will put your logic code in key frame, and do something with the text,button etc. It's hard for multi uses to edit and work on it.

AS3 use IDE like Flash Builder

Flash CS will is just used to make animation swf

Assume we have a swf named A.swf

  • A.swf

    • mySymbol (have a link name like com.mySymbol)

      • subSymbol1(named subSymbol1)

        • nameLabel(named label1)
        • addressLabel(named label2)
      • subSymbol2(named subSymbol2)

        • nameLabel(named label1)
        • addressLabel(named label2)

Here is how you use A.swf in flash builder

Class MyView {

   public function MyView() {

      var loader:Loader = new Loader();
      var url:String = "A.swf";
      var urlReq:URLRequest = new URLRequest(url);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
      loader.load(urlReq, loaderContext);

   private function onLoadComplete(e:Event):void {

       //now you can get defined symbols in A.swf
       var c:Class = getDefinitionByName(" com.mySymbol");

       //get a mySymbol  instance
       var mc:MovieClip = new c();

       //add to parent

       /*what you said you got three frames,
       Just like set like subSymbol1 and subSymbol2 in this A.swf
       add some text in subSymbol1  and other in subSymbol2 */

       mc.subSymbol1.visible = false;
       mc.subSymbol2.visible = true;


It could make the program and view indenpendent in a way.

share|improve this answer
He's not asking how to use a .swf, he's asking how to create a multi-frame MovieClip with only AS3 code. –  prototypical Sep 8 '13 at 17:41

You would most likely just create each of those frames as an individual Sprite.

When you want to switch between them, you'd use removeChild() to hide the old one and addChild() to show the new one.

If you want to get fancy you can add Tweens (either built-in or from a tweening engine). This would allow you to fade between the frames, or scale them in, or slide from left to right, or whatever.

If you need to do more complex sequenced animations you can look into something like TimelineLite to help with that.

share|improve this answer

Your Answer


