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.
Hi Ned,
Thank you for this suggestion. I've done it, and no debugger crash.
But, I am getting
| Scene 1, Layer 'script', Frame 1, Line 6 | 1120: Access of undefined property aName. |
Scene 1, Layer 'script', Frame 1, Line 6
1188: Illegal assignment to class String.
Plus another for each variable and similar undefined property errors when they are used in the subsequent script in that frame.
I thought that I have declared them:
var aName:String; //for each
Until the user enters text into the Input Text Boxes for each variable, they are empty var's.
Not sure how to fix this.
I had tried in the functions adding
aName:String
Apparently that causes the additional error 1188.
Removed those references. But still getting 2 of the following for each variable:
| Scene 1, Layer 'script', Frame 1, Line 6 | 1120: Access of undefined property aName. |
Maybe there is a better was to write this in AS3?
All I'm trying to do is have the user enter text in 3 input text boxes, save each into a variable, then use the variables, one in each of 3 later frames to become the text of a dynamic text box on each of those 3 frames.
All code from the second layer on Frame 1. (First layer has button, listener for button and function to go to next frame if button pressed.)
var firstname:String;
var petname:String;
var characteristic:String;
fName.addEventListener(Event.CHANGE, inputCapture1);
function inputCapture1(e:Event):void{
firstname = fName.text;
}
pName.addEventListener(Event.CHANGE, inputCapture2);
function inputCapture2(e:Event):void{
petname = pName.text;
}
cHar.addEventListener(Event.CHANGE, inputCapture3);
function inputCapture3(e:Event):void{
characteristic = cHar.text;
}
Later frames have instance named dynamic text boxes, each with dynamictextbox1.text = firstname; or dynamictextbox2.text = petname; or dynamictextbox3.text = characteristic;
Hi Ned,
Thank you for your help.
Sorry about the names, but the final naming is precisely the same as the last entry.
This is exactly as the script on layer 2 appears on frame 1.
var firstname:String;
var petname:String;
var characteristic:String;
fName.addEventListener(Event.CHANGE, inputCapture1);
function inputCapture1(e:Event):void{
firstname = fName.text;
}
pName.addEventListener(Event.CHANGE, inputCapture2);
function inputCapture2(e:Event):void{
petname = pName.text;
}
cHar.addEventListener(Event.CHANGE, inputCapture3);
function inputCapture3(e:Event):void{
characteristic = cHar.text;
}
Please don't hestitate to ask for any additional information, details. Happy to provide these.
Your help is appreciated.
North America
Europe, Middle East and Africa
Asia Pacific