By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 2,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

Passing values from ASP to FLASH

P: 15
Hello everyone, Im running into a problem passing values from ASP to Flash. I've been searching around and trying different things with no luck. The project im working on will use ASP to pull data from Access and SQL and then post the information on series of frames that is timed. The code im am posting is just a test to try and get values passed to Flash. I am using Flash CS3 with actionscript 2.0.

Frame 1:
Expand|Select|Wrap|Line Numbers
  1. success="";
  2. loadVariablesNum("test.asp", 0);
  3.  
Frame2:
Expand|Select|Wrap|Line Numbers
  1. if (success ne "") {
  2.            gotoAndStop(6);
  3.     }
  4.  
Frames 3 & 4 has text box diplaying "Loading Data..."

Frame 5:
Expand|Select|Wrap|Line Numbers
  1. gotoAndPlay(2);
  2.  
Frame 6:
Has a Dynamic Text box with the property VAR: vartest

ASP
Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT"%>
  2.  
  3. <%
  4.     Option Explicit
  5.  
  6.     Dim varTest
  7.  
  8.     varTest = "Did this work?"
  9.  
  10.     Response.Write "success=True&vartest="
  11.  
  12.     Response.Write Server.URLEncode(varTest)
  13.  
  14. %>
  15.  
It just loops frame 2 - 5 never ending. If I was to remove success=""; from Frame 1 then it comeplete and the Dynamic text on frame 6 shows:

"

Response.Write Server.URLEncode(varTest)


Any help would be great. I know it must be something im missing.

Thanks,
John
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: 15
Good evening everyone, I was able to get the problem worked out. I changed the way it was pulling the data in and I had to use the absolute path to the ASP file.

Expand|Select|Wrap|Line Numbers
  1. myVars = new LoadVars();
  2.  
  3. myVars.load("http://*.*.*.*/Flash/Test/test.asp");
  4.  
  5. myVars.onLoad = function( success ){
  6.     if (success ){
  7.         txtTest = myVars.varTest;
  8.         txtTest2 = myVars.success;
  9.     }else{
  10.         trace( "Failed!" );
  11.     }
  12. }
  13.  
-John
Jun 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.