PDA

View Full Version : passing variables from php to flash.



Rockstar
December 12th, 2004, 06:40 AM
Hi.

I have a problem with php.
Ok so I have a login form, that is working perfectly. I want to insert a flash file [swf] to display an error message. So I made a small dialog box in flash with a dinamic text and gave it a var name: message.

What I wanna do is, depending on what my error message, I want to be able to load the flash template and then display that error message.

I call it a template because I want to use the same template to display other messages.

this is the script that I got for Flash:

c = new LoadVars();
c.onLoad = function(success){
if(success){
box.text = this.msgInside;
} else {
getURL("javascript:alert('something went wrong');");
trace("something went wrong...");
}
}
c.load("login_processor.php");

which is working perfectly. The only problem is to load and display that error message.

Any ideas???

TNezvigin
December 12th, 2004, 10:33 AM
Prolly got a variable mixed up here or there.

Use the trace() function to display every variable you have so far in flash. If you have alot of variables in flash, just trace the ones that have to do with this.

Rockstar
December 12th, 2004, 11:39 AM
ah you always there to help :P thanks alot.
still no luck.
I probably have to do it in just a plain dialog box :)
hehehe this is for my final and its due next tuesday lol

TNezvigin
December 12th, 2004, 07:38 PM
Hm... to be honest there isn't much I can help with in this case. I'm sure you know the steps, but you probably do what I always do.... skip a variable name or something like that. I spend hours staring at the screen, only to find out I missed a tiny detail, lol.

Just get some tutorial on passing variables from PHP to Flash and go through the steps 1 by 1, not skipping any sentences. That usually makes the process faster for me.

Rockstar
December 13th, 2004, 12:14 AM
huehue yea, anyway.. thanks :)