PDA

View Full Version : Can Javascript reset variables in my movie?


danG
09-15-2005, 08:01 PM
I use a switch statement in the moviePlayer_DoFSCommand(command, args) to call a javascript function that trys to reset a variable within my .swf movie. That variable, "movieName" is used to load an external .swf into a clipholder on the _root timeline. Problem is, I keep getting browser errors saying that the Object (the flash movie) does not recognize the method.

I use this Javascript function to get the movie name:

function thisMovie(movieName) {
if (navigator.appName.indexOf ("Microsoft") !=-1) {
return window[movieName]
} else {
return document[movieName]
}
}

I use this code to reset the variable in the flash movie:

thisMovie("moviePlayer").set("movieName", "newMovieName");