SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A time loading problem with FreFox

    Hi friends ,
    I have a little problem in Html page , when the pages load , I execute a function in the body tag in the Onload that sends a parameter to an interactive flash (.swf file) in the page .

    What I know is that the OnLoad event takes place after the page loads everything .

    The problem is that the javascript on FireFox doesn't wait till the flash completes its loading , but sends the parameter to the flash file when its loading which causes an error in the page .


    This is the Javascript function :

    Code JavaScript:
    function formSend(color) {
      getFlashMovie("toolBar2").sendPageFlip(color);
     }


    and this the OnLoad event :
    Code HTML4Strict:
    <body onload='formSend("FFFFFF")'  >
    I need a Javascript function or maybe a Dom function that makes sure that the page and the flash file has been totally loaded , then execute another Javascript function that sends a parameter to the flash file .

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you might try the window.onload handler in place of body.onload.
    If that doesn't work, try something like-

    Code:
    function formSend(color) {
    	if(getFlashMovie && getFlashMovie("toolBar2")){
    		getFlashMovie("toolBar2").sendPageFlip(color);
    	}
    	else setTimeout(function(){formSend(color)},100);
    }


Bookmarks

Posting Permissions

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