Flash development

Moderators: None (Apply to moderate this forum)
Number of threads: 227
Number of posts: 388

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
linking a flash information to asp Posted by linda_tan878 on 25 Sept 2002 at 10:41 PM
Can anyone help me on how to send information and get reply back from an asp server script to a flash movie? What should i write on my asp server script?
Report
Re: linking a flash information to asp Posted by ASPgal on 13 Oct 2002 at 10:18 PM
: Can anyone help me on how to send information and get reply back from an asp server script to a flash movie? What should i write on my asp server script?
: Lets say you wanted to call an ASP to check if a product existed on a DB and if it did you wanted to return the Description of that product :-

1.Write your asp to do the lookup and retrieve the description etc for a product based on an incoming querystring. Make sure that your asp writes nothing out except a return string in the format of Field=value&field2=value so your output string from asp might resemble found=false,desc=test%20Product - you can test you asp in any browser to make sure that it works and that this is all that is returned.

2.In you Actionscript write
Loadvariables("HTTP://yourhttpaddress/aspName.asp?Product="+_root.Product,"_root"); on say frame (keyFramE) 1.

3.Leave Frame 2 blank but make it a keyframe

4.Make frame 3 a keyframe and type the following actionscript
if (_root.Found=="true") {
gotoAndPlay("Found")
}
elseif (_root.Found=="false") {
gotoAndPlay("NotFound")
}
else {gotoandPlay(2);}

What this does is loop between frame 2 and 3 until it receives a response back from the asp. All variables read in from the asp are referencable by the variable name preceed by _root, hence _root.Found

Also if you setup a dynamic text field on a frame and give it a variable name of Description then that field will automatically contain the description returned from the ASP.

I think you should be able to follow this example if you have reasonable knowledge of both ASP and Actionscript. Hope it helps.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.