need to pass .swf flashvars into shadowbox - dont know how to

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

need to pass .swf flashvars into shadowbox - dont know how to

adman22
I am able to get a plain .swf file to play in a shadowbox via

My problem is I need to pass dynamic content into the .swf file. I cant figure out to get the shadowbox to open and then have the .swf file display the dynamic content. Here is the flash code I am using:

<script type="text/javascript"> var fo = new SWFObject("flash/peopleGallery/loader.swf", "People Viewer", "740px", "360px", "8", "#ffffff"); //Optional Configuration //fo.addVariable("langOpenImage", "Open Image in New Window"); //fo.addVariable("langAbout", "About"); fo.addVariable("xmlURL", "images/peoples/" + peopleid + "/gallery.xml"); fo.addVariable("enlarge", zoomID); fo.write("flashcontent"); </script>       
(the *peopleid* is populated by a numerical number by looking in the url for the that reference)


Any help would great.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

otheroom
You can include flash params in the a rel tag.

a rel="shadowbox;player=swf;options={flashParams:{allowFullScreen:true}}"

I believe that will pass in the values that you're specifying with the addVariable functions.
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

adman22
thanks for the feedback but was unsuccessful. Might anyone else have a solution?
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

adman22
bump
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Wizzud
In reply to this post by adman22
Try with flashVars instead of flashParams
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

adman22
Great. That worked out. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Emil_hr
In reply to this post by Wizzud
I used the solution you suggested and it passed the values to swf, but then shadowbox does not work anymore (swf is opened as separate link).

//code on html page that properly opens swf in the sb
script
    Shadowbox.init({players:["swf"]})
    /script
 a rel="shadowbox;width=980;height=700" href="Galerija2.swf"> div id="imageContainer_teran"/div>/a>

//code on html page that properly passes value to swf but opens swf as new page
a rel="shadowbox;width=980;height=700;options={flashVars:{hiza:teran}}" href="Galerija2.swf" >div id="imageContainer_teran">/div>/a>

thanks,
Emil
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Wizzud
Why have you removed the script that initialises shadowbox?
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Emil_hr
no i didn't. i just put in the 2nd example what was different from the first case.
you can check on http://trviz.com/?page_id=10 how it really works.

Thanks for the reply though.
Emil
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Wizzud
Ah, a link to a page!
But, as you say, it works. So of limited help.

On the assumption that teran is a string, you might try putting quotes round it to denote it as such...
"shadowbox;width=980;height=700;options={flashVars:{hiza:'teran'}}"
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Emil_hr
i put the non working case on the http://trviz.com/?page_id=14&lang=en so you can see the behaviour.

Emil
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Wizzud
"shadowbox;width=980;height=700;options={flashVars:{hiza:'teran'}}"
                                                  ^
                                                  Note the colon!
Combine literacy with curiosity and a whole world of information opens up to you
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Emil_hr
It works with single quotes finally!
Sorry for that last post, guess i was tired of looking at the same code for so long.

Thank for your patience and involvement.
Reply | Threaded
Open this post in threaded view
|

Re: need to pass .swf flashvars into shadowbox - dont know how to

Magnolia
Patience, I'm running out of it in Drupal.