Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with getElementbyID on flash object

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    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
    }
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Do you have a link to your page?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #6
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone else would have an idea ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •