Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorSelArom
    • CommentTimeApr 8th 2008 edited
     
    Hi, I'm a bit new to SWFObject but I have been using it and love it so far. However I have encountered a huge problem for which I just can't find a workaround. I want to be able to show an ajax asp.net control as alternative content for the flash. I have a componentart rotator control that uses ajax/javascript to cycle slides in a similar fashion to the flash I want to replace.

    On a browser without flash installed, it renders the control perfectly, and I'm able to see the ajax control instead of the flash. If I view the page on a browser WITH flash, it does indeed replace all the alternative content with the flash and that shows up just fine as well.

    The problem is that the control on page load registers a scriptresource.axd file which contains the javascript code for the control into the HEAD of the html document. This script contains the code to cycle the ajax control, but since the SWFObject deletes the control and replaces it with the flash, the script is trying to run on a control that isn't there, and so I get Javascript errors.

    I can see no way to work around this. I tried making the control invisible, which obviously prevents it from rendering the scriptresource.axd, but of course it also prevents it from rendering on the non-flash browser! Does anybody have ANY idea on how I might resolve this issue?
    • CommentAuthorphilip
    • CommentTimeApr 8th 2008
     
    with SWFObject 1.5, you could simply tell the page to do the non-Flash stuff only when SWFObject fails to embed the SWF:


    var so = new SWFObject( ...usual code here... );
    if(so.write("flashcontent")){
    //Flash is available and SWF has been embedded.
    } else {
    //Flash not available or SWF couldn't be embedded
    //...go ahead and call your ajax code
    }


    but remember, SWFObject 1.5 is now considered deprecated, and SWFObject 2.0 uses a completely different syntax. check the SWFObject 2 google group for more info on working with SWFObject 2.0

    - philip