Skip to main content
saratogacoach
Inspiring
September 18, 2012
Answered

Post/Receive Data from ASP page

  • September 18, 2012
  • 1 reply
  • 766 views

Hi,

I am trying to use the URLRequest to post 4 scores (totalscore1, totalscore2, totalscore3, totalscore4) to an ASP page on a server, where the ASP will run a formula to process and return 2 final scores (score1, score2).

The ASP script to process what is sent from the Flash SWF looks like

var totalscore1 = parseFloat(Request("totalscore1"));

The ASP script to create a return looks like:

Response.Write( "score1=" + score1 + "&score2=" + score2 );

Response.End( );

%>

I'm new to this type of data posting/request, especially how to configure variables that may (?) be sent or return as numbers, not text strings.

totalscore variables are numbers like 30 or 75. How to configure: var variables:URLVariables = new URLVariables();

(not sure what the above ASP script needs: do I send, numbers or text string?)

Return final score variables are likely to be numbers like 2.95 or 1.25. How to receive these numbers back from the ASP page and put them into 2 number variables for use in AS3 scripts.

Any help appreciated.

This topic has been closed for replies.
Correct answer esdebon

you only can and most send Strings to Flash... but in Flash you can use:

int(score1);

or


parseInt(score1);


to convert the string to a a integer or

Number(score1);

to convert to Double, float

1 reply

esdebon
esdebonCorrect answer
Inspiring
September 18, 2012

you only can and most send Strings to Flash... but in Flash you can use:

int(score1);

or


parseInt(score1);


to convert the string to a a integer or

Number(score1);

to convert to Double, float

saratogacoach
Inspiring
September 18, 2012

Hi esdebon,

Thank you for this information. I tried out a sample script in AS3 to see if I can get it to send and return data from the ASP page (ASP already written and on site).

Good news! It works!

So issue resolved.

Again, thank you.