-
Hi,
I need to do this simple thing- set a variable in a flash movie from JS, but the silly code doesn't wanna work. Here is the javascript code snippet:
..
function setModuleCount()
{
window.littlemovie.SetVariable("moduleCount", "10");
}
..
and the flash code is:
..
var moduleCount;
getURL("javascript:setModuleCount();");
..
But after that, I have verified that moduleCount does NOT get the value of 10 as it should get. What is missing? The flash code is written in a layer of a frame, and the <object> had id set correctly to "littlemovie". I've even tried to, within the setModuleCount function call alert(window.littlemovie.IsPlaying())) and that works..
/puzzled David
-
did you add the object id(IE) or embed name + swfLiveconnect var(netscape) to the html?
-
Yep, I've done that, object ID is set to the proper moviename im calling in the javascript function
-
actually i think the call should be:
window.document.littlemovie.SetVariable("moduleCou nt", "10");
-
did you get it to work ?
hi!
I am looking for a similar use. Could you get this to work ?
if so, please let me know.
thanks
mav
-
Maven5,
I got it to work, it was kind of weird. The call to SetVariable did work, only that I used the variable in my Flash movie too quickly. That may sound strange and it is, but it seems like it takes some time for the SetVariable call to complete, so before I use the variable in the Flash code, I simply make a small loop between two frames, takes half a second or something, and then continue and the variable is set! Very very strange and even more ugly, but it was the only way I could go around the problem.
Good luck
/David
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|