PDA

View Full Version : Show Text while hover over Button


seville
12-08-2008, 05:11 PM
Hey Actionscript Experts,

I have 5 buttons, I want, that everytime you scroll over each button it shows you a text in a field, next to these buttons. You can see it in the screenshot.

I use Actionscript 3 and I found out, for that I have to use ROLL_over or MOUSE_over but I'm a complete newbie and don't understand Actionscript.

Can somebody help me where do I have to put it in my current code, which I made somehow so far:

This is my action for these buttons:

stop();

var ignoriereStop : Boolean = false;

segmentbtn0.addEventListener(MouseEvent.MOUSE_DOWN ,SegmentHandler0);
function SegmentHandler0(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay(0,"demo");
}

segmentbtn1.addEventListener(MouseEvent.MOUSE_DOWN ,SegmentHandler1);
function SegmentHandler1(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment2","demo");
}

segmentbtn2.addEventListener(MouseEvent.MOUSE_DOWN ,SegmentHandler2);
function SegmentHandler2(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment3","demo");
}

segmentbtn3.addEventListener(MouseEvent.MOUSE_DOWN ,SegmentHandler3);
function SegmentHandler3(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment4","demo");
}

segmentbtn4.addEventListener(MouseEvent.MOUSE_DOWN ,SegmentHandler4);
function SegmentHandler4(event:MouseEvent):void {
ignoriereStop = true;
gotoAndPlay(0,"demo");
}

and I think I have to create a textfield, convert it to MC, name it to "informationtext" for example and use MouseEvent.Roll_OVER or MouseEvent.Mouse_OVER and maybe Roll_OUT or Mouse_OUT if you leave the button.

I tried it to put it in there but I always get an error, I just don't get Actionscript, it would be great if somebody can tell me where exactly I have to put the code to make this work. :confused:

if you hover over, there should be just a normal text next to the buttons, not really a tooltip which is following the mouse until it's leaving the button.

Hope everybody understands what I mean and someone can help me.

I really appreciate your help

macco
12-08-2008, 08:49 PM
Show the text on ROLL_OVER and delete the text again on ROLL_OUT

seville
12-08-2008, 09:10 PM
Thank you macco I got this, but how do I have to put it in exactly in the code, I posted I before?

Thanks a lot