• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Action Script not reading special Characters in a string

Participant ,
Sep 25, 2018 Sep 25, 2018

Copy link to clipboard

Copied

I created a username and password.

The password has to have a special character (e.g. !@#$%^&*) as part of their password. The problem I am experiencing is that Actions Script cannot read a lot of special characters e.g. 1234#. The # plays havoc with the string.

My question is how can Action Script read this string value as a #? How can I get Action Script to read these special characters without having a negative impact on the code?

Here is an example of my code:

<fx:Declarations>

<s:HTTPService id="handleRequestLogin" result="feedRequestLoginService_resultHandler(event)" resultFormat="e4x" fault="faultHandler(event)" showBusyCursor="true"/>

</fx:Declarations>

private function login():void

{

feedRequestLogin="http://www.server.com/api/xml?action=login&login=" + tiLogin.text + "&password=" + escape(tiPassword.text);

handleRequestLogin.url=feedRequestLogin;

handleRequestLogin.send();

}

Thank you

Views

339

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Sep 25, 2018 Sep 25, 2018

I have finally found the answer...

The # should be replaced with %23 i.e.

var feedRequestLogin = "http://www.server.co.za/api/xml?action=login&login=email@address.com&password=1234%2A//www.server.co.za/api/xml?action=login&login=email@address.com&password=1234%2A";

handleRequestLogin.url=feedRequestLogin;

handleRequestLogin.send();

This is what I had problems with ".....password=1234%2A";

The %2A turns it into a #.

Thank you

Votes

Translate

Translate
Participant ,
Sep 25, 2018 Sep 25, 2018

Copy link to clipboard

Copied

LATEST

I have finally found the answer...

The # should be replaced with %23 i.e.

var feedRequestLogin = "http://www.server.co.za/api/xml?action=login&login=email@address.com&password=1234%2A//www.server.co.za/api/xml?action=login&login=email@address.com&password=1234%2A";

handleRequestLogin.url=feedRequestLogin;

handleRequestLogin.send();

This is what I had problems with ".....password=1234%2A";

The %2A turns it into a #.

Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines