A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [F8] Animating movieclip by mouse/pointer position

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    12

    [F8] Animating movieclip by mouse/pointer position

    I'm trying to get a movieclip (which in this case is a rectangular panel that contains a number of buttons for mp3 links) that sits partially exposed at the bottom of the stage to rise up to fully expose the complete rectangle and buttons on it. I'd like to have it do this in reaction to the mouse/pointer being moved BELOW a given y coordinate, and then have it slide back down to it's original partially exposed position at the bottom of the stage when the mouse/pointer moves ABOVE a different y coordinate.

    Can anyone help?

    Thank you,

  2. #2

  3. #3
    Junior Member
    Join Date
    Mar 2007
    Posts
    12

    A real newby!!

    This is an intriguing hint. I would presume that a moveTo command with x & y coordinates would follow. I've tried several different phrasings with no luck. I've looked in several books (and there are many to choose from) and have found only very remote connections to this type of situation. Any other hints will be appreciated.

    Thanks you.

  4. #4

  5. #5
    Junior Member
    Join Date
    Mar 2007
    Posts
    12
    Your code was fine, it was just how to phrase the action once the condition was met (_ymouse>=100). In your 'yellow line' example the action is to output the text lines. In my situation it is to slide the movieclip (a rectangular panel that contains a number of buttons called btnPanel) from one place to another. How to phrase 'slide the movieclip to coordinate x & y' is my problem.

  6. #6

  7. #7
    Junior Member
    Join Date
    Mar 2007
    Posts
    12
    I've created a simple version of what I'm trying to do. The code is obviously wrong, but it shows similar x, y coordinates that might be in the real file. So I guess it's a matter of correcting my errant code.

    Thank you.
    Attached Files Attached Files
    Last edited by octobersongs; 03-30-2007 at 11:33 AM.

  8. #8
    Junior Member
    Join Date
    Mar 2007
    Posts
    12

    Your portfolio

    You have something quite similar on your site (christianschubert.biz). As you roll into any of the three sections of your portfolio, a panel slides up from the bottom to expose buttons (Learn More, Guestbook, etc.). When you roll out of the section the panel slides back down.

  9. #9

  10. #10
    Junior Member
    Join Date
    Mar 2007
    Posts
    12
    GREAT!! Except now if I place buttons into that mc, they are not clickable. I've taken your last file and added a button on the stage and the same button in the mc. You can click it on the stage but not in the sliding panel. That file is attached. I've also attached a cut down version of what I'm working on that shows the panel slide up on it's own with the clickable buttons.
    You have this exact type of thing in your portfolio. How does the panel slide up with the buttons still clickable?
    Attached Files Attached Files

  11. #11
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    Hi, try
    code:
    _root.btnPanel.onEnterFrame = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    this.nextFrame();
    } else {
    this.prevFrame();
    }
    };

    Hth,
    aut.

  12. #12
    Junior Member
    Join Date
    Mar 2007
    Posts
    12
    Quote Originally Posted by austriaman
    Hi, try
    code:
    _root.btnPanel.onEnterFrame = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    this.nextFrame();
    } else {
    this.prevFrame();
    }
    };

    Hth,
    aut.
    Dude!! Excellent!! Thank you!!

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