Solved

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

Posted on 2006-11-11
8
380 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

773 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