Hi all,
I''ve been using a plugin called swf_fu which seemed fairly easy to
implement for adding flash content to my rails app. However, I''m
trying
to pass a variable to my flash through rails and have the flash content
pick it up.
The variable is already retrieved in an earlier call to the database so
I don''t believe it''s any type of authentication string issue.
Here''s
two examples:
<%= swf_tag "victory.swf", :size => "250x75", :div_id
=> "flbars",
:flashvars => "victory_id=#{@virtuals_victory}", :parameters =>
{:wmode
=> ''transparent''} %>
OR
<%= swf_tag "victory.swf", :size => "250x75", :div_id
=> "flbars",
:flashvars => {:victory_id => @virtuals_victory}, :parameters =>
{:wmode
=> ''transparent''} %>
As a generic test, I''m passing the following value with
@virtuals_victory by doing @virtuals_victory = 76.
In my flash I''m doing:
onSelfEvent (load) {
victoryID = this.loaderInfo.parameters.victory_id;
}
.. which is going to pull the victory_id value sent to it through
swfobject''s flashvars.
When I pull it up, it doesn''t show the value and the source shows the
following:
swfobject.embedSWF("/swfs/victory.swf?1248962132","flbars","250","75","7","/swfs/expressInstall.swf?1248568039",{"victory_id":"76","id":"victory"},{"wmode":"transparent"},{"id":"victory"})
As you can see, right after the expressInstall, the flashvars hash is
showing "victory_id":"76" in the first case and in the
second case it
shows "victory_id":76.
Does anyone have an idea of why flash isn''t retrieving the flashvars
with swfobject? I''ve checked the readme of the plugin and it says:
=== Options
* <tt>:id</tt> - the DOM +id+ of the flash +object+ element that is
used
to contain the Flash object; defaults to the name of the swf in +source+
* <tt>:width, :height</tt> - the width & height of the Flash
object.
Defaults to "100%". These could also specified using :size
* <tt>:size</tt> - the size of the Flash object, in the form
"400x300".
* <tt>:mode</tt> - Either :dynamic (default) or :static. Refer to
SWFObject''s
doc[http://code.google.com/p/swfobject/wiki/documentation#Should_I_use_the_static_or_dynamic_publishing_method?]
* <tt>:flashvars</tt> - a Hash of variables that are passed to the
swf.
Can also be a string like
<tt>"foo=bar&hello=world"</tt>. Defaults to
<tt>{:id => the DOM id}</tt>
* <tt>:parameters</tt> - a Hash of configuration parameters for the
swf.
See Adobe''s
doc[http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701#optional]
* <tt>:alt</tt> - HTML text that is displayed when the Flash player
is
not available. Defaults to a "Get Flash" image pointing to Adobe
Flash''s
installation page. This can also be specified as a block (see embedding
section)
* <tt>:flash_version</tt> - the version of the Flash player that is
required (e.g. "7" (default) or "8.1.0")
* <tt>:auto_install</tt> - a swf file that will upgrade flash player
if
needed (defaults to "expressInstall" which was installed by swf_fu)
* <tt>:javascript_class</tt> - specify a javascript class (e.g.
"MyFlash") for your flash object. If it exists, the initialize method
will be called.
* <tt>:initialize</tt> - arguments to pass to the initialization
method
of your javascript class.
* <tt>:div_id</tt> - the DOM +id+ of the containing div itself.
Defaults
to <tt>"#{option[:id]}"_div</tt>
* <tt>:switch_off_auto_hide_show</tt> - switch off
SWFObject''s default
hide/show behavior. SWFObject temporarily hides your SWF or alternative
content until the library has decided which content to display. Defaults
to nil.
So, at this point I''m not understanding why I can''t get this
to work.
I''ve also tried doing:
skip_before_filter :verify_authenticity_token
.. on the controller processing the variable ..
Any advice on this issue?
--
Posted via http://www.ruby-forum.com/.