textbox1.text = textbox2.text;
Assuming they are set to dynamic and have instance names textbox1 and
textbox2
If you name textbox1_txt and textbox2_txt then you get the code hinds as you
type the period.

Signature
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
Hi
Im having trouble using Flash 8, I have bought a few books but still cant
work
it out. I just have a really simple screen, it has 2 text boxes and one
button.
What I want to happen is you type a string into textbox 1, then click the
button and it displays the content of textbox 1 in texbox 2.
The first text box is set to 'input text' and the second to 'dynamic text'
(is this right??). The code I want is pretty much this:-
on (release){
textbox1 = textbox 2;
}
My book is quite confusing (well im confused by it) , it doesnt really
explain
what the difference is between instance name and var name is, I would guess
that in the above code, textbox1 would have to be the var name, and not the
instance name? Any ideas what the script should look like??
thanks for any help.
Joe
Joe_DN2003 - 31 Oct 2005 16:33 GMT
Thanks for that.
This is way too confusing. If I set the two text boxes with an instance name
of T1 and T2, the following code works
T1.text = T2.text
BUT, if I set the var name to T1 and T2, the following code also works:-
T1=T2
What if the difference between instance names and var names, they both seem to
work just as well?????
LB Back - 31 Oct 2005 16:44 GMT
If you give a textField a var name (say T1), the value of that variable will be
displayed in the textField.
So if you'd put something like T1="Hello"; into a keyframe it would appear in
the textField.
If you give a textField an instanceName it becomes some kind of
http://www.macromedia.com/support/flash/action_scripts/object_model/ which has
properties like "text"
or "textWidth" and many other possibilities.
In Flash 4 there was only the possibility of giving a Var name to a textField.
Instance-naming started from Flash 5 (correct me if i'm wrong).
Joe_DN2003 - 31 Oct 2005 16:52 GMT
oh right, thanks for that. I have done oop before and at the moment were
learning java, so I guess the two are kind of the same, syntax seems to be the
same anyway.
Thanks for clearing that up for me :-)
Motion Maker - 31 Oct 2005 23:29 GMT
With a variable name the text box is updated when the variable changes. This
can be advantageous with something like a loadVariables or LoadVars where
you are not checking (but good coding practice is you should) when the
loading is done. Sort of an automatic event handler.
With the text or htmlText props you need to set them at the appropriate
timing.
In general MM variables is the past (Flash 5) and the text and htmlText are
the newer expansion we are all moving to use.

Signature
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
Thanks for that.
This is way too confusing. If I set the two text boxes with an instance
name
of T1 and T2, the following code works
T1.text = T2.text
BUT, if I set the var name to T1 and T2, the following code also works:-
T1=T2
What if the difference between instance names and var names, they both seem
to
work just as well?????