A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS2 Buttons in rollover movie problem

  1. #1
    Member
    Join Date
    May 2008
    Posts
    70

    AS2 Buttons in rollover movie problem

    This is probably very simple but I can't seem to work it out.
    I have a movie clip that sits at the bottom of my movie, when onRollOver over it slides up to reveal some buttons and when onRollOut it slides back down.
    My problem is that when it slides up and the buttons that are now visible get rolled over the whole thing tries to slide back down because the now visible buttons override the movie clip code that holds it up.
    I have attached an example as I know that description may not make much sense.
    Any help would be really appreciated.

    AS CODE:
    btn_move_mc.onRollOver = function() {
    _root.yTargetMC =0;
    _root.yTargetMC1 =50;
    }
    btn_move_mc.onRollOut = function() {
    _root.yTargetMC =100;
    _root.yTargetMC1 =150;
    }

    _root.content_mc.btn_oval1_mc.onRollOver = function() {
    }
    _root.content_mc.btn_oval2_mc.onRollOver = function() {
    }
    _root.content_mc.btn_oval3_mc.onRollOver = function() {
    }

    CODE ON MOVIE CLIP
    onClipEvent (enterFrame) {
    yMC = getProperty(_root.btn_move_mc, _y);
    moveMC = _root.yTargetMC - yMC;
    setProperty(_root.btn_move_mc, _y, yMC + (moveMC/5));
    }
    Attached Files Attached Files

  2. #2
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Hello there,

    Please chek the attachment! What I have implemented is a workaround solution to your problem but does seems like that this should be the only solution to get the thing done for you

    - rollout action is removed from the actions on 1st frame
    - A new movie clip is added at the last layer
    - a function is written to do the rollout and that function is called on rollover of newly created movie clip!
    Last edited by vinayak.kadam; 05-25-2011 at 08:14 AM.
    As ever,
    Vinayak Kadam

  3. #3
    Member
    Join Date
    May 2008
    Posts
    70
    Thank you so much for your help its exactly what I was looking achieve I really appreciate it.
    Embussy

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