dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Correct Syntax for Sending ASP to Flash

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367
    Hi All ---

    I have seen this a number of different ways...all of which don't work for me. Can someone please provide me with the correct syntax for sending a variable from ASP to Flash?

    For example:
    Dim myVar
    myVar="myVar=Help"
    response.write myVar


    Does the above code need a "&" before the variable to send it to flash so that flash will recognize the variable?

    Any assistance is greatly appreciated as I am losing hair quickly

    Cheers.
    SDL

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    49
    here is an .asp example of how I would send a single variable back to my flash file in my .asp file.

    dim intErrorCode
    -
    -
    -
    intErrorCode = 3
    Response.Write "&intErrorCode=" & intErrorCode

    The "&" symbol is used to separate multiple variables being sent back such as:
    Response.Write "&ECode=5&Name=bob&ID=2983"

    You can leave the "&" off the first variable, but I put it in anyway and it doesn't seem to cause any problems.

    Remember that on the Flash end, you must write your code in such a way that you move to another frame while you are waiting for the variable to come from your .asp file or you will never see the variable change. You cannot simply sit in a single frame with a loop waiting for the varible from the asp file to change-you will never see it.

    Hope this helps,
    AzF

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Desert Southwest
    Posts
    367
    Originally posted by AzFlasher


    Remember that on the Flash end, you must write your code in such a way that you move to another frame while you are waiting for the variable to come from your .asp file or you will never see the variable change. You cannot simply sit in a single frame with a loop waiting for the varible from the asp file to change-you will never see it.

    Hope this helps,
    AzF
    Thanks for the very detailed explaination! It was exactly what I was looking for!

    However one additional question. Is the above statement true even if I use an "onClipEvent(EnterFrame)" action that will continuously check to see if the variable has been loaded? I only had 1 frame for my movieclip as it was simply a form that sends contact information to the asp page. Maybe that is what I was doing wrong?

    Let me know if you have any interest in seeing the FLA as I could certainly use some additional guidance.

    SDL

  4. #4
    Member
    Join Date
    Oct 2001
    Posts
    49
    slebang,

    I have to admit that I had not used that method before, but I did a quick little test and that method seems to work as well. If you still have questions, you can send me your code at negleysinaz@cox.net and I will take a look.

    AzF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center