detecting mouse movements within objects

Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default detecting mouse movements within objects

    Hi Guys,

    I so need help with a movie I'm trying to make.

    I have a button (a square) on frame 1, it reacts to
    an on(RollOver) event which plays a loop of frames
    2 to 10. The loop exits on an on(RollOut) event.
    This is ok, except, I would like it to loop to activate
    only when there are mouse movements on the button.

    Please can anyone suggest how I might do this and
    what essential code I would need?


    thanks for reading,

    James


    James Guest

  2. Similar Questions and Discussions

    1. camera movements
      i read through the director help and i understand that there is an orbit command, but it doesnt display how to use it. I want to orbit my camera...
    2. Mouse Drag W3D objects
      Hi All, Im trying to add some mouse drag functionality to my shockwave 3D world, for picking up and moving W3D objects. I found a code snippet...
    3. Detecting two objects colliding
      Hi hope someone can help with this. I have a cube and a sphere in the scene and the sphere can be moved by keyboard controls, but how can i code it...
    4. Camera to follow mouse movements
      I want a user to be able to be able to walk through a scene like most first person shooter games, i.e. just move your mouse to the left and the...
    5. detecting Mouse movement
      Hi Shane, You can store the mouseLoc in a variable upon entering the screen saver movie. Then set a conditional in a framescript that will detect...
  3. #2

    Default Re: detecting mouse movements within objects

    James wrote:
    > Hi Guys,
    >
    > I so need help with a movie I'm trying to make.
    >
    > I have a button (a square) on frame 1, it reacts to
    > an on(RollOver) event which plays a loop of frames
    > 2 to 10. The loop exits on an on(RollOut) event.
    > This is ok, except, I would like it to loop to activate
    > only when there are mouse movements on the button.
    >
    > Please can anyone suggest how I might do this and
    > what essential code I would need?
    >
    >
    > thanks for reading,
    >
    > James
    when on(RollOver), setInterval to some strobing
    function that is continuously run at say every
    100 milliseconds.

    in the strobing function, you would capture
    the the mouse's position with _xmouse and _ymouse.
    compare this with the old position (always save
    a copy of the current mouse position). if
    there is a change in any of the coordinates,
    then you activate your loop.

    on(RollOut) you would disable the strobe function
    by setting a Boolean flag like bActive = false;
    remember to set bActive = false; at the beginning
    and to set bActive = true; on roll over. at the
    start of the strobe function, put it code like
    if (not bActive) { return; }

    --
    -----
    The Count, Singapore
    Learning Objects (e-Learning) Consultant
    Der Zählmeister Guest

  4. #3

    Default Re: detecting mouse movements within objects

    Ahh! Your a genius! Works like a dream.
    Thankyou kindly.

    Please excuse my novice ability - I'll know I'll
    look back and think how simple it is.


    James


    "Der Zählmeister" <the_count@mozilla.com.sg> wrote in message
    news:d07ar2$4ob$1@mawar.singnet.com.sg...
    > James wrote:
    >
    > > Hi Guys,
    > >
    > > I so need help with a movie I'm trying to make.
    > >
    > > I have a button (a square) on frame 1, it reacts to
    > > an on(RollOver) event which plays a loop of frames
    > > 2 to 10. The loop exits on an on(RollOut) event.
    > > This is ok, except, I would like it to loop to activate
    > > only when there are mouse movements on the button.
    > >
    > > Please can anyone suggest how I might do this and
    > > what essential code I would need?
    > >
    > >
    > > thanks for reading,
    > >
    > > James
    >
    > when on(RollOver), setInterval to some strobing
    > function that is continuously run at say every
    > 100 milliseconds.
    >
    > in the strobing function, you would capture
    > the the mouse's position with _xmouse and _ymouse.
    > compare this with the old position (always save
    > a copy of the current mouse position). if
    > there is a change in any of the coordinates,
    > then you activate your loop.
    >
    > on(RollOut) you would disable the strobe function
    > by setting a Boolean flag like bActive = false;
    > remember to set bActive = false; at the beginning
    > and to set bActive = true; on roll over. at the
    > start of the strobe function, put it code like
    > if (not bActive) { return; }
    >
    > --
    > -----
    > The Count, Singapore
    > Learning Objects (e-Learning) Consultant

    James Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139