Solved

php to swf - param name="FlashVars" value="id=123&rid=456"

Posted on 2006-11-11
8
377 Views
Last Modified: 2008-02-01
Ok, I am not a flash expert so be understanding, thanks!  I have PHP file that will send data into flash, such as:

goingintoflash.php
<param name="FlashVars" value="id=123&wa=456&ww=789">

Inside the fla file I have image that is clickable or hotspot, not sure of flash lingo

on (release) {
      getURL("learnmore.php", "_self");
}

How do I get in flash, learnmore.php to be "learnmore.php?id=123&wa=456&ww=789  ???
I read somewhere that it goes in the root?  Where is that????
0
Comment
Question by:precision
  • 4
  • 4
8 Comments
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 17923585
variables which you pass to flash using flashVars it always available on _root.

if you want the hardcoded link in flash then here is the code:
----------------------
on (release) {
     getURL("learnmore.php?id=123&wa=456&ww=789", "_self");
}

--------------------


on other hand,if you want to use received variables into URL, so code should be like this, you can use it from within any movieCLip, without changing anythng:
----------
on (release) {
      getURL("learnmore.php?id="+_root.id+"&wa="+_root.wa+"&ww="+_root.ww, "_self");
}

----------

-Aneesh
0
 

Author Comment

by:precision
ID: 17923599
Interesting...so my index.html will contain the flashVars and that will inject the data into flash and using this as you told me...

on (release) {
     getURL("learnmore.php?id="+_root.id+"&wa="+_root.wa+"&ww="+_root.ww, "_self");
}

and when user clicks on the url it will drag the data back out?

Nice if so...Let me know before I try
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17923607
yes, you got it right,
0
 

Author Comment

by:precision
ID: 17930835
Ok, just had the time to try, does not work, I know its me, not sure where to find the issue.  In the index.php file I have:

<param name="FlashVars" value="id=123&wa=456&ww=789">

Then in the swf I stuck:

on (release) {
     getURL("learnmore.php?id="+_root.id+"&wa="+_root.wa+"&ww="+_root.ww, "_self");
}

Not working though, does the code above have to be in certain scene or level? I am not a flash expert.

Thanks!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17930943
you have to put the above code on a button..

0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17930956
and on click of button above code will execute...

alternative, just put following code in FLA's first frame:
---------
getURL("learnmore.php?id="+_root.id+"&wa="+_root.wa+"&ww="+_root.ww, "_self");
---------

it will gets executed itself as swf loads in browser
0
 

Author Comment

by:precision
ID: 17931225
Its on a button already, I just exchanged:

on (release) {
     getURL("learnmore.php", "_self");
}

FOR

on (release) {
     getURL("learnmore.php?id="+_root.id+"&wa="+_root.wa+"&ww="+_root.ww, "_self");
}

My learnmore.php has in body:

<?=$_GET['id']?><br>
<?=$_GET['wa']?><br>
<?=$_GET['ww']?><br>

learnmore.php comes up blank.
0
 

Author Comment

by:precision
ID: 17931369
Just got it to work....Dummy me...I did not refesh one page...YOU THE MAN!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now