Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    i'm currently using swf object to embed my .swf ... so an image is there if flash player is not installed but i need that page to still initiate a timed redirect to another page only if flash isnt installed..

    could someone help me w/ this?

    JS i'm using now

    Code:
    <script type="text/javascript">
    var flashvars = {};
    var params = {}; 
    
    var attributes = {};
    
    swfobject.embedSWF("logo.swf", "logo-1", "750", "120", "9.0.0","expressinstall.swf", flashvars, params, attributes);
    </script>

  2.  

  3. #2
    Junior Member
    Join Date
    Apr 2009
    Posts
    5
    Member #
    18792
    Quote Originally Posted by kade119
    Code:
    <script type="text/javascript">
    var flashvars = {};
    var params = {}; 
    var attributes = {};
    swfobject.embedSWF("logo.swf", "logo-1", "750", "120", "9.0.0","expressinstall.swf", flashvars, params, attributes);
    </script>
    hmm.. two things:
    you'll need to set up your flash to call a JavaScript function in your page
    (with ActionScript 3 that's as simple as:
    Code:
     import flash.external.*; ExternalInterface.call("clearnoflash");
    )

    the function the swf will call will clear a no-flash timeout that has been set.
    Code:
    //this function should get called by your flash as soon as its loaded
    function clearnoflash() {
     clearTimeout(noflash);
    }
     //noflash will have to be a globaly defined timeout
    i think logo-1 is the id of the div where the flash will go?
    so some simple javascript if logo-1 starts out empty
    you'll do this right after the swfobject placement:
    Code:
    //this code would go right after the SWFObject placement code
    function checkflash() {
    if (document.getElementById('logo-1').hasChildNodes())
    {//goto alternate page because flash object is there yet timeout was not cleared}
    }
    //here's the noflash global var
    var noflash=setTimeout("checkflash()", "15000");
    and that's a simple way to do it, if you want more control you will have to do away with SWFObject

    hope this helps


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:47 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com