Jump to content

variables from ASP to ActionScript 3


billylariviere@hotmail.com

Recommended Posts

Hi, I just can't figure how to:

  1. correctly prepare a variable from an ASP page
    Dim messageChoisimessageChoisi=rsMessageBanner.Fields.Item("memPostMessage").Valueresponse.write("messageChoisi="&rsMessageBanner.Fields.Item("memPostMessage").Value)

    I know the variable works from the ASP page itself because the Response.write returns my variable correctly.I don't want my variable to show on the html page (I just want my variable to be available for Flash), so I remove the Response.write line.is it the right way to do it?

  2. get my variable into Flash with ActionScript 3here's my ActionScript 3 code:
    var adress:URLRequest = new URLRequest("someAdress.asp");var messageLoader:URLLoader = new URLLoader();messageLoader.dataFormat = URLLoaderDataFormat.VARIABLES;messageLoader.addEventListener(Event.COMPLETE, completeHandler);try {} catch (error:ArgumentError) {trace("An ArgumentError has occurred.");} catch (error:SecurityError) {trace("A SecurityError has occurred.");}function completeHandler(event:Event):void {var loader:URLLoader = URLLoader(event.target);  trace(loader.data.messageChoisi);}messageLoader.load(adress);

and here's the error code from Flash:

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.at Error$/throwError()at flash.net::URLVariables/decode()at flash.net::URLVariables()at flash.net::URLLoader/onComplete()

Anybody has a Clue on how to correct this?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...