PDA

View Full Version : Calling function in swf with java


arkum
07-23-2007, 05:40 PM
Hi,

have a swf embedded in an html page. Trying to pass the path of an flv to the swf so it can play it.

I have the following javascript in the page body:

function loadPlaylist() {
var player = document.getElementById("flashcontent");
player.loadPlaylist("content/flv/heres_johnny.flv");
}

the swf is in a div called flashcontent and the function in the swf is called loadPlaylist:

var connection = ExternalInterface.addCallback("loadPlaylist", null, player.loadPlaylist);


I'm calling the function from the body tag using <body onload="loadPlaylist();">

Is this the right idea?

Thanks

Boskic.com
07-24-2007, 09:01 PM
http://www.permadi.com/tutorial/flashjscommand/