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

13 messages Options
Embed this post
Permalink
adman22

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

Reply Threaded More More options
Print post
Permalink
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.
otheroom

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

Reply Threaded More More options
Print post
Permalink
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.
adman22

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

Reply Threaded More More options
Print post
Permalink
thanks for the feedback but was unsuccessful. Might anyone else have a solution?
adman22

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

Reply Threaded More More options
Print post
Permalink
bump
Wizzud

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

Reply Threaded More More options
Print post
Permalink
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
adman22

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

Reply Threaded More More options
Print post
Permalink
Great. That worked out. Thanks.
Emil_hr

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

Reply Threaded More More options
Print post
Permalink
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
Wizzud

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

Reply Threaded More More options
Print post
Permalink
Why have you removed the script that initialises shadowbox?
Combine literacy with curiosity and a whole world of information opens up to you
Emil_hr

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

Reply Threaded More More options
Print post
Permalink
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
Wizzud

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

Reply Threaded More More options
Print post
Permalink
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
Emil_hr

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

Reply Threaded More More options
Print post
Permalink
i put the non working case on the http://trviz.com/?page_id=14&lang=en so you can see the behaviour.

Emil
Wizzud

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

Reply Threaded More More options
Print post
Permalink
"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
Emil_hr

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

Reply Threaded More More options
Print post
Permalink
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.