PDA

View Full Version : Mouseevent help


tranquillity
08-06-2011, 01:02 PM
hello everyone. I got very silly simple problem but still I couldn't sort it out. if u can help me I would be very grateful. I got 3d slide show under this slide show i would like to create a link. and i got another movie clip to highlight text. everything is cool but the problem is when mouse rollovers on slide show pictures other movieclip on text highlights the text as well. I want them independent is there any way to do that ?im sorry abt my poor english.

here is the code:

this.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
this.addEventListener(MouseEvent.CLICK, onClick);

function onMouseOver(e:MouseEvent):void {
mouseEnabled = true;
buttonMode = true;
MovieClip(a).gotoAndPlay("s1");
}

function onMouseOut(e:MouseEvent):void {
MovieClip(a).gotoAndPlay("s2");
}


function onClick(e:MouseEvent):void {
navigateToURL(new URLRequest("blabla.com), "_parent");
}

mpelland
08-06-2011, 03:10 PM
not sure if i understand correctly, but i am assuming you issue is arising because you are adding the mouse listener to "this". that will make the mouseevent fire when the "this" is rolled over. if you want to apply it to something specific, you should do that.

It looks like you would like MovieClip(a) to have the rollover. so maybe just use a.addEventListener(...

tranquillity
08-07-2011, 12:34 AM
bro u r a star !! thanx alot for ur help. it worked like a charm !!