views:

133

answers:

1

Hi guys, I am no action script expert by any means however I am having a problem with mouse events.

I have a map which when you "click" on certain parts of the map (individual movie clips) will load an external movie, this works fine.

However I also want to animate the movie clip on mouse over with this code below.

MC_STIRLINGSHIRE.buttonMode = true;
MC_STIRLINGSHIRE.addEventListener(MouseEvent.MOUSE_OVER, MC_STIRLINGSHIREOver);
MC_STIRLINGSHIRE.addEventListener(MouseEvent.MOUSE_OUT, MC_STIRLINGSHIREOut);
MC_STIRLINGSHIRE.addEventListener(MouseEvent.CLICK, MC_STIRLINGSHIREClick);

function MC_STIRLINGSHIREOver (event:MouseEvent):void 
{
movLoader.load(movRequest4);
event.target.gotoAndPlay("over");
trace("stirlingshire movie loaded");
}

function MC_STIRLINGSHIREOut(event:MouseEvent)
{
event.target.gotoAndPlay("out");
movLoader.unload(); 
trace("movie unloaded");
}




function MC_STIRLINGSHIREClick(event: MouseEvent)
{
var MC_STIRLINGSHIRELink:URLRequest = new URLRequest("http://stirlingobserver.bookanad.com/wps/poc?uri=deeplink:action.AdWizard&action=wizard&adportal_entry=action&actionType=renderWizard&_authentication=login&adportal_url_type=category&advertiserTypeName=Individual&categoryId=39");
navigateToURL(MC_STIRLINGSHIRELink, "_parent");
}

This works fine if i swap MOUSE_OUT for ROLL_OUT and the same for MOUSE_OVER (ROLL_OVER). Does anyone know why the above does'nt work.

Cheers

+1  A: 

if memory serves me correctly, ROLL_OVER and ROLL_OUT are affected by the movieclip AND ANY CHILD-CLIPS, whereas MOUSE_OVER and MOUSE_OUT are only affected by the movieclip in question, and child clips do not activate it. if ROLL_OVER/OUT gives you what you want then use that.

oedo
roll_over/out does give me what i want but if you roll on and then off quickly it does not trigger the out function have u had this problem before ?
jonathan p
i've never had that - so you roll over, it triggers roll over, then you roll out (very quickly) and it still stays in rolled over state? you could try moving the `movLoader.load(movRequest4);` line after the trace?
oedo