This is a discussion on "Passing variables from PHP to Flash" within the Flash & Multimedia Forum section. This forum, and the thread "Passing variables from PHP to Flash are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Passing variables from PHP to Flash
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Passing variables from PHP to Flash
Why doesn't this work?
Code in actionscript:
|
|
|
|
||||
|
Re: Passing variables from PHP to Flash
Its not a correct way to pass a variable to flash
You have 2 ways : 1) using flashvars (more info : http://kb.adobe.com/selfservice/view...6417&sliceId=2) 2) put your variable in the html file file like this :
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|||
|
Re: Passing variables from PHP to Flash
the problem is that the user will be on the same HTML page with the same SWF while all this variable passing happens. I cannot use the methods you described because in my situation, where the value of the variable is generated uniquely by the user, i would have to use a PHP page with the value dynamically hardcoded into the HTML as the ?value=whatever or the FLashVars method. But, since PHP is server side, i cannot change the HTML while the user is on the page without refreshing, and that would cause the loss of all the user's color and style selections on the page. remember I am using http://www.momdadsquad.com.
So what I am saying is the variable passing has to happen internally, on the backend without making the user have to go to another page or refresh. Basically, I want the same SWF in the same instance to submit info to a PHP page, PHP to process the info, and then return it to the SWF. I'm sorry it's hard to explain complicated things like this, but thanks for trying to help me. |
|
|||
|
Re: Passing variables from PHP to Flash
I think I understand. You want to process information from a SWF to the database using PHP WITHOUT refreshing the current page. I'm no guru, but you're limiting the options and hoping for more capability that Flash or any web page has to offer.
You can process the information using a secondard PHP page. Have Flash send a request to a new window (_blank) with the information you want to pass. That should be simple. The problem you'll run into is Flash CANNOT do anything with the processing. The page is required to do the processing first and forward it to Flash. If you don't want to refresh the page, then you can't update Flash. Using GET and POST, and FLASHVARS are the only three methods Flash has to receive (send) information. If you don't use then you're come up short. If you are worried about losing the information the user has selected, have Flash send the information to PHP and store it in a cookie. This way it can be retrieved, process and returned to Flash on a refresh. Sorry I could help ya more. |
|
||||
|
Re: Passing variables from PHP to Flash
You can definitely do this without refreshing the page...;
WIth actionscript you can use the loadVars class
eg. loadExternal.var1 will be 1 etc... This is the easiest way to do it -- loadvariables has been depreciated in actionscript 2.0 Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing variables values using POST | sudhakararaog | Web Page Design | 2 | Mar 18th, 2008 08:12 |
| Passing Flash variables between frames | lostnights | Flash & Multimedia Forum | 0 | Jan 22nd, 2007 17:09 |
| Passing variables from Flash to PHP | LostProphet | Flash & Multimedia Forum | 6 | Aug 31st, 2006 14:05 |
| passing post variables | benbacardi | PHP Forum | 5 | Jul 5th, 2005 22:13 |
| PLEASE HELP - Passing Variables in Querystring | just_the_basix | Classic ASP | 40 | Sep 3rd, 2004 10:46 |