Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing data from php to flash

New Here ,
Mar 06, 2008 Mar 06, 2008
I am creating a quiz program. For this i get the loginid in my php page and i hav linked to a page where i hav embeded my quiz.swf file... after the quiz i display the marks in my movie itself and i sucessfully passed the marks to my php. Now the prob is i hav to get the corresponding loginid also with my marks so tat i can store them in a database. is there any way to pass the corresponding loginid to the quiz.swf??


Can anyone plase help me ? I am using flash 8.
Thanks in advance
TOPICS
ActionScript
511
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2008 Mar 07, 2008
Do a google search on LoadVars() tutorial...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2008 Mar 07, 2008
I am tring to just pass the variables from php and display them in flash

My php code:
<?php
$firstname="Rony";
print "firstname=$firstname";
?>

In flash i hav a dynamic text field with the variable name as "firstname"

My actionscript:
loadVariablesNum("nameofphp.php", 0);
firstname.txt = firstname;

But i get nothing when i run my swf.Both the files are in the same location.Can anyone please help?

Thanks in advance
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2008 Mar 07, 2008
Are you loading this through the Flash IDE or testing it live? This tutorial seems to be doing exactly what you want to do: How to use LoadVars Tutorial

It could also be that you have to do something the fact that you're not "swonking"- you have to wait for Flash to finish loading the data in, otherwise you essentially end up calling a method on said data before it's loaded as Flash doesn't perform a method/function and then wait it will carry on- which I expect is happening to you. Look at the tutorial above, it shows you how to combat this problem by creating a delegate function which will wait for your data and then try to use.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 07, 2008 Mar 07, 2008
Also, look at embedding your movie using SWFObject, it allows you to easily
pass variables from PHP into your movie.
http://blog.deconcept.com/swfobject/


--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2008 Mar 07, 2008
LATEST
Thank u so much Mr.lilalfyalien.... The tutorial helped me

Now wen i run from flash, i get a seperate window called output and in tat i get "Variables Loaded"

Now wat i want is i should display the values in the variable in my movie itself. For that i think i should use dynamic text.

Can u please explain that step and also the corresponding actionscript???

Thanks in advance
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines