Log in

View Full Version : how appear mouse tool tip (on mouse over) on image that is clickable



lse123
08-15-2012, 06:58 PM
in Flex(FB4.1)
how appear mouse tool tip (on mouse over) on image that is clickable?
eg "click to go to Home Page".

Also how appear mouse tool tip (on mouse over) on image that is draggable?
eg "Drag to cart to insert this product inside cart".

Nile
08-16-2012, 04:42 AM
Could you try to be a bit more descriptive? If you're just looking for an AS3 tooltip, do a quick google search:

http://www.google.com/search?client=safari&rls=en&q=as3+tooltip&ie=UTF-8&oe=UTF-8

lse123
08-16-2012, 07:24 AM
I mean when mouse over the particular item (image or image/button or ...) just near the mouse cursor appear a label "click me to go to Home Page" or "drag and drop me in cart to add me"...

Nile
08-16-2012, 02:30 PM
Try the link I gave you.

lse123
08-16-2012, 02:58 PM
not in AS3, there is no attribute on mxml element?

BLiZZaRD
10-12-2012, 11:08 PM
Try this, changing as and where needed:



// create one buttonObj for all your buttons

var buttonObj:Object={};

//////////////////////////////////////change nothing above ////////////////////////////////////



//the next 3 lines need to be done for all your buttons

buttonObj[yourbutton.name] = ["hello",2,2];

yourbutton.addEventListener(MouseEvent.MOUSE_OVER,addToolTipF) ;

yourbutton.addEventListener(MouseEvent.MOUSE_OUT, removeToolTipF);



////////////////////////////////////change nothing below/////////////////////////

function addToolTipF(e:MouseEvent):void{

var a:Array = buttonObj[e.currentTarget.name];

var tf:TextField=new TextField();

buttonObj[e.currentTarget.name].push(tf);

tf.text=a[0];

tf.multiline=false;

tf.autoSize="left";

tf.border=true;

addChild(tf);

tf.x=a[1]+e.currentTarget.x;

tf.y=a[2]+e.currentTarget.y;

}



function removeToolTipF(e:MouseEvent):void{

removeChild(buttonObj[e.currentTarget.name][3]);

buttonObj[e.currentTarget.name].splice(3,1);

}

lse123
10-13-2012, 05:59 PM
i used tooltip attribute in mxml visual element... I will try also your code!