all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

trying to rollout of object shape



trying to rollout of object shape k-doggie
12/27/2005 9:43:40 PM
flash actionscript: I created a movieclip that closes when I rolloff of it. The only problem is
that there are shapes ontop of the movie clip and the movieclip closes when my
mouse goes over these shapes. I think my best solution is to tell flash, if i
roll the mouse outside of the movieclip demension, then close, else don't close
(because all the shapes ontop are inside the parameter of the movieclip). Is
there a guide online to help me code this? I think getbounds is a possible
start...

Thanks!


Re: trying to rollout of object shape kglad
12/28/2005 2:19:46 AM
Re: trying to rollout of object shape k-doggie
12/28/2005 3:42:07 PM
so If I wanted to use the _root.xmouse and ymouse features, and the goal was to
react when the mouse leaves a sqaure box....then i would use this logic?

if (_root._xmouse is greater than value) and (_root._xmouse less then value) {
condition
}

// if (_root,_ymouse.....


If this logic does work, can this be nested in seperate movie clips, with
different values, within the same flash movie?

Thanks!
Re: trying to rollout of object shape kglad
12/28/2005 6:10:19 PM
yourMC.onRollOut=function(){
testI=setInterval(testF,60,yourMC,100,100); // the parameters in this line
will vary from movieclip to movieclip.
}
function testF(mc,x,y){

if(_xmouse<mc._x-x&&_xmouse>mc._x+mc._width+x&&_ymouse<mc._y-y&&_ymouse>mc._y+mc
.._height+y){
clearInterval(testI);
//close your movieclip the mouse is outside an x by y square enclosing your
movieclip
}
}
AddThis Social Bookmark Button