-
Doing the Mouse.hide is easy but what about a Mouse.hide constrained to a rectangle, eh? I need the mouse to hide when it rolls over one particular movie clip, image, whatever, within a .swf . It's hiding over the whole movie (yuck).
I'm still trying but if you've got any idea if this is even possible.... :-P let me know...
thanx
-
Hey! hehe That's what I was just about to ask.
HowHow???!!!???
I need that to make a little cursors previews in a set of squares, but when you leave the square I want the original mouse cursor again.
-
Infinite Loop
Hi,
Why not put the mouse.hide inside the "particular" MC.
onmouseOver
mouse.hide
onrollout
mouse.show
Hope it helps
Regards
~GD~
-
Try doing this:
Place this bit of code on your MC that you want the mouse to "hide" over.
__________________________________________________ _________
onClipEvent (enterFrame) {
if (this.hitTest( _root._xmouse, _root._ymouse, true )) {
Mouse.hide();
} else {
Mouse.show();
}
}
__________________________________________________ _________
It'll work on odd shaped MCs too
Good Luck
-
Yeah! Thanks! It works perfect.
-
'Snot working on mine!
-
Now I have another problem.
I have specify the cursor constrained to some rectangle, then all buttons outside that rectangle doesn't work, aaargh! I'm getting mad with this.
-
Hey squisshh!
Just do this as a test:
1-Draw a rectangle then convert to movie clip.
2-Right click that rectangle and choose edit.
3-Right click again over the rectangle and choose actions then paste the code.
That's it.
(May be the problem is you are pasting the code in a frame, you have to paste the code inside the object)
-
I still with the buttons problem.
TNX in adv.
-
Could the post the file or give us an example file of what you want to do?
-
http://www.shockinsider.com/spyro/cursor/
is 250kb so you have to wait a little.
You will see a sort of TV set with the cursor inside, the project is to make a preview TV to a list of buttons that load different cursors.
The mousehide/mouseshow works perfect but I can't use the buttons outside the TV set.
I want that cursor constrained to the rectangle of course but I noticed that when I don't make the cursor to be constrained I can use the button again.
And I really want that button outside the TV, in fact this button is just a test but the real button comes from the main movie, this TV set will be loaded using loadmovie action, and I want the other buttons available to preview another cursors in the same way.
TNX dudes you're very helpful.
[Edited by SPYRO on 08-26-2001 at 04:43 PM]
-
SPYRO,
do you mean convert that rectangle into a button?
you cant add actions to a movieclip, can you?
all this time ive been thinking actions belong to buttons...
-
nevermind i was thinking of the onMouseEvent action...
stupid me
-
ok I recreated the file based on the effect I saw from your .swf file, and this is what I came up with. Seems to work fine:
-On the Main stage I have an MC (called HideMouseMC), I also have a generic button (No code, Just Mouse over & down Images.)
-Inside HideMouseMC I have 3 layers
-top layer is a mask (to hide the Cursor Overlap, as in your example)
-second layer another MC "MouseDragArt"
-bottom layer a colored background
-On the mainstage, for the MC HideMouseMC, is this code:
__________________________________________________ ________
onClipEvent (enterFrame) {
if (_root.HideMouseMC.hitTest(_root._xmouse, _root._ymouse, true )) {
Mouse.hide();
startDrag (_root.HideMouseMC.MouseDragArt, true);
} else {
Mouse.show();
stopDrag ();
}
}
__________________________________________________ ________
If you'd like I can email the .fla file, so you can see exactly what I did. Hope this helps ya out.
P.S. You don't need to define the constrain area if using hitTest. It's the same effect.
-
P.S. You can take off the stopDrag so yer custom cursor wont appear to be stuck.
-
U guys are the BREAST!
U guys are great! Thanks for your help... It works!!
-
Originally posted by MainFrame76
Try doing this:
Place this bit of code on your MC that you want the mouse to "hide" over.
__________________________________________________ _________
onClipEvent (enterFrame) {
if (this.hitTest( _root._xmouse, _root._ymouse, true )) {
Mouse.hide();
} else {
Mouse.show();
}
}
__________________________________________________ _________
It'll work on odd shaped MCs too
Good Luck
Well, I used the code on one instance of an MC on the main timeline but apparently this code only works once on the main timeline, meaning that if I try to apply it to other instances on the same timeline, it won't work... any idea of anything that will give the same effect but that will work?
thanx!
-
Old Bit:
__________________________________________________ _________
onClipEvent (enterFrame) {
if (this.hitTest( _root._xmouse, _root._ymouse, true )) {
Mouse.hide();
} else {
Mouse.show();
}
}
__________________________________________________ _________
Ok the "Else" action is combating any other Mouse.hide(); commands that load after this bit. So, You can either add more code to the original MC, Have a Blank MC with this code (for tidyness) or you can create a Frame loop, whatever suits your project. Basicaly you just need to further define the IF statement with || (Short-circuit Logical OR operator), Like so:
New Bit:
__________________________________________________ _________
onClipEvent (enterFrame) {
if (_root.MC1.hitTest( _root._xmouse, _root._ymouse, true ) || _root.MC2.hitTest( _root._xmouse, _root._ymouse, true ) || _root.MC3.hitTest( _root._xmouse, _root._ymouse, true )) {
Mouse.hide();
} else {
Mouse.show();
}
}
__________________________________________________ _________
Now there is only one "Else" action for flash to keep track of.
Also we must now use the instance names , "this." is too generic.
[If you get more MCs than you care to add "||" code to, Maybe you might try setting a varible as a trigger?]
Hope that helps
-
Thanks dude now I'm starting to really understand the action scripting.
You basically need some imagination and understanding of every command.
-
Wow mainframe! No wonder your brain hurts...
You're good!
thanx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|