A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Control MC based on button._y?

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    4

    Red face Control MC based on button._y?

    I'm working with Flash MX and have a slider that moves down a menu, based on either the mouse position or (if the mouse isn't over the menu), based on the main timeline's frame.

    What I'd like to do is play a movie clip that's syncronized to the menu. If the slider is over the first picture, I'd like to gotoAndStop on a specific frame of the movie clip.

    The slider is called slider and the movie clip is called opacity. I tried to attach the AS to the opacity clip, but it didn't work, so now I'm writing the AS directly onto the main timeline.

    Here's what I have:


    _root.onEnterFrame = function() {
    if (this.slider1._y <= 182.9){
    this.opacity.gotoAndStop(2)
    }
    else
    this.opacity.gotoAndStop(1)
    }


    However, the movie clip is stopping on frame 2 and NOT changing when the slider's y-position is changed. Any ideas on where I'm going wrong?

    Thanks in advance!

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    4
    I solved it. Looks like using "_root" and "this" were giving me the problems.

    onEnterFrame = function() {
    if (slider._y <=182.9) {
    opacity.gotoAndStop(2);
    }
    else
    opacity.gotoAndStop(1);
    }

Tags for this Thread

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