-
AS2/CS4: ExternalInterface passing Variable
hi there,
maybe it is a simple question, but it took me allready 3 hours to try several ways and none work. so i am looking around for help, read many threats and tried many ways ...
i send variables to flash inside the html document:
Code:
... value="name.swf?myname=<?php echo $myname; ?>&myhobby=<?php echo $myhobby; ?>" />
inside flash i can print the variables as dynamic text, its working fine. but now i want to use one of this variables to be sent inside a "ExternalInterface.call" after pressing a button.
Here is my code, but i failed:
Code:
import flash.external.*
ExternalInterface.call('getdata','content.php?myname='+myname+'&detail='+myhobby+'' ,'content');
stop();
(getdata loads content.php inside a div with id="content" - Script works fine in all ways, even with flash. so the code above works now without variable variables)
i played around with '+...+' linke this:
Code:
import flash.external.*
ExternalInterface.call('getdata','content.php?myname="+myname+"&detail="+myhobby+"' ,'content');
stop();
i tried many ways, but nothing works. i realy wonder how i can pass my variables ...
is there anyone who could tell me how to set the variables in the right way? in another forum they said its not possible ... ??
Last edited by whatchagonnado; 03-04-2010 at 06:27 PM.
Reason: explain getdata
-
in a more eazy way:
this movie is called about 6 times on the website. each time this variable change and the button inside calls the ExternalInterface Action. it works fine .. but how to change this:
Code:
ExternalInterface.call('getdata','content.php?myname=MARCUS&detail=PAINTER' ,'content');
into kind of
Code:
ExternalInterface.call('getdata','content.php?myname='+myname+'&detail='+myhobby+'' ,'content');
the variables are available in flash, but how to write it in the correct way? ;o(((
Last edited by whatchagonnado; 03-04-2010 at 06:27 PM.
-
hi,
i finally found out that i can use my variables for dynamic textfields, but no matter what i try in flash, it seems my variables dont work the right way.
even this dont work:
Code:
if (myname=="THOMAS") {
stop();
}
can anyone tell me what i have to do inside flash to make my variables work inside AS? they show up on the textfield, but AS dont react.
maybe anyone knows a good link or tutorial so i can understand how to eazily play with my variables inside flash ? i am little bit confused about this ... ;(
-
Flashmatics
the if statement should work if myname contains the correct value:
try putting a trace to see what the variable contains:
trace("my name is " + myname + " and the length is " + myname.length)
if (myname=="THOMAS") {
stop();
}
-
that was the problem. i had this code, but not on main timeline. now it is working, thank you !!!
-
thank you silentweed!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|