A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: detecting end of loaded video swf

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Posts
    3
    First time caller... Long time listener.

    I have a SWF created via Sorenson Spark Pro, I'm using loadMovie to load it into my Flash file. How can I detect when the loaded SWF is done playing? I obviously can't crack open the SWF and add actionscript, so I need a way to detect when it's done.

    Any ideas?
    Thanks in advance...

    -jaz

  2. #2
    Wildform Moderator
    Join Date
    Sep 2000
    Posts
    2,070
    Hi.
    You can use get property to tell you how many total frames are in the movie you have loaded. Then you can compare how many frames have played against the total. When those numbers are equal, you know that your swf is done playing.
    FYI, our software, Flix, adds a variable at the end of each swf to let you know when it is done playing.
    jb

    http://www.wildform.com/flix

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Posts
    3
    I understand the getProperty part, that's easy. But I'm not very good with loops. How would the logic look?

    Is it like this?

    if (_currentframe = _totalframes) {
    do something()
    }

    And, where does it need to go? I placed my getProperty within an onClipEvent(), on the MC that loads the SWF, and it works. I'm just not sure where to put the other logic.

    Any Ideas?
    Thanks in advance...

    -Jaz

  4. #4
    Flash Video Moderator Wheels's Avatar
    Join Date
    Dec 2000
    Location
    Minneapolis
    Posts
    1,590
    <b>// on a MC</b>

    on(press){
    loadMovie("mySwf", 4000);
    }

    <b>// dynamic</b>

    mc.onPress = function() {
    loadMovie("mySwf", 4000);
    }

    <b>// on a MC</b>

    onClipEvent(enterFrame){
    if(_level4000._currentframe==_level4000._totalfram es)
    doSomething;
    }
    }

    <b>// dynamic</b>

    mc.onEnterFrame = function() {
    if(_level4000._currentframe==_level4000._totalfram es){
    doSomething;
    delete this.onEnterFrame;
    }
    }
    http://www.tcinternet.net/users/5guy...08/final3.html

    5G
    [Edited by Wheels on 08-16-2002 at 04:10 AM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center