linking a flash information to asp - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

linking a flash information to asp

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?

Comments

  • ASPgalASPgal Posts: 3Member
    : 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.

Sign In or Register to comment.