View Full Version : Loading movies in Flash

10-14-2008, 08:17 PM
Kind of a strange question to post in the Javascript forum, but I swear I have seen this done. Loading movies into a flash player via text links with Javascript. So there is one singular player and the individual movies are loaded into the player. Is this possible, or was I just dreaming? :confused:

Thank you!

10-23-2008, 09:04 PM
Bump-- anyone know or can you give me a hint please? I noticed something like that with JW Player, but I want to make sure it's possible first...

10-23-2008, 09:30 PM
You can do this easily in Flashplayer 8/9 with a new object that communicates b/n javascript and flash (ie the ExternalInterface API). However, you can't rely on everyone having 8/9 yet (and iirc it has problems if you're html document isn't 100% xhtml strict) so what I do to send data into flash via javascript is create an invisible 1px by 1px controller swf that I simply delete and then re-insert into the html document each time I want to pass information to my main swf.

- Javascript can send variables into Flash on load (using flashvars or url appends).
- Flash movies can communicate with each other at runtime.

So the most-compatible solution is obvious: create the controller swf that onload=communicates with your main swf. Then just keep re-launching the controller swf, inserting your variables via the url appends.