A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: Why do I always seem to want the impossible????

  1. #1

    Thumbs up

    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

  2. #2

    Smile

    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.

  3. #3
    Infinite Loop grvdgr's Avatar
    Join Date
    Feb 2001
    Posts
    610
    Hi,
    Why not put the mouse.hide inside the "particular" MC.

    onmouseOver
    mouse.hide
    onrollout
    mouse.show

    Hope it helps
    Regards
    ~GD~

  4. #4
    Member
    Join Date
    Jul 2001
    Posts
    48
    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


  5. #5

    Smile

    Yeah! Thanks! It works perfect.

  6. #6

    Red face 'Snot working on mine!

    Sniff! :-(

  7. #7
    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.

  8. #8

    Smile

    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)


  9. #9

    Smile

    I still with the buttons problem.

    TNX in adv.

  10. #10
    Member
    Join Date
    Jul 2001
    Posts
    48
    Could the post the file or give us an example file of what you want to do?

  11. #11

    Smile

    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]

  12. #12
    Junior Member
    Join Date
    Mar 2001
    Posts
    2
    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...

  13. #13
    Junior Member
    Join Date
    Mar 2001
    Posts
    2
    nevermind i was thinking of the onMouseEvent action...
    stupid me

  14. #14
    Member
    Join Date
    Jul 2001
    Posts
    48
    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.

  15. #15
    Member
    Join Date
    Jul 2001
    Posts
    48
    P.S. You can take off the stopDrag so yer custom cursor wont appear to be stuck.

  16. #16

    Smile U guys are the BREAST!

    U guys are great! Thanks for your help... It works!!

  17. #17
    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!

  18. #18
    Member
    Join Date
    Jul 2001
    Posts
    48
    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

  19. #19
    Thanks dude now I'm starting to really understand the action scripting.

    You basically need some imagination and understanding of every command.

  20. #20
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center