Click to See Complete Forum and Search --> : controll a flashmovie


anton1
12-04-2003, 04:16 PM
please help me, i try to controll a flashmovie from a webpage with html/javascript
i want to sent GotoandPlay commands to different frames in the flashmovie from links in a menu-bar

this test is only for Microsoft I.E.

this is the function:

var moviename = "test";
var movie_ready = "false";

function playmovie()
{
if(movie_ready == "false")
{
while(movie_ready == "false")
{
if(window[test].PercentLoaded() == 100)
{
window[test].GotoFrame(2);
movie_ready ="true";
}
}
}
else
{window[test].StopPlay();
}

end of function

movie name is test.swf

as an event i use a link with a functioncall: playmovie()

nothing happens what do i wrong???

is there a good script to controll a flash-movie form a webpage using javascript?

edelmatt
12-04-2003, 04:31 PM
The FSCommand API is available in Flash to allow JavaScript control of a flash movie from client-side scripting.

HOWEVER, there is no way for this to work on Macintosh or for Netscape browsers newer than 4.5.

If this isn't a big stumbling block for you, let me know and I can point you to some information (I'll have to look for the links).

If you need to support Macintosh and Netscape, I think you should forget trying to control Flash via JavaScript.

anton1
12-04-2003, 05:20 PM
yes i'm working on a mac(sys 9) and test it with IE for mac, is this why i didnt see the script working?

edelmatt
12-04-2003, 05:27 PM
I would assume that is why, yes.

Look at this article to see if your particular browser is a part of the "non-supported" ones:
http://www.macromedia.com/support/flash/ts/documents/mac_ie_issues.htm#scr

It's very frustrating, I know. It's unfortunate Macromedia can't find a plausible solution because controlling flash movies via JavaScript (and vice versa) would be very powerful if it was better supported.