Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : Easier way? (Multiple mouse zones _mc)



jon j
4/18/2004 5:01:54 PM
Hi All,
When defining multiple "click" zones on a movie clip, or the main stage for
that matter.
Is there an easier, or more succinct way of defining those areas?
I'm using something like this now:
if(((theY <= 250 & theY >= 50)&(theX <= 350 & theX >= 150))&((theX <= 350 &
theX >= 150)&(theY <= 250 & theY >= 50)))

Also, I'm using, onClipEvent(mouseUp), how do I trap the mouseUp event to the
movie clip, not the whole stage?


Thanks for your time,
Jon
jon j
4/18/2004 6:14:28 PM
Thanks John,
I was going to try buttons if I could get it to work better..

is this the way to get the _xmouse of the button?
myButton.onRelease = function(){
myX = this._xmouse.......????
}
thanks,
Jon
Laiverd.COM
4/18/2004 7:14:06 PM
Much easier would be to create invisible buttons with that movieclip.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

jon j
4/18/2004 9:47:32 PM
Hi John,
I need the _xmouse and _ymouse as variables for two things.
1) to move another movie clip to the Mx&y.
2) to pass the x & y as a frame number.

You can see what I'm doing in the included code. It works fine sept I have to
figure out all my start and stopping points.
I was hoping for a better system.
Thanks for your time, again,
Jon

onClipEvent(mouseUp){
theX = Math.round(_xmouse);
//trace("_x = " + theX);
theY = Math.round(_ymouse);
//trace("_y = " + theY);
if((theX > 1 & theX < 400) & (theY > 1 & theY < 400)){
this.ball_mc._x = theX;
_parent.x_mc.xMask_mc.gotoAndStop(theX);
}
if((theY > 1 & theY < 400) & (theX > 1 & theX < 400)){
this.ball_mc._y = theY;
_parent.y_mc.yMask_mc.gotoAndStop(theY);
}
if(((theY <= 250 & theY >= 50)&(theX <= 350 & theX >= 150))&((theX <= 350 &
theX >= 150)&(theY <= 250 & theY >= 50))){
if(this.boxFill_mc._currentframe == 1){
this.boxFill_mc.gotoAndPlay(2);
}
//trace("in the target zone of Y")
//trace("in the target zone of X")
}else{
if(this.boxFill_mc._currentframe == 10){
this.boxFill_mc.gotoAndPlay(11);
}
}
}
Laiverd.COM
4/18/2004 10:04:10 PM
;-) A button does not have an _xmouse property. Guess you're looking for the
x posiition of the mousecursor whcih would be something like _root._xmouse.
What would you need it for?

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

AddThis Social Bookmark Button