Detecting when an external swf has stopped playing

I want to load a short swf to play whilst a flv loads in the
background. The problem is detecting when the swf has finished
playing. I would use the current and total frames but unable to
identify what swf or mc to attach the methods to. I have tried
Loader.content but this is not working.
Any ideas please.

It looks like you're using AS3 and a Loader object. If that's
the case then you can access the loaded content like this:

Similar Messages

  • How to detect external SWF has stopped not using totalFrames

    Trying to find a way to detect when an externally loaded SWF has stopped. Using "totalFrames" like the example below doesn't work for what I'm trying to accomplish.
    I need something that simply listens and detects when the clip has stopped. Editing the external SWF is not an option. Thanks in advance for any insight.
    function onfrm( evnt: Event ): void
    if (newMC.currentFrame == newMC.totalFrames )
    newMC.removeEventListener( Event.ENTER_FRAME, onfrm);
    trace("End of banner");

    Just did a small test, and at least with loading a swf that has a timeline the totalFrames option works fine:
    var m:MovieClip;
    var a:Loader = new Loader();
    a.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    a.load(new URLRequest("anim.swf"));
    function done(e:Event):void
      m = MovieClip(a.content);
      m.addEventListener(Event.ENTER_FRAME, chek);
      addChild(m);
    function chek(e:Event):void
      if(m.currentFrame == m.totalFrames){
      trace("done");
      m.removeEventListener(Event.ENTER_FRAME, chek);

  • Knowing when my external swf has finished reading

    Hi,
    I'm quite new to as, and I expected a few things to be,
    well... Easier !
    Here is the code I've been working on :
    quote:
    import flash.external.ExternalInterface;
    import flash.display.*;
    import flash.net.URLRequest;
    import flash.events.*;
    Security.allowDomain("localhost/spip2");
    var tab_url = new Array('
    http://localhost/spip2/squelettes-dist/flash1.swf',
    http://localhost/spip2/squelettes-dist/flash2.swf');
    var ldr:Loader = new Loader();
    var ldra:Loader = new Loader();
    var context = new LoaderContext();
    var container:MovieClip = new MovieClip();
    addChild(container);
    function actionScriptFunction(taburl) {
    var request:URLRequest = new URLRequest(taburl[0]);
    ldr.contentLoaderInfo.addEventListener(Event.UNLOAD,termine);
    ldr.load(request,context);
    container.addChild(ldr);
    function termine(pEvt:Event):void{
    ldr.unload();
    var request:URLRequest = new URLRequest(taburl[1]);
    var context2 = new LoaderContext();
    ldr.load(request,context2);
    addChild(ldr);
    actionScriptFunction(tab_url);
    In a few words : I load a first .swf, and when it's over, I
    load another one. I can't add any script to the .swf files
    themselves. I've probably made my script more complicated than it
    should be, however, my main problem still remains : obviously
    'Event.UNLOAD' is incorrect, but how do I know my first movie is
    over ? I tried to use currentframe / totalframes, but they don't
    seem to return anything useful.
    Is there a way to "catch" the end of a .swf ?
    Thanks to anyone who could help !
    Ronan

    while possible, you would have to put that in an onEnterFrame
    function, which tends to be fairly heavy, or even a SetInterval,
    which is also heavy. It would be better to simply put a function
    call in the last frame of the externally loaded SWF.

  • My ipod touch has stopped playing through my Sony docking station, It only plays through i pod. It's not the docking station as my daughter's ipod works fine on it. It can synch when connected to computer. Any ideas what is wrong?

    My ipod touch has stopped playing through my Sony docking station, It only plays through the i pod. It's not the docking station as my daughter's ipod works fine on it. It can synch when connected to computer. Any ideas what is wrong?

    Have  discovered that I had not in fact updated the ios!!
    Went through the process last night and my ipod now works fine on my docking station.
    Thank you very much for your advice.

  • My iPhone 5s has stopped playing music out of the speakers. It works when I plug in my headphones but other than that there's no sound. It just randomly happened so I'm not sure if I can fix it or if I need to bring my phone in

    My iPhone 5s has stopped playing music out of the speakers. It works when I plug in my headphones but other than that there's no sound. It just randomly happened so I'm not sure if I can fix it or if I need to bring my phone in. Help?

    Hi Cassilecompte,
    If you are not getting any sound from your iPhone’s speaker, you may want to troubleshoot using the steps in this article -
    iPhone: No sound or distorted sound from speaker
    http://support.apple.com/kb/ts5180
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • Swf file has stopped playing in 'live' browser only

    Hello everyone,
    Hope you can help with this, whilst working on my site one of the swf files stopped playing when viewed in the browser (live). The file plays ok from Dreamweaver from both local view and remote view. Went onto web server cpanel and played the swf file ok from there as well. Have checked the code and all seems fine, I wasn't even working with that file when it went wrong, all I done was replaced a png picture with a swf file on a different part of the page, this new swf plays fine along with all other swf files on my site. I have uploaded and syncronised both the page and swf files again but still no joy.
    I really am stumped for an answer, any help would be greatly appreciated.
    Thanks in advance,
    Stuart

    Here's the link, but after 3 hours of not playing it started to play by itself after I added a favicon (which still isn't working) to the index page.
    That is really strange and a bit worrying as it seems to have a mind of it's own. It also happened once before on another page when I was adding content to the site. I was able to kickstart that one by uploading the page again from local.
    The swf file which wasn't playing is midway down page showing drawings.
    http://www.joinerycadsolutions.com/St_Johns.html
    At least it's working now although I feel scared to touch the site in case I loose it/another again.
    Thanks for the reply.
    Stuart

  • Iphone 3G has stopped playing video entirely. (will not take play videos taken on the iphone no longer play), unable to transfer to computer either. Says Parameter error when I try to copy or play file

    My Iphone 3G has stopped playing video entirely. (will not take play videos taken on the iphone), unable to transfer to computer either. Says Parameter error when I try to copy or play file. very frustrating, not being able to access past videos taken at all. This has been going on for a while now

    Have you done any of the basic troublshooting steps described in the User Guide (Appendix B) - Restart, Reset, Restore?

  • My 3gs has stopped playing through the speakers and when the headphones are plugged in only plays through one ear? it still ring when called and everything else seems fine, whats the problem? it seems like the phone thinks the earphones are always in?

    my 3gs has stopped playing music through the speakers, they play with headphones but only through one ear. It seems the phone thinks the headphones are in all the time. The ringer still works when called and i have cleaned the headphone socket the best i can without damaging the phone! Any ideas?

    I had the same issue, 4s running ios8, but the plugging and unplugging the headphones did not work, BUT, when I tried plugging and unplugging from the DOCK, it started to work again. There must have been a short in the power plug, not the headphones. I also blew out the bottom power plug with computer safe airjet. Hope this one helps anyone else having the issue.

  • Can you tell when a loaded SWF has reached its final frame?

    I used loadMovie to load an external SWF into the bottom-half
    of a main "shell" swf. When that loaded SWF finishes playing (it's
    just an animation), I need to populate a text field with the word
    "DONE" . The text field resides on the _root, so I need some way to
    know when the loaded SWF has reached its last frame...
    This would obviously be easy if I had the .FLA of the loaded
    SWF because I could just write the actionscript on the last frame
    of that SWF to populate the _root textfield. Alas, I do not have
    the source FLA of that loaded SWF, so I need some way to have the
    main "shell" SWF/FLA know when that loaded SWF has reached its end.
    Is this possible???
    Thanks!!!

    DIY_Lobotomy,
    > The reality of my situation is that there's a "menu" of
    sorts that
    > gets loaded into "contentClip". This "menu" has a bunch
    of links.
    So far, so good.
    > When clicked, each link loads a DIFFERENT swf into
    "contentClip".
    > It is THOSE swfs that I need to note the end of.
    That's still okay.
    > So, there's actually more than one, and they're not
    exactly being
    > loaded directly from my main movie, since they're
    actually loaded
    > based on a link being clicked in the movie that is
    currently loaded
    > into "containerClip"
    The concept is still the same, no matter what. No matter how
    deep the
    one-clip-loads-another chain goes, you have to keep taps on
    each chain link.
    When the final link has loaded, you'll be able to make your
    object reference
    to that movie clip. That movie clip -- because it's an
    instance of the
    MovieClip class -- will have the _currentframe and
    _totalframes properties.
    You'll just be checking *that* cliip's properties instead of
    the one named
    contentClip in my own example.
    You can loop using onEnterFrame or, if you prefer, with
    setInterva().
    That doesn't much matter either, so long as you repeatedly
    poll the deepest
    clip to test its current frame against its last frame (this
    all assumes that
    the clip being tested is a linear animation whose end
    corresponds to its
    last frame; otherwise, you could check _currentframe against
    any arbitrary
    frame number).
    > I hope that wasn't too confusing! Do you still have a
    solution???
    Not too confusing to understand, but it might be confusing
    to route
    through in practice. Not confusing, actually, but meticulous
    ... you'll
    have to be careful with your pathing. Nested movie clips are
    very much like
    nested folders on your hard drive. Their instance names
    relate to the
    folder names.
    Now, if that menu doesn't have an instance name you provided
    -- or if
    any fork along the path has an instance name you can't
    control -- you can
    still reference the nested movie clips. If you test your file
    in the
    Debugger panel, you'll see all the instances laid out in
    hierarchical order.
    You'll see that automatic instance names are provided
    (something like
    "instance1", "instance2", etc.).
    David Stiller
    Contributor, How to Cheat in Flash CS3
    http://tinyurl.com/2cp6na
    "Luck is the residue of good design."

  • HP Pavilion external monitor has stopped working with my Macbook Pro (Mid 2012) with OSX 10.8.3

    HP Pavilion external monitor has stopped working with my Macbook Pro (Mid 2012) with OSX 10.8.3.  When I purchased the monitor a few weeks ago it worked perfectly when computer was in clamshell mode or with lid open. Now external display has stopped working.  When I turn on display it scans for signal but does not find it and then immediately goes into sleep mode.  I am using a DVI connection with the adapter for the mini display plug.  REALLY FRUSTRATING. Any help would be extremely appreciated. 

    Hi lancekatigbak,
    If you're having issues with the display out on your MacBook Pro, you may want to take a look at the troubleshooting steps in the following article:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Cheers,
    - Brenden

  • My Mac has stopped playing you tube asking me to update flash player trouble is it is asking me for a password and I don't ever recall setting a password for this mac -!!!!!

    My Mac has stopped playing you tube asking me to update flash player trouble is it is asking me for a password and I don't ever recall setting a password for this mac …!!!!

    When the Mac was setup you had to create an administrative password.and account.  Yo have to sign into that account to install apps/plug-ins like Flash. To reset that password.
    Forgot Mac Password? How to Reset Your Mac Password (with or without CD)
    Change the Admin Password with Mac OS X Single User Mode
    Reset mac mini admin password: Apple Support Communities

  • External HD has stopped working correctly on my iMac

    I have 2 external HD aswell as my internal drive that have been running since I got my new iMac under a year ago, however it seems one of my external HD has stopped working so I really need help this drive has important files on I really need to access,
    the drive itself lights up when connected and I can hear it trying to work and it even appears in the disk utility however after a few seconds it then disapears from the disk utility and the only wy to repeat this process is to unplug and then plug HD back in via the power cable.
    it seems as though my HD is in some sort of sleep mode as the light dims when it disapears from disk utility.
    Can anyone plese help?

    Off hand I would say the drive may be failing. Contact the original vendor as well as the manufacturer's tech support for assistance.

  • CD/DVD drive has stopped playing or recording

    i have only had this laptop a month and the drive has stopped playing or recording anything has anyone got a answer for that

    Answer? When you ask such question to the best technician I think he cannot give you proper answer without checking your machine and see what can be wrong there.
    Sorry but after reading this one sentence problem description I can just say bring it to the service.
    If you want to have serious discussion here lease let us know which notebook model do you have.
    Have you made some tests?
    Have you tried to clean the lens?
    Can you use bootable disc? Anything?

  • My itunes has stopped playing music. I have unintalled all apple apps and reinstalled and updated but nothing has worked. What can I do to fix this?

    My itunes has stopped playing music. I recently downloaded more music and now it has stopped playing, it says it is playing but there is no sound and the time bar does not move from 0. I have uninstalled all apple apps on my laptop and reinstalled and then updated the software. I have tried 'repair' aswell but nothing has worked.

    Songs in the itunes store are also not working

  • Error when opening itunes : iTunes has stopped working ''A problem caused the program to stop working correctly''. When I repaired damaged files the problem still exists and also after uninstalling and redownloading and installing itunes. I have windows 8

    Error when opening iTunes : iTunes has stopped working '' A problem caused the program to stop working correctly''.
    When I repaired damaged files the problem still exists and also after uninstalling, redownloading and reinstalling iTunes.
    My pc is working with windos 8.
    Is there a solution?

    Hey there Rodney274,
    It sounds like you are getting an error from iTunes when you launch it. I would try the troubleshooting in this article named:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Start with troubleshooting for 3rd party plug ins section, then the rest of the article if needed:
    Start iTunes in Safe Mode
    Open iTunes in Safe Mode to isolate any interference from plug-ins or scripts not manufactured by Apple.
    Hold down Shift–Control while opening iTunes. You should see a dialog that says "iTunes is running in safe mode" before iTunes finishes starting up.
    Click Continue.
    See if the issue you're experiencing persists in Safe Mode.
    If you have the same issue while iTunes is in Safe Mode, proceed to the "Create a new user account" section. If you don't experience the same issue, follow these steps to remove third-party plug-ins.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

Maybe you are looking for