3 Replies Latest reply on Nov 11, 2007 10:09 AM by kglad

    check loaded SWF playback completion

    gravitycollapse Level 1
      So, I'm not sure the best way to do this in AS3 and need guidance. I am loading an SWF into a holder clip, and it's a linear animation. When it's donw playing, I want to do something else. My research seems to indicate the best way is to count frames and compare with total frames. But my code is giving me 0 for currentFrame. What am I doing wrong?

        • 1. Re: check loaded SWF playback completion
          kglad Adobe Community Professional & MVP
          in as3, you don't load into a movieclip like you did with as2. you're loading into a loader.

          to display your loaded swf, you add your loader to the display list. to access the properties, methods, functions, object and variables of your loaded swf, you reference your loader's content property. because the flash compiler has a severe short-term memory issue, you'll need to cast the loader's content as a movieclip. for example:

          • 2. Re: check loaded SWF playback completion
            gravitycollapse Level 1
            This sample code you gave me results in a type conversion error. It seems the content property of the loader cannot be converted to a MovieClip.

            at flash.utils::Timer/flash.utils:Timer::tick()
            TypeError: Error #1034: Echec de la contrainte de type : conversion de flash.display::AVM1Movie@31319641 en flash.display.MovieClip impossible

            I've simplified my code a bit to use the displayList (got rid of my holder clip), but I still cannot call currentFrame on it. It just tells me it's not the right type of data. And, the clip shows and plays back fine.
            • 3. Re: check loaded SWF playback completion
              kglad Adobe Community Professional & MVP
              then you're not loading an as3 swf.