Groups | Blog | Home
all groups > flash actionscript > november 2005 >

flash actionscript : TextField RoolOver... any way ?


majkinetor
11/8/2005 10:24:27 PM
I want to do some actions when mouse is over TextFields on my form.
As there is no RoolOver event for single TextFileds, and it would be to
complicated to create button wrapper for them all, I am asking you is there
some known way to do it.

Is it for instance possible to obtain name of the instance bellow the mouse
cursor? If so, I could use some fast timer to check if cursor is over
TextFields....

Or, can I create button wrappers dynamically in Frame1 to wrapp all
TextFields,and then apply single RoolOver fall all of them.

thanks.
NSurveyor
11/8/2005 11:09:00 PM
Add this to frame 1 of your movie:

TextField.prototype.addProperty('onRollOver',function() {return
this.onRO},function(func){
this.onRO = func;
this.isOver = false;
Mouse.addListener(this);
this.onMouseMove = function(){
var x = this._parent._xmouse;
var y = this._parent._ymouse;
if (x>=this._x && x<=this._x+this._width && y>=this._y &&
y<=this.y_t+this._height) {
if(!this.isOver){
this.onRollOver();
this.isOver = true;
}
}else{
this.isOver = false;
}
}
});

now you should be able to use onRollOver for TextFields.
AddThis Social Bookmark Button