Solved

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

Posted on 2006-11-11
8
378 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pushing Adobe Flash Player Fails with Error %%2 1 476
Updating Flash Player with GPO 3 348
Rotating Adobe pdf document 4 310
Play RTMP without Flash 3 427
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

910 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

15 Experts available now in Live!

Get 1:1 Help Now