开发者

How to unload cleanly an Adobe Captivate SWF from Flash Player 9 (not 10)

Why doesn't Adobe follow their own advice and have a Captivate swf listen for its own UNLOAD event, and clean up all its timers, event listeners, external references, etc.

I'm finding it VERY DIFFICULT to get an Adobe Captivate swf out of the flash player's memory once loaded in with the Loader. Clearly, the unloadAndStop method isn't available in Flash Player 9, so please don't even mention that, unless you have the equivalent of the actionscript source code for the method that will work in flash player 9.

I tried setting the Loader.content["rdcmndRewindAndStop"] to 1, to cause the Captivate file to rewind and stop. That much works, but then I see in the debugger output after unloading the content that the content is still hanging out in memory responding to some events:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at captivate.Veela_AS3::rdAVM1SwfLoader/getLoadBase()
at captivate.Veela_AS3::rdAVM1SwfLo开发者_运维知识库ader/onload()
at captivate.Veela_AS3::rdAVM1SwfLoader/initItemVariables()
at captivate.Veela_AS3::rdItem/frame1()


Even with Flash Player 10 and the unloadAndStop method with nothing happening but the captivate movie being loaded, memory usage being traced out to a text field, and forcing garbage collections, I can see the captivate file will not Unload, ever even in the most simple situation

I'm considering putting the captivate files and loading them from a seperate security domain, subdomain of the server and will try this out. If anyone has had success I would like to know.

Thanks,

kb


Recently had to deal with this same issue, I was tasked with updating a flash "content player" also made in flash. Problem is they now wanted it to play Captivate content that had been published as SWFs.

I fixed the Captivate unloading problem by loading them into their own copy of another flash file.

So I have:

  • ContentPlayer.fla
  • CaptivateLoader.fla
  • Captivate.cptx

Any time a new Captivate needs to be loaded, ContentPlayer instead loads a new copy of CaptivateLoader.swf, and tells it to load the Captivate.swf. When contentPlayer unloads the previous CaptivateLoader.swf, anything it loaded gets destroyed with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜