3

HTML:

<div class="playerFlashBox">
    <object width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" data="/flash/Player.swf" >
        <param name="movie" value="/flash/Player.swf">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
        <param name="quality" value="high" />
        <param name="wmode" value="opaque">
        <param name="FlashVars" value="ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>" />
        <embed width="800" height="450" type="application/x-shockwave-flash" id="playerSWF" name="playerSWF" src="/flash/Player.swf" class="playerBox"
            allowScriptAccess="sameDomain"
            allowFullScreen="true"
            quality="high"
            flashVars="ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>"
            pluginspage="http://www.adobe.com/go/getflashplayer"
        ></embed>
    </object>
</div>

Javascript:

<script type="text/javascript">
    var flashvars = {
        "ProjectId=<%= @project.id.to_s %>&amp;Language=<%= @locale %>"
    };
    var params = {
        allowScriptAccess: "sameDomain", 
        allowFullScreen: "true",
        wmode: "opaque",
        quality: "high",
        menu: "false"
    };
    var attributes = {}; attributes.styleclass="playerBox";

    swfobject.embedSWF("/flash/Player.swf", "playerFlashBox", "800", "450", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

I want to replace this with a clean swfobject statement. I just have no clue how to work with the flashvars attribute. Any ideas?

1
  • 1
    You have an error in a name of your parameter: PrOjectId Commented Jul 26, 2011 at 8:30

2 Answers 2

4

you create it as an object like the params and attributes:

var flashvars = {
    PrjectId:"<%= @project.id.to_s %>",
    Language:"<%= @locale %>"
};
Sign up to request clarification or add additional context in comments.

Comments

1

From flash you can pull up the vars by doing:

var flashVars:Object = this.root.loaderInfo.parameters;
var projectId:String = flashVars["PrjectId"];
var language:String = flashVars["Language"];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.