Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / May 2006



Tip: Looking for answers? Try searching our database.

Copying text to new text box - can it be done?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
obabilon - 29 May 2006 17:21 GMT
I'm trying to create a single elimination chart for a competition. The names of
32 participants are inputted with input text. How can I create an actionscript
that if you click on a button next to their name (the winner) that their name
will copy into another text box to the right.
albee - 29 May 2006 17:46 GMT
Make sure each text field has an instance name. If so, you can code the button
as follows:
// for the sake of this example, we'll call the button my_btn, the input text
field input_txt, and
//  the new text field new_txt; all three objects are in the same timeline
my_btn.onRelease = function () {
    var inputName = input_txt.text;
    new_txt.text = inputName;
};

This should solve your problem...

Good luck,

Albee
obabilon - 29 May 2006 19:58 GMT
That worked, Albee. Thank you. New question is how do I get the text in the
movie to be blank. Now it's showing up as _level0.b1. I've named the instance
names of the input text boxes as a1, a2 and b1. I've also used the same name
for the Var:

And one more question: is there a way to control the tabbing in the Flash
movie so it's not hitting the buttons and just hitting the text boxes that are
the input boxes?

BTW - you're working with a beginner here but I'm a quick learner...and I'm
thankful for your time.
albee - 31 May 2006 18:02 GMT
1. OK, if I understand your question correctly, the answer is to assign an
empty string to the text field:
a1.text = "";
// notice that the empty string is two quotation marks right next to each
other, no space...

2. For tabbing order, there are properties of textfields and movie clips
called tabIndex and tabEnabled. Within a timeline, if you've assigned indexes
starting with 1 and up to the corresponding textfields, they will tab in that
order:
a1.tabIndex = 1;
a2.tabIndex = 2;
b1.tabIndex = 3;

 If you don't want the tab key to focus on a clip or textfield, set it's
boolean property, tabEnabled, to false:
a1.tabEnabled = false;

Hope this helps...

Albee
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.