A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Using a rollOver while the mouse is down

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    18

    Using a rollOver while the mouse is down

    Hello,

    Here is what I wish to do: if the user presses a movie clip (this.onPress) a new menu is created as long as the mouse button is still pressed down. So basically I want some onRollOver actions for each of the new movie clips in this new menu. But I have found that onRollOver does not work, since the mouse is still depressed. Any Ideas?

  2. #2

  3. #3
    Senior Member Dricciotti's Avatar
    Join Date
    Aug 2002
    Posts
    2,988
    hitTest() is a great way to do that. You could also use a combination of onPress and onRelease to store into a variable whether the clip is pressed down.
    code:
    mc.onPress = function()
    {
    pressedDown = true;
    }
    mc.onRelease = function()
    {
    pressedDown = false;
    }


  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    Hey Dricciotti-

    if your surfing the board looking to help! (hint hint)

    I got some issues I still need help with:

    Print: http://www.flashkit.com/board/showthread.php?t=669624
    and a
    Shared Object: http://www.flashkit.com/board/showthread.php?t=669634

    Thanks (hope your around) noone has touched the printing problem in days! LOL

  5. #5
    Junior Member
    Join Date
    Nov 2005
    Posts
    18
    I guess what I'm having troubles with is the hitTest method
    When a certain movie clip is 'pressed' this function is called:
    Code:
    	for (var i = 1; i<=3; i++) {
    		for (var j = 1; j<=3; j++) {
    			var t = 1;
    			over = hold.attachMovie("squareClip", "overClip"+t, l);
    			over._x = 30*i-75;
    			over._y = 30*j-75;
                            t++
    what I want is: while the user still has the mouse depressed, they can scroll over this 3x3 square, and upon release something happens. How would I use the hitTest method for each of these "overClip"s ?

    For reference, I am making a sudoku game, and i want for this menu of 9 choices for numbers to appear when the user clicks on an empty space.

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