swfobject.js

Discussion in 'HTML' started by trig, Dec 21, 2006.

  1. trig

    trig Guest

    I have downloaded the swfobject.js file from
    http://www.adobe.com/devnet/flash/articles/swfobject.html and it works
    fine if i put the following code in:

    <script type="text/javascript" src="swfobject.js"></script>


    <div class="style1" id="flashcontent">
    You do not have the latest Flash Player Plugin</div>


    <script type="text/javascript">
    var so = new SWFObject("my_site_v3.swf", "flashcontent", "900",
    "700", "7", "#131313");
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.addParam("salign", "t");
    so.write("flashcontent");
    </script>


    BUT


    if i try putting:


    var so = new SWFObject("my_site_v3.swf", "flashcontent", "100%",
    "100%", "7", "#131313");


    it doesn't work.


    I want my flash movie to scale to the size of the browser window like
    it does when you export in flash with width 100% Height 100%.


    This code works to scale the movie:


    <object
    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab..."

    name="flashcontent" width="100%" height="100%" align="middle"
    id="my_site_v3">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="my_site_v3.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#131313" />
    <embed src="my_site_v3.swf" width="100%" height="100%" align="middle"

    quality="high" bgcolor="#131313" name="flashcontent"
    allowscriptaccess="sameDomain" type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />


    </object>


    but i don't want to active the flash movie by clicking on it.


    TO SUMMARISE:


    What i want to do is NOT have to click on my flash movie to activate it

    (i.e. get rid of the surrounding box when it loads - which i think the
    swfobject.js solves) BUT I ALSO WANT TO be able to to SCALE the movie
    using WIDTH 100% HEIGHT 100%


    Please help
     
    trig, Dec 21, 2006
    #1
    1. Advertising

  2. trig wrote:
    > I have downloaded the swfobject.js file from....
    > This code works to scale the movie:


    Wrap that code in javascript and all will be fine. Remember to use
    noscript and just put the Object code there. That way anyone without
    javascript turned on will still see your flash.




    > <object
    > codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab..."
    >
    > name="flashcontent" width="100%" height="100%" align="middle"
    > id="my_site_v3">
    > <param name="allowScriptAccess" value="sameDomain" />
    > <param name="movie" value="my_site_v3.swf" />
    > <param name="quality" value="high" />
    > <param name="bgcolor" value="#131313" />
    > <embed src="my_site_v3.swf" width="100%" height="100%" align="middle"
    >
    > quality="high" bgcolor="#131313" name="flashcontent"
    > allowscriptaccess="sameDomain" type="application/x-shockwave-flash"
    > pluginspage="http://www.macromedia.com/go/getflashplayer" />


    Also, use this as your template for the Flash and you can lose embed:

    <object type="application/x-shockwave-flash" data="yourswf.swf".....
    <param name="movie" value="yourswf.swf"/>
     
    Travis Newbury, Dec 24, 2006
    #2
    1. Advertising

  3. trig

    trig Guest

    Please accept my apology for this post but i don't understand what it
    is you are telling me to do:

    "Wrap that code in javascript and all will be fine" - don't know what
    that means and which code you're refereing to

    "Remember to use noscript and just put the Object code there." - don't
    know what that means

    "Also, use this as your template for the Flash and you can lose embed:

    <object type="application/x-shockwave-flash" data="yourswf.swf".....
    <param name="movie" value="yourswf.swf"/>" - don't know where to put
    this.

    I'm sorry again but i guess what i need for an answer is the whole code
    written so that i understand it, that's everything from the <HTML> tag
    down to the </HTML> tag.

    I understand if this is to time consuming for you,

    thanks for the reply



    Travis Newbury wrote:
    > trig wrote:
    > > I have downloaded the swfobject.js file from....
    > > This code works to scale the movie:

    >
    > Wrap that code in javascript and all will be fine. Remember to use
    > noscript and just put the Object code there. That way anyone without
    > javascript turned on will still see your flash.
    >
    >
    >
    >
    > > <object
    > > codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab..."
    > >
    > > name="flashcontent" width="100%" height="100%" align="middle"
    > > id="my_site_v3">
    > > <param name="allowScriptAccess" value="sameDomain" />
    > > <param name="movie" value="my_site_v3.swf" />
    > > <param name="quality" value="high" />
    > > <param name="bgcolor" value="#131313" />
    > > <embed src="my_site_v3.swf" width="100%" height="100%" align="middle"
    > >
    > > quality="high" bgcolor="#131313" name="flashcontent"
    > > allowscriptaccess="sameDomain" type="application/x-shockwave-flash"
    > > pluginspage="http://www.macromedia.com/go/getflashplayer" />

    >
    > Also, use this as your template for the Flash and you can lose embed:
    >
    > <object type="application/x-shockwave-flash" data="yourswf.swf".....
    > <param name="movie" value="yourswf.swf"/>
     
    trig, Jan 2, 2007
    #3
  4. trig wrote:
    > Please accept my apology for this post but i don't understand what it
    > is you are telling me to do:


    Then you may want someone else to do it for you. If you would like to
    learn, then Google "Flash activex javascript fix" for a plethora of
    examples.
     
    Travis Newbury, Jan 3, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. trig

    swfobject.js

    trig, Dec 21, 2006, in forum: Javascript
    Replies:
    0
    Views:
    94
  2. K.

    SWFOBject problem on IE 6.0.

    K., Oct 15, 2007, in forum: Javascript
    Replies:
    6
    Views:
    112
  3. TonnyD

    swfobject is undefined

    TonnyD, Nov 13, 2007, in forum: Javascript
    Replies:
    7
    Views:
    154
    Doug Miller
    Nov 14, 2007
Loading...

Share This Page