Skip navigation
Currently Being Moderated

Saving Input TextBox entry to variable, using in textbox on another frame

Sep 14, 2012 10:30 AM

Hi,

 

Have been trying without success to save user input in a input text box, save to variable, then use this variable to populate text in a dynamic textbox on another frame.

 

First frame:

var a:String;
var b:String;
var c:String;
aName1.addEventListener(Event.CHANGE, inputCapture1);
function inputCapture1(e:Event):void{
a = aName1.text;
}
bName1.addEventListener(Event.CHANGE, inputCapture2);
function inputCapture2(e:Event):void{
b = bName1.text;
}
cName1.addEventListener(Event.CHANGE, inputCapture3);
function inputCapture3(e:Event):void{
c = cName1.text;
}

Then on another (later) frame

dynamictextbox1.text = a;

And so forth on other frames.

 

So far have crashed the debug preview. If I take out the script on first frame and later frame, no crash.

Any help appreciated.

 
Replies
  • Currently Being Moderated
    Sep 14, 2012 10:53 AM   in reply to saratogacoach

    You need to have the layer with the code above extended as far as the later frame so that those vars are available there.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 11:43 AM   in reply to saratogacoach

    I don't see any such variables in the code you offered, so I can't say what the problem might be there.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 11:51 AM   in reply to saratogacoach

    You'll need to show the code.  That line alone as shown ( aName:String  ) is an error, either a "var" belongs in front of it, or the ":String" needs to go away

    
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 12:11 PM   in reply to saratogacoach

    You seem to be changing things with every posting without telling the whole story.  I can't follow that.  I see no "aName" in that code, so I cannot answer for the error you ask about.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 12:58 PM   in reply to saratogacoach

    What's the problem?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 1:50 PM   in reply to saratogacoach

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points