Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Action Scripting a TextBox

Status
Not open for further replies.

grobermatic

Technical User
Dec 21, 2002
153
GB
Hi all,

I'm kinda new to Flash but am really keen to lean loads quickly.

I need to have a textbox where someone enters some text and the presses <ENTER> to invoke a GoTo action.

I can't make the textbox want to receive any ActionScript

Any help would be appreciated

Thanks

Craig
 
You should just be able to put that as in the frame right??? or you could give it to a button with only something in the hit state....

[conehead]
 
Hi TheConeHead,

Could you explain a little more about what you mean by :
&quot;You should just be able to put that as in the frame right???&quot;

Whatever I do the ActionScript box says :

&quot;Current Selection Cannot Have Actions Applied To It&quot;

Alternatively how would the button work with &quot;Only sonething in the hit state&quot;

Many Thanks

Craig
 
You make a button (Insert>New Symbol, Select button and click ok).... In the timeline you will see 4 boxes (Up, Over, Down, Hit State) Put a box or something in the hit state just so you can see it easily on the stage.... Now apply your action to this button after dragging it onto the stage...

[conehead]
 
&quot;...something in the hit state just so you can see it easily on the stage...&quot;
You put something in the hit state, because that's precisely defining the hit area of this invisible button, not so you can see it on stage.

Regards,

cubalibre2.gif
 
uh, Stage.... as in authoring environment... The stage is the area that actually shows up when the movie is published... When you put something only in the hit state of the button, you see a transparent blue button...

In the authoring environment you can see this button while, yes, it is invisible in the published movie...

[conehead]
 
You were saying to put something in the Hit state only to see it on stage. Granted, if you put something in the hit state, you'll will see something on stage (so you can position it), but that's not the reason for putting something in the Hit state.

You put something in the hit state, because that's precisely defining the hit area of this invisible button, not so you can see it on stage.

Re-read my post!



Regards,

cubalibre2.gif
 
Wow, little cranky today? Gonna nit-pick over every little word someone says? Yeah, the hit state defines the active area of the button - I think we all know that....


[conehead]
 
Well I think Grobermatic (and others!) didn't know, since he asked...

...Alternatively how would the button work with &quot;Only sonething in the hit state&quot;...

Cranky today? I'm cranky every day, when posts are slightly misleading or incomplete to say the least!




Regards,

cubalibre2.gif
 
See, that's what I hate about this profession. I love the work. But developer's tend to be guys that haven't enough esteem to feel good about themselves unless they are tearing someone else down....

I have a lot to learn and fail daily. I often need help and do not always do things the &quot;best&quot; way - unlike you obviously. Sorry I am not perfect like you. Thank God we have you here to set me straight.

Really... don't take this stuff so seriously. If this board gets you upset, I don't know - find a hobby or something... This is just programming and just work... live your life...

[conehead]
 
Whoaa!

Simmer Down Guys!

... anyway moving back to the subject at hand...

i want the user to be able to press enter after entering something in the textbox to execute the code.

I understand the stuff about the invisible button but would the user not have to use the mouse in this case. I want to avoif this if possible.

Thanks

Craig
 
I'm not a developer, not in this business, and I don't take all of this 1/100th as seriously as you seem to be taking it!
I merely pointed out that the info you provided (and in this case only - I don't recall ever having &quot;corrected&quot; you before!) was shaky and incomplete.
I wasn't tearing you down!

You want me to?


Regards,

cubalibre2.gif
 
IMHO, it would be better to have a &quot;enter&quot; or &quot;submit&quot; button along side the input textfield, so that the user can enter his text and then &quot;submit&quot; it. The goto is then scripted on that button.
Otherwise, you could have a control mc (or an onEnterFrame function), constantly checking the inputed character in the textfield, and apply the goto when the enter key is pressed.
But in this case, the user could hit the enter key by error (or to add a linebreak for example), and your goto would still be executed, unless you had a confirm if statement, in which case, might as well use a button along side the textfield, that the user can hit if he's satisfied with his entry.

Regards,

cubalibre2.gif
 
Yeh I guess you're right. I didn't think of those implications

Thanks for your advice and sorry if my post caused an argument!

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top