Solved

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

Posted on 2006-11-11
8
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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,…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

628 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