...

View Full Version : Problem with getElementbyID on flash object



Romain_nz
06-29-2006, 05:42 AM
Hi there,
I am including a flash object on my page using the swfobject script,

<script type="text/javascript">
// <![CDATA[
var fo = new FlashObject("flash/images.swf", "images", "490", "366", "7", "#FFffff");
fo.addParam("name","images");
fo.addParam("id","images");
fo.addParam("swliveconnect","true");
fo.addParam("wmode","transparent")
fo.write("flashcontent");
// ]]>
</script>


and later on i call a function to send a variable to that flash object.

Now that works fine on Firefox and IE6, but for some reason IE 5 and 5.5 throws a wobly and gives me an error on that function :

function loadimage(path,picnum,title,type)
{
var myFlash=document.getElementById('images');
myFlash.SetVariable("imagepath", path);
myFlash.SetVariable("globalPicNum",picnum);
myFlash.SetVariable("globalType",type);
myFlash.SetVariable("globalTitle",title);
}

If anyone could explain how to fix it i would be immensely grateful...
Thanks,
Romain

_Aerospace_Eng_
06-29-2006, 05:55 AM
On which function? The flash object function or the loadimage function? Hmm seeing as how the 'fo' variable is global something like this for the loadimage function might work better

function loadimage(path,picnum,title,type)
{
fo.SetVariable("imagepath", path);
fo.SetVariable("globalPicNum",picnum);
fo.SetVariable("globalType",type);
fo.SetVariable("globalTitle",title);
fo.write('flashcontent'); //this bit might not be needed, not sure if the SetVariable functions will update the flash by themselves
}

Romain_nz
06-29-2006, 06:01 AM
Thanks for the quick reply
The error is on the loadimage function sorry.

I tried using fo to identify the flash movie, but then it doesn't even work anywhere any more...

Any other id ? I can't see what the difference would be between ie5 and ie6...

_Aerospace_Eng_
06-29-2006, 06:03 AM
Do you have a link to your page?

Romain_nz
06-29-2006, 08:12 AM
http://www.schbleuh.net/index.php

Romain_nz
07-01-2006, 04:23 AM
Anyone else would have an idea ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum