Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
MyFlashMXIN #1
Check if mouse in movie clip...?
Is there any easy way to check if the mouse is inside a movie clip...
I'm wanting to check the mouse location, if it's not in my movie clip (drop menu) then remove the movie clip.
Thanks
MyFlashMXIN Guest
-
Movie clip mouse events
Hi, Really enjoying learning Actionscript 2 but this one's stumped me... I have a movie clip called tabBar1_mc which contains tabs (eg tab0_mc)... -
need help positioning movie clip relative to a resizing clip...
I am trying to attach a "caption" to the bottom right edge of a movie clip that resizes. I am using the resizing clip as a image holder for a... -
control main movie from inside a movie clip
this has probably been discussed already but i couldn't find it, heck I may have already asked it. I have a movie clip with a button in it, when the... -
Duplicate Movie Clip in a Duplicated Movie Clip...
I'm making a Flash Navigation Bar (menu) that could be freely customized by people just through a text file. The problem is that my submenus won't... -
Controlling main movie from within another movie clip..?
Okay firstly heres the .swf of what im trying to do http://www.happylobster.co.uk/flash/flashtester.swf Basically I have 2 Scenes, each with a... -
jerreye04 #2
Re: Check if mouse in movie clip...?
//This is just a test script.
//Move your mouse around the following coorinates (xMin,xMax,yMin,yMax)
//You see your cursor will disappear.
//You can simply replace theMouse.show() and Mouse.hide() with whatever you
want
//Of course, you can also change the coordinates.
_root.onEnterFrame = function() {
xMin = 0;
xMax = 200;
yMin = 0;
yMax = 50;
mX = _xmouse;
mY = _ymouse;
if (mX>xMin && mX<xMax && mY>yMin && mY<yMax) {
Mouse.hide();
//or do whatever you want
} else {
Mouse.show();
//or do whatever you want
}
};
jerreye04 Guest
-
MyFlashMXIN #3
Re: Check if mouse in movie clip...?
LMAO, that removed my mouse not my MC! :-)
MyFlashMXIN Guest
-
jerreye04 #4
Re: Check if mouse in movie clip...?
lol...Maybe I assumed too much. (I was trying to show you how to capture the
location of your mouse)
As you can see in my COMMENTS, you can replace the Mouse.hide() to whatever
you want.
If you want it to remove your MovieClip instead, then do that.
I dont know exactly what you want to do, but you can work it out with this
idea...
_root.onEnterFrame = function() {
xMin = 0;
xMax = 200;
yMin = 0;
yMax = 50;
mX = _xmouse;
mY = _ymouse;
if (mX>xMin && mX<xMax && mY>yMin && mY<yMax) {
//myMC._visible = true;
} else {
//myMC._visible = false;
//or you could do this as well (assuming you used either
duplicateMovieClip(), MovieClip.duplicateMovieClip(), or
MovieClip.attachMovie())...
//myMC.removeMovieClip();
}
};
jerreye04 Guest
-
jerreye04 #5
Re: Check if mouse in movie clip...?
In case you havn't figured out your problem yet, here is my finished script:
_root.onEnterFrame = function() {
xMin = dropmenu._x;
xMax = dropmenu._x+dropmenu._width;
yMin = dropmenu._y;
yMax = dropmenu._y+dropmenu._height;
mX = _xmouse;
mY = _ymouse;
if (mX>xMin && mX<xMax && mY>yMin && mY<yMax) {
dropmenu._visible = true;
} else {
dropmenu._visible = false;
//or you could do this as well (assuming you used either
duplicateMovieClip(), MovieClip.duplicateMovieClip(), or
MovieClip.attachMovie() to load in "dropMenu")...
//dropmenu.removeMovieClip();
}
};
jerreye04 Guest
-
MyFlashMXIN #6
Re: Check if mouse in movie clip...?
Yep, figured it out from the last post, just ran out of time to reply... Thanks!
MyFlashMXIN Guest



Reply With Quote

