9 Replies Latest reply on Aug 4, 2006 10:20 AM by Newsgroup_User

    ActionScript animation does not work if imported into another FLA

    Level 7
      I have an SWF animation made using ActionScript. It works fine. However when
      I import it into another FLA file's library, it does not.
      What might be the problem?


        • 1. Re: ActionScript animation does not work if imported into another FLA
          Level 7
          "aa" <A@aa.com> wrote in message news:ear3mv$4ov$1@forums.macromedia.com...
          >I have an SWF animation made using ActionScript. It works fine. However when
          > I import it into another FLA file's library, it does not.
          > What might be the problem?
          >

          It's often due to the use of _root since _root changes once a clip is loaded into another one.
          It's easier to check these things by looking at the code though, instead of asking for guesswork.
          tralfaz


          • 2. Re: ActionScript animation does not work if imported into another FLA
            kglad Adobe Community Professional & MVP
            usually the problem is the use of _root in the external swf. often that problem is remedied by adding the following to your external swf:

            • 3. Re: ActionScript animation does not work if imported into another FLA
              Level 7
              Thanks, colleagues, for quick reply. I will post the code in question, yet
              before I ask you to spend your time on looking through the code, I would
              like to make sure tha the problem is not elsewhere. Two things:
              1. _root is not used in the parent FLA at all
              2. I am not sure that the problem has to do with the parent FLA code, for
              the imported SWF does not play in the Parent FLA Library preview pane.

              When I select the imported SWF in the library pane to see how it has got
              imported I can see that it is imported as a 14-frame clip, each frame is
              empty - no graphics no code (the original FLA of which the imported SWF is
              published has 14 frames too, some frames with code).
              So the question is: how such an SWF file is supposed to be imported into a
              FLA file?
              I thought that no matter whether the animation is done with AS code or with
              tweening, the resulting SWF will be essencially the same.
              I expected that the code will not be imported, but instead a product of that
              code execution as a series of frames populated with the graphics will be
              imported.
              Will you comment on that?


              • 4. Re: ActionScript animation does not work if imported into another FLA
                Level 7
                > So the question is: how such an SWF file is supposed to be imported into a
                > FLA file?

                Importing is only for frame animations, sounds, and still photos. You won't get any Actionscript or movieclips with import.

                To bring in another fla, open both flas at the same time. Then copy and paste all the frames or drag content from one library to
                the other.
                tralfaz


                • 5. Re: ActionScript animation does not work if imported into another FLA
                  Level 7
                  "tralfaz" <tralfazmx@yahoo.com> wrote in message news:eatcig$14e$1@forums.macromedia.com...
                  >> So the question is: how such an SWF file is supposed to be imported into a
                  >> FLA file?

                  BTW.. I thought you were loading the external swf with loadMovie. That's where the _root actionscript problem comes in.
                  tralfaz


                  • 6. Re: ActionScript animation does not work if imported into another FLA
                    Level 7

                    "tralfaz" <tralfazmx@yahoo.com> wrote in message
                    news:eatcig$14e$1@forums.macromedia.com...
                    > > So the question is: how such an SWF file is supposed to be imported into
                    a
                    > > FLA file?
                    >
                    > Importing is only for frame animations, sounds, and still photos. You
                    won't get any Actionscript or movieclips with import.
                    >
                    > To bring in another fla, open both flas at the same time. Then copy and
                    paste all the frames or drag content from one library to
                    > the other.

                    Thanks.
                    This sounds like recreating the clip inside FLA, meaning not only cut and
                    pasting code but also creating/importing every bit of graphics. Do you mean
                    that an SWF based on Action Script cannot be just imported as I can import
                    an SWF based on tweening?



                    • 7. Re: ActionScript animation does not work if imported into another FLA
                      Level 7

                      "tralfaz" <tralfazmx@yahoo.com> wrote in message
                      news:eatckh$16l$1@forums.macromedia.com...
                      > "tralfaz" <tralfazmx@yahoo.com> wrote in message
                      news:eatcig$14e$1@forums.macromedia.com...
                      > >> So the question is: how such an SWF file is supposed to be imported
                      into a
                      > >> FLA file?
                      >
                      > BTW.. I thought you were loading the external swf with loadMovie. That's
                      where the _root actionscript problem comes in.
                      > tralfaz
                      >
                      >
                      loadMovie looks like an alternative to importing an SWF. How does it stand
                      vs importing in terms of speed and using computer resources?
                      In my application an SWF I want to import is an animation of an explosion.
                      When a target is hitted, I replace the target clip with the explosion clip.
                      This needs to be done instantly and without overloading the processor
                      because there are many moving targets on the screen


                      • 8. Re: ActionScript animation does not work if imported into another FLA
                        Level 7
                        >> To bring in another fla, open both flas at the same time. Then copy and
                        > paste all the frames or drag content from one library to
                        >> the other.
                        >
                        > Thanks.
                        > This sounds like recreating the clip inside FLA, meaning not only cut and
                        > pasting code but also creating/importing every bit of graphics. Do you mean
                        > that an SWF based on Action Script cannot be just imported as I can import
                        > an SWF based on tweening?

                        It's much simpler than it sounds like. You just select all frames, copy. Then in the other project, select the destination frame
                        and paste. It will automatically include everything needed in the library. All the layers will be created when you paste,
                        including actionscript etc. It's really only a few clicks to bring one fla into another one. You would probably want to make a new
                        movieclip in the destination file and paste into there. loadMovie is useful where the sub-sections are very large and you don't
                        want to load all the big stuff at one time. For smaller stuff it's fine to keep it all in one file.
                        tralfaz