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 July 29th, 2003, 11:13 AM
Ade1 Ade1 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 Ade1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Flash variables to PHP, do not load.

Hi All

Hope someone out there can help me, this is driving me crazy!!

I am trying to load variables from a text file into Flash and then send these to PHP, when I debug the Flash movie the variables show as loaded, but they are not sent to the PHP file.

If I create a variable and give it a value like this
container.test="10";
it works and this variable 'text' is send to my PHP file.

What am I doing wrong, as the variables in my textfile are not sent?


Here is my code below:

Here is the code in my text file:
&id=5&aff_name=testing


Here is the code in my Flash Movie:

container = new LoadVars();
container.load("c:\\notepad.txt",0);
container.sendAndLoad("flash_test.php",container,"POST");


Here is the code for my PHP file:

(database connect code here)

$sql = "INSERT into flash_test values(
null,
'$id',
'$aff_name'
)";
mysql_query($sql,$dbh);

echo "various variables here": this part works.

Reply With Quote
  #2  
Old July 29th, 2003, 11:22 AM
christo's Avatar
christo christo is offline
Introspective
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Nov 2001
Location: London, UK
Posts: 3,296 christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level)christo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 1 h 5 m 42 sec
Reputation Power: 101
Send a message via ICQ to christo Send a message via Yahoo to christo
container.load("c:\\notepad.txt",0);

you can do *this* with actionscript??

christo

Reply With Quote
  #3  
Old July 29th, 2003, 11:42 AM
Ade1 Ade1 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 Ade1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
as far as I am awear yes as c:\notepad.txt did not work and it chopped out the n from notepad.

Reply With Quote
  #4  
Old July 29th, 2003, 11:47 AM
1ain 1ain is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Bath
Posts: 26 1ain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
aff?

your string in textfile 'text.txt':
&id=5&aff_name=testing

this should fetch out the string and split it into key-value pairs, then assign these values to the textboxes, id and aff_pairs, respectively:

loadText = new loadVars();
loadText.load("text.txt");
loadText.onLoad = function() {
id.text = this.name;
aff_name.text = this.email;
};

the file you are accessing has to be on the webserver. you cannot access local files with actionscript (yet, although there are plans). i'm unsure whether your textfile is in the same place you have published your swf.

it could also be something to do with the way you were using the same loadvars object to send AND receive your data. you should use 2 separate objects for this in future.

by the way, there's quite a neat tutorial on the subject with our friends at kirupa:
http://www.kirupa.com/developer/mx/externaldata.htm

hope this helps.

ps: is aff_pairs anything to do with accelerated free-fall? enquiring minds want to know!

e

Last edited by 1ain : July 29th, 2003 at 12:12 PM.

Reply With Quote
  #5  
Old July 29th, 2003, 02:40 PM
Ade1 Ade1 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 Ade1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you, for your help and pointers, it is now working!!!!

Not sure what you mean by aff_pairs, but its not anything to do with accelerated free-fall.

Thank you again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash variables to PHP, do not load.


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 4 hosted by Hostway