PDA

View Full Version : Tooltip rollovers for textinput..


subba
08-09-2006, 07:31 PM
Hi,
I have rollovers for textinput boxes.When i use the onRollOver,i could get the rollover text(movie clip), but when i click the text input,I am not able to enter data in the textinput.I wrote a small tooltip class and can somebody please help me to get the focus on textinput.i.e when i click on the textinput,I should be able to enter data and rollover movie clip be removed.here is the code
class customToolTip {

private var theTip:MovieClip;
private var tFormat:TextFormat;

function customToolTip(hex:Number,hex2:Number,colorOfText:N umber,heightOfBox:Number,x1:Number,x2:Number,x3:Nu mber) {

movieLoader = new MovieClipLoader();
movieListener = new Object();
movieLoader.addListener(movieListener);
this.theTip = _root.createEmptyMovieClip("tooltip", _root.getNextHighestDepth());
//this.theTip.createEmptyMovieClip("tooltip", _root.getNextHighestDepth());
this.theTip.createTextField("theText",this.theTip.getNextHighestDepth(),3,1,1030,70);
this.theTip.beginFill(hex);
this.theTip.lineStyle(1, hex2, 100);
this.theTip.moveTo(0, 0);
this.theTip.lineTo(x1, 0);
this.theTip.lineTo(x2, -10);
this.theTip.lineTo(x3, 0);
this.theTip.lineTo(205, 0); // (100,0)
this.theTip.lineTo(205, heightOfBox); // (100,20)

this.theTip.lineTo(0, heightOfBox); // (0,20)
this.theTip.lineTo(0, 0); // (0,0)
this.theTip.endFill();
this.theTip._visible = false;
this.theTip.theText.selectable = false;
this.tFormat = new TextFormat();
this.tFormat.font = "Arial";
this.tFormat.size = 9;
this.tFormat.color = colorOfText;
this.tFormat.align = "center";
this.tFormat.italic = true;
this.theTip.theText.setNewTextFormat(this.tFormat) ;
}

public function showTip(theTextInput:String):Void {

this.theTip.theText.text = theTextInput;

trace(this.theTip.theText.text);

this.theTip._x = _root._xmouse;
this.theTip._y = _root._ymouse+10;
this.theTip._visible = true;
this.theTip.onMouseMove = function() {
this._x = _root._xmouse;
this._y = _root._ymouse+25;
updateAfterEvent();
}
}
public function removeTip():Void {

delete this.theTip.onEnterFrame;
this.theTip._visible = false;
this.theTip.clear();
}
}

and here I am using the tooltip class
class test {
private var txt:TextInput;
private function test() {
}

private function onLoad() {
txt.onRollOver = function() {
tt = new customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15, 20);
tt.showTip("Total sales.");
}

txt.onRollOut = txt.onPress = function() {
tt.removeTip();
}

When i click on the textinput,I need to get the focus on textinput and able to type data in textinput box .Can somebody help me in this...

Thanks,
Subba

xbrotherx
05-07-2007, 08:45 PM
Did you ever find a solution to this?