Not signed in (Sign In)

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

    • CommentAuthormauro
    • CommentTimeNov 29th 2007
     
    I want to embed this flash badge:

    <embed src="http://static.twitter.com/flash/twitter_timeline_badge.swf" flashvars="user_id=10681602&color1=0xFFFFCE&color2=0xFCE7CC&textColor1=0x4A396D&textColor2=0xBA0909&backgroundColor=0x92E2E5&textSize=10" width="200" height="400" quality="high" name="twitter_timeline_badge" align="middle" type="application/x-shockwave-flash" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed><br><a style="font-size: 10px; color: #0xBA0909; text-decoration: none" href="http://static.twitter.com/comunerimini"><img src="http://static.twitter.com/images/twitter_bubble_logo.gif" border="0" /></a>

    This code work great with wordpress powered blogs but i can't use it in my xhtml 1.0 strict website powered by a content mangement system with xstandard text editor, so i would like to use SWFObject.
    This is my trial:

    <head>
    .......
    <script type="text/javascript" src="../js/swfobject.js"></script>
    .......
    </head>
    .......
    <div id="flashcontent"><p><strong>Attenzione รจ necessario installare o aggiornare Flash Player! </strong></p></div>
    <script type="text/javascript">//<![CDATA[
    var so = new SWFObject("http://static.twitter.com/flash/twitter_timeline_badge.swf", "twitter_timeline_badge", "200", "400", "8", "#FF6600", true);
    so.addVariable("user_id", "10681602");
    so.write("flashcontent");
    // ]]></script>
    ......
    But this code doesn't run. Where i wrong ?
    Basically i need to pass the user id.

    Thank you all for your wonderful SWFObject!

    Mauro Ferri
    Comune di Rimini
    http://www.comune.rimini.it
    • CommentAuthorAran
    • CommentTimeDec 2nd 2007
     
    So, a few things.

    1. If you are using swfobject 1.5, your last param passed is incorrect:

    var so = new SWFObject("http://static.twitter.com/flash/twitter_timeline_badge.swf", "twitter_timeline_badge", "200", "400", "8", "#FF6600", true);

    should just be

    var so = new SWFObject("http://static.twitter.com/flash/twitter_timeline_badge.swf", "twitter_timeline_badge", "200", "400", "8", "#FF6600");

    as the method signature is:

    var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);

    Also, I think you need to pass the remaining flashvars and script access param to get everything working as intended.

    Are you sure that your relative path of src="../js/swfobject.js is being found? If you can post a live page, I can check to seewhat is happening.

    Cheers,
    Aran
    • CommentAuthorphilip
    • CommentTimeDec 4th 2007
     
    i agree with Aran.

    your SWFObject declaration is using outdated syntax, and your Flashvars aren't getting passed.

    this:

    <script type="text/javascript">//<![CDATA[
    var so = new SWFObject("http://static.twitter.com/flash/twitter_timeline_badge.swf", "twitter_timeline_badge", "200", "400", "8", "#FF6600", true);
    so.addVariable("user_id", "10681602");
    so.write("flashcontent");
    // ]]>
    </script>


    becomes this:

    <script type="text/javascript">//<![CDATA[
    var so = new SWFObject("http://static.twitter.com/flash/twitter_timeline_badge.swf", "twitter_timeline_badge", "200", "400", "8", "#FF6600");
    so.addVariable("user_id", "10681602");
    so.addVariable("color1", "0xFFFFCE");
    so.addVariable("color2", "0xFCE7CC");
    so.addVariable("textColor1", "0x4A396D");
    so.addVariable("textColor2", "0xBA0909");
    so.addVariable("backgroundColor", "0x92E2E5");
    so.addVariable("textSize", "10");
    so.write("flashcontent");
    // ]]>
    </script>


    definitely double-check your swfobject.js filepath

    - philip
    • CommentAuthormauro
    • CommentTimeDec 4th 2007
     
    Great, now it's ok, i fix my problem with your advice.

    Thank you very much Aran and Philip !!