A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Quick Question about MC's and order...

  1. #1
    Senior Member
    Join Date
    Dec 2003
    Posts
    158

    Quick Question about MC's and order...

    If you've got 3 movieclips, all of which are in the same place, and when you click a button, one of the MC's plays, then you click another button and another MC plays. How do you make it so the last button you press, the MC comes to the top and is therefore visible above the other?
    That which does not kill us makes us stronger

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    AS2 use swapDepths()

    AS3 use addChild()

  3. #3
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    On the actual button?

    Code:
    on(rollOver){
    	
    _root.portfolio.play();
    
    this.swapDepths(99999);
    
    }
    Would it still be this. or would I change that?

    Thanks
    That which does not kill us makes us stronger

  4. #4
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    ???
    That which does not kill us makes us stronger

  5. #5
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    For AS2 try this...

    Code:
    on(rollOver){
    _root.portfolio.play();
    this.swapDepths(getNextHighestDepth());
    }

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Also, this implies the current object (ie, in that case the button your scripting on) you'd be better using an instance name if you want to target a specific mc, and not use action ON objects.
    Rather, use something like this:

    button.onRollOver = function() { mc.swapDepths(this._parent.getNextHighestDepth()); }


    gparis

  7. #7
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    Still doesn't appear to be working, having tried both of those. Not sure if i've actually used gparis' code correctly though.

    I make a button with the instance name, "button" and my MC should have the instance name mc?

    It's actually in a movieclip IN a movieclip, so the actual level of it is:

    _root.imac.portfolio

    ?
    That which does not kill us makes us stronger

  8. #8
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Code:
    on(rollOver){
    	
    _root.portfolio.play();
    
    this.swapDepths (_root.getNextHighestDepth());
    
    }
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  9. #9
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    Quote Originally Posted by angelhdz View Post
    Code:
    on(rollOver){
    	
    _root.portfolio.play();
    
    this.swapDepths (_root.getNextHighestDepth());
    
    }
    Thanks...But you're about 3 years too late! haha

    Appreciate the reply though. Hope it helps someone else!
    That which does not kill us makes us stronger

  10. #10
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Hahaha i LOLED so hard! I didn't see the post's date :P my bad.

    But as this issue was not solved by far, my help is not useless hehe. Cheers
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  11. #11
    Senior Member
    Join Date
    Dec 2003
    Posts
    158
    Quote Originally Posted by angelhdz View Post
    Hahaha i LOLED so hard! I didn't see the post's date :P my bad.

    But as this issue was not solved by far, my help is not useless hehe. Cheers
    No problem! As I said appreciate the reply and it may help someone else. I haven't used flash in years though so can't even remember what this was for!!
    That which does not kill us makes us stronger

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