Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 9th, 2003, 09:06 AM
rabbitfoofoo rabbitfoofoo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Norfolk, England
Posts: 2 rabbitfoofoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 54 sec
Reputation Power: 0
Thumbs down Problem passing variables from php to Flash MX

I'm not sure if this should go in the Flash or php forum so I'm trying both. I hope that's ok. I have successfuly loaded variables into Flash using a text file, but cannot get it to work with php. Here's what I'm trying:

PHP Code:
echo "name=david&location=norfolk&done=ok"


The Flash actionscript goes as follows:

Frame 1:
var c = new LoadVars();
c.load("/scripts/test.php", 0, "POST");

Frame 2 is labelled "wait"

Frame 10:
if (_root.c.done == "ok") {
trace (_root.c);
} else {
gotoAndPlay ("wait");
}

Now if I run this code, it just continually loops back to wait and never succeeds.

If I try an alternative at Frame 10:
trace (_root.c);

I get this output:
done=ok%22%3B%0D%0A%3F%3E&location=norfolk&%3C%3Fphp%0D%0Aecho%20%22name=david

I've also tried c.load("scripts/test.php") with no success.

Can anybody help?

Reply With Quote
  #2  
Old January 30th, 2004, 05:13 PM
kuya1284 kuya1284 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 11 kuya1284 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Problem passing variables from php to Flash MX

Quote:
Originally posted by rabbitfoofoo
I'm not sure if this should go in the Flash or php forum so I'm trying both. I hope that's ok. I have successfuly loaded variables into Flash using a text file, but cannot get it to work with php. Here's what I'm trying:

PHP Code:
echo "name=david&location=norfolk&done=ok"


The Flash actionscript goes as follows:

Frame 1:
var c = new LoadVars();
c.load("/scripts/test.php", 0, "POST");

Frame 2 is labelled "wait"

Frame 10:
if (_root.c.done == "ok") {
trace (_root.c);
} else {
gotoAndPlay ("wait");
}

Now if I run this code, it just continually loops back to wait and never succeeds.

If I try an alternative at Frame 10:
trace (_root.c);

I get this output:
done=ok%22%3B%0D%0A%3F%3E&location=norfolk&%3C%3Fphp%0D%0Aecho%20%22name=david

I've also tried c.load("scripts/test.php") with no success.

Can anybody help?


Try moving c.load("scripts/test.php") to Frame 2. Since it's in Frame 1, your script is never going to load the new (updated) php data. Frame 10 is only going to see the (old) data that was loaded in Frame 1 (I think).

Reply With Quote
  #3  
Old January 30th, 2004, 05:16 PM
kuya1284 kuya1284 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 11 kuya1284 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
oops... sorry to dig this up... I didn't realize how old this was... that darn "related links" list at the bottom tricked me!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Problem passing variables from php to Flash MX


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway