-
how do i animate input text box??
I have a simple flash contact form on my website, I would like to have the input box light up or change color whenever someone clicks inside that box to type in information, once they click into another the box goes back to the way it was and the other lights up?? I have seen this done a million times, just wondering how i do it for myself
thnx in advance
-
You'd have to put a box behind your input box, and do a onSetFocus action on the textbox.
-
onSetFocus?
could you give me an example code to put in box?
thnx
-
Monkey Moderator
Try browsing the Actionscript Language Reference in the help files. You will find other ways you can change your input textbox other than background and border colours as below.
This will work if you place this code on a frame when the inputbox is on screen and in the same timeline and it's <instance name> is "myTxt". No need to have anything behind your inputbox.
code:
myTxt.onSetFocus = function(){
this.backgroundColor = 0xFF9999;
this.borderColor = 0xFF0000;
}
myTxt.onKillFocus = function(){
this.backgroundColor = 0xFFFFFF;
this.borderColor = 0x000000;
}
www.lexicon-design.co.uk
If we aren't supposed to eat animals, then why are they made of meat?
If Vegetarians like animals so much, why do they eat all their food?
-
Whoops, I guess I didn't realize you could do it on the box itself. Looks like you have to click the "Show border around text" button to make it work, though.
-
hmmm, still not working correctly I added the code, but it stays white until clicked, I am curious how it works with a box underneath, perhaps that will work a little better, or you can provide an fla with the text box code in place, i may have screwed it up, doh..
thnx
-
Monkey Moderator
You can set the colours up beforehand so it is the right colour to begin with.
place this code on a frame when the input text box first appears on screen....
code:
// initial setup
myTxt.border=true;
myTxt.background=true;
myTxt.backgroundColor = 0x9999FF;
myTxt.borderColor = 0x000000;
// on focus actions
myTxt.onSetFocus = function(){
this.backgroundColor = 0xFF9999;
this.borderColor = 0xFF0000;
}
myTxt.onKillFocus = function(){
this.backgroundColor = 0x9999FF;
this.borderColor = 0x000000;
}
www.lexicon-design.co.uk
If we aren't supposed to eat animals, then why are they made of meat?
If Vegetarians like animals so much, why do they eat all their food?
-
Senior Member
Hey thats great lexicon
Oh by the way dope - hello
-
i was also wondering how to do the fading effect...? plz can u guys guide me..? whn i click on the textfeild it shud fade out a color.
-
Senior Member
this is for cybersip
This file was created by gparis on this forum - perhaps dope might make use of it too - it does the fading thing using a movie clip behind the text field
-
thnx fellas
whatssss uppp mal!!!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|