unloadAndStop in Flash Player 10 – Necessary for Captivate and AVM1 Content

 

I spent a good part of yesterday trying to figure out a solution to this problem:

- I had coded a course ‘gui’ with navigation controls such as previous/next buttons, and a List component for the non-linear navigation.

- The list component is populated via an XML file that contains the path to the individual swf, and the label, and also an icon string (an undocumented feature – that’s another post).

- For the prototype, most of the content was in AS3, developed purely in Flash, with the exception of a single Captivate-generated swf that was published from Captivate 3, and thus an AVM1 swf.

- After getting the prototype right, I decided to develop the remaining content in Captivate whenever possible to speed up things. After putting together a few more Captivate-generated swfs, I tested and the result was that whenever I navigated away from a Captivate swf and loaded another Captivate swf, the sound from the previously loaded Captivate swf’s would continue. In other words, using the unload() method of the Loader class doesn’t truly unload the content of the Loader. To make things worse, I was even *removing* the Loader instance and creating a new one. Still, the audio would keep playing. Terrible!

After googling I come to find out this is a known issue:

http://www.gskinner.com/blog/archives/2008/07/unloadandstop_i.html

So, the workaround was to use the unloadAndStop method of the Loader class, which unfortunately is only available in Flash Player 10. Fortunately, I have the leeway to force my users to move to FP10 if they have to. Most people wouldn’t.

Of course, then after I get that sorted out I come to find out that Captivate 4 was released yesterday : ) I have started to publish the Captivate’s with the ‘AS3′ spec but I’m not sure if that helps or not.

Has anyone tried that?

This entry was posted in Captivate, Flash and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

 

4 Comments

  1. Posted September 9, 2009 at 12:10 pm | Permalink

    my problem sounds similar to yours but i can’t publish my Flash application with the player 10…
    So i dont know what to do…

    If you’ve got any idea email me !

  2. Posted December 8, 2009 at 6:24 am | Permalink

    Yes, publishing captivates’s with AS3 is a way to go

  3. Chris
    Posted April 16, 2010 at 5:58 am | Permalink

    I’m stuck with the same problem and it seems to me, that Cap4 SWFs do not support unloadAndStop, even if you export in FP10.

    Captivate is maybe the greatest shit ever to be coded in history and I know Win95.

  4. Posted April 16, 2010 at 8:53 am | Permalink

    Chris,

    You’re not trying to call the unloadAndStop method directly on the Captivate-generated swf, are you? If so, then that’s the problem – the swf files that are published from Captivate are NOT the same as a normal Flash swf. They use a completely different API. You can’t even apply a simple “stop()” method to them – it ignores it.

    So what you need to do is load the Cp swf into a flash movieclip first, and then try the unloadAndStop(). It’s obviously been a while since I wrote this post and I haven’t messed with this stuff in quite a while so I don’t remember how well it worked, but it *should* work. Let us know if you try it.

    mark

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Subscribe without commenting