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

Save and Load names in fields

Explorer ,
Sep 21, 2017 Sep 21, 2017

Copy link to clipboard

Copied

I'm trying to get the user to type a random name in a field (text1.text) converted as input, causing it to be saved immediately, and after a new input is loaded.

But it's not working, could anyone help me?

stop();

// text1 = text input name

var nickName:String;

var so:SharedObject = SharedObject.getLocal("inputtext", "/");

so.data.inputtext = text1.text;

so.flush();

if(so.data.inputtext){

     nickName = String(text1.text);

     text1.text = so.data.input;

} else {

     nickName = String(text1.text);

}

TOPICS
ActionScript

Views

250

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
Community Expert ,
Sep 21, 2017 Sep 21, 2017

Copy link to clipboard

Copied

LATEST

that code doesn't make sense.

is text1.text defined (and what you expect) before that code executes?

if so, there's no point to that if-statement.

if not, the if-statement should executed before assigning so.data.inputtext and you should be using a listener to assign so.data.inputtext.

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