1 Reply Latest reply on Oct 1, 2008 8:19 AM by kglad

    Need to detect the end of swf loaded

      Dear Sirs,
      i have a situation where a flash file (Main.fla) is supposed to load a SWF file (Intro.swf) and play it.
      the problem is if load the swf to an empty movieclip (m_mc) like usual i cant have acces to m_mc._totalframes m_mc._currentframe(both will return 1) and i will not know when the Intro.swf will finish playing to continue in Main.fla and do other things.
      NB: i dont have access to Intro.swf (it is on the web)
      i tried to solve this by using loadmovienum(Intro.swf,400) ' Loading the movie to a level400 and not to empty movieclip
      this way i could get _level400._totalframes and _level400._currentframe
      and i put the following code on the empty Movieclip m_mc

      if(_level400._currentframe + 5 >=_level400._totalframes)

      the problem is that this structure is weak and flash sometimes do it right and sometimes doesnt...
      ie sometimes it will keep playing endlessly
      and sometimes will not play at all
      and sometimes it is ok
      please help me as this is very crucial to me and if u have any suggestion please infrom me
        • 1. Re: Need to detect the end of swf loaded
          kglad Adobe Community Professional & MVP
          you can detect the _currentframe and _totalframes of any loaded swf whether loaded into a target movieclip (empty or not) or level. you just need to wait until loading is complete before trying to access the _totalframes property and you need to wait until loading starts before trying to access the _currentframe property.