A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Enabling the hand cursor throughout a room escape game?

  1. #1
    Member
    Join Date
    Feb 2007
    Posts
    50

    Enabling the hand cursor throughout a room escape game?

    How exactly do you enable the hand cursor, throughout a room escape game, without it disrupting any other buttons or movie clips? This method is used so that you can't discover all the locations you need to click on.

    Could someone please help?

    Thanks.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    are you referring to - useHandCursor ?

    ActionScript 2.0 Language Reference
    ActionScript classes > Button > useHandCursor

    A Boolean value that, when set to true (the default), indicates
    whether a pointing hand (hand cursor) displays when the mouse
    rolls over a button. If this property is set to false, the arrow
    pointer is used instead.

  3. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    921
    Code:
    var mc = _root.createEmptyMovieClip("mc", _root.getNextHighestDepth ());
    with (mc) {
    	beginFill (0, 0);
    	lineTo (Stage.width, 0); lineTo (Stage.width, Stage.height); lineTo (0, Stage.height);
    	endFill ();
    }
    mc.onRelease = function () {};
    who is this? a word of friendly advice: FFS stop using AS2

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    realMakc - you won't be able to activate buttons
    movieclips are okay as long as you swap the depth
    test with a movieclip (clip) and a button (btn) -
    PHP Code:
    var mc _root.createEmptyMovieClip("mc"0);
    with (mc) {
        
    beginFill (00);
        
    lineTo (Stage.width0); lineTo (Stage.widthStage.height); lineTo (0Stage.height);
        
    endFill ();
    }
    mc.onRelease = function () {};

    clip.swapDepths(1000);
    clip.onRelease = function () {trace("OK");};

    btn.swapDepths(1010);
    btn.onRelease = function () {trace("not OK");}; 
    an alternative is to use a custom cursor -
    PHP Code:
    Mouse.hide;

    this.attachMovie("myCursor","myCursor",10000,{_x:_xmouse,_y:_ymouse});
    this.onEnterFrame = function(){
    myCursor._x _xmouse;
    myCursor._y _ymouse;
    }

    clip.useHandCursor false;
    clip.onRelease = function () {trace("OK");};

    btn.useHandCursor false;
    btn.onRelease = function () {trace("OK now");}; 

  5. #5
    Member
    Join Date
    Feb 2007
    Posts
    50
    Thanks, appreciated. One more question...

    How do you hide the mouse even after you right click using a custom cursor?

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    not possible..afaik

  7. #7
    5+5=55 Schfifty Five's Avatar
    Join Date
    Jun 2006
    Posts
    698
    Quote Originally Posted by Gibson221
    Thanks, appreciated. One more question...

    How do you hide the mouse even after you right click using a custom cursor?
    This will do it:

    Code:
    this.onEnterFrame=function(){
    Mouse.hide();
    }

  8. #8
    Member
    Join Date
    Feb 2007
    Posts
    50
    Yep, spot on... Thanks!

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