Not signed in (Sign In)

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

    • CommentAuthorscollege
    • CommentTimeMar 29th 2007
     
    Been trying to enter the simplest example in a ASP.NET user control (*.ascx) but hey, it simply will not work:
    ---------------------
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    var so = new SWFObject("so_tester.swf", "mymovie", "350", "175", "8", "#FFFFFF");
    so.write("flashcontent");
    </script>
    <div id="flashcontent">This is replaced by the Flash content. </div>
    ---------------------

    All I see is the text "This is replaced by the Flash content. ".

    Internet Explorer 6 just gives me that helpful message " 'null' is null or not an object".
    • CommentAuthorscollege
    • CommentTimeMar 29th 2007
     
    Just answered my own question.

    In a user control, you'll need to insert the SWFObject code into a function and call it with an "onLoad" event in the user control's body tag.

    ---------------------
    <body onLoad="doLoad()">
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    function doLoad()
    {
    var so = new SWFObject("so_tester.swf", "mymovie", "350", "175", "8", "#FFFFFF");
    so.write("flashcontent");
    }
    </script>
    <div id="flashcontent">This is replaced by the Flash content. </div>
    ---------------------