I think it’s a little strange that Captivate is owned by the same company as Flash and exports ‘swf’ format, yet there’s no option to simply dispatch a Flash event. Which makes communication between a Flash holder and the Captivate movie problematic.
There are a few solutions(i.e. hacks!) out there:
- Import a flash movie on the final frame of the movie, which contains the actionscript that we wanted to execute, perhaps by calling a function on the root…
- pipwerks blog had a very interesting lateral thinking solution: Captivate actually permits you to call a javascript function. Flash can be listening to this function with a callback.
I found both of these methods with their drawbacks in their own ways.
Solution 1 has potential scope issues, that the child Flash movie would have to know exactly the path to call the function, and could easily be problematic once we start incorporating preloaders.
Solution 2 (Captivate->HTML[Javascript]->Flash communication). Although a neat solution, I always try to avoid this sort of thing if possible just to avoid the possibility of browser / cross-platform issues, etc.
I was looking at other possibilities within Captivate and discovered that one Flash-esque thing that Captivate can do, is set a variable. I realized that quite a simple and neat solution was possible:
After loading the Captivate file, the parent Flash file can be constantly checking if the Captivate file has set the variable (on enter frame) and when it has, trigger an action.
This is easily accessed. I had a variable called ‘completed’, and I checked it via:
loader.content.completed
Leave a Reply