A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: CS3 movie swapDepths or levels or getnexthighest help!

  1. #1
    Senior Member
    Join Date
    Dec 2004
    Posts
    100

    CS3 movie swapDepths or levels or getnexthighest help!

    Hello,

    I have 5 photos which are separate movies that enlarge and then decrease. I have them arranged in a line, slighty overlapping with movies 1 and 5 underneath then 2 and 4 then 3 on the top level.
    I would like it so that when you roll over each movie it comes to the top level then when you rollout it goes back to it's original position.
    I can't seem to get the code right however and they keep going back in the wrong position. Here is the code that I have placed on each invisible button over each movie:

    on (rollOver){
    laugh.swapDepths(1);
    laugh.gotoAndPlay(2);
    }

    on (rollOut){
    laugh.swapDepths(0);
    laugh.gotoAndPlay(8);
    }

    Please could anyone offer me any help as my brain is melting?!

    Thanks!
    meep =^._.^=

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I'll save your brain from melting (>O3O)> @@@ <- pretend that's your brain xD

    Yes, you can! Don't use swapDepths, but rather getNextHighestDepth, to get the Next Highest Depth - which again means to get the highest depth available :3

    Change your code to this:

    on (rollOver){
    laugh.getNextHighestDepth();
    laugh.gotoAndPlay(2);
    }

    on (rollOut){
    laugh.gotoAndPlay(8);
    }

    Hope it works ^^
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    Or this might also be a suitable answer.

    on the main timeline set the depths of your movieClips. for instance
    m1.swapDepths(1);
    m2.swapDepths(3);
    m3.swapDepths(5);
    m4.swapDepths(4);
    m5.swapDepths(2);

    Then inside the actual movieClip (not on it) put this code

    var d = this.getDepth()
    this.onRollOver = function() {
    this.swapDepths(6);
    }
    this.onRollOut = function() {
    this.swapDepths(d);
    }

    I haven't added the gotoAndPlay code but obviously you can add what you feel you need to.

  4. #4
    Senior Member
    Join Date
    Dec 2004
    Posts
    100
    Thanks to both of you- I will give them a go and see which works best!
    meep =^._.^=

  5. #5
    Senior Member
    Join Date
    Dec 2004
    Posts
    100
    Gah! I can only use rollover and mouseover on buttons and not in the movieclip. Still not working...
    meep =^._.^=

  6. #6
    Senior Member
    Join Date
    Dec 2004
    Posts
    100
    ...and there is a massive spider in here!
    meep =^._.^=

  7. #7
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Quote Originally Posted by meeptreats View Post
    Gah! I can only use rollover and mouseover on buttons and not in the movieclip. Still not working...
    You can use onRollOver and that stuff on Movieclips too, but to do that, you've got to give your movieclip an instance name (Properties Panel), like for example my_mc. And then, click on your Frame, open Actions Panel and write the code there on the frame:

    my_mc.onRollOver = function(){
    laugh.getNextHighestDepth();
    laugh.gotoAndPlay(2);
    }

    my_mc.onRollOut = function(){
    laugh.gotoAndPlay(8);
    }

    Hope this works - and kills that spider (^3^)---> :O: <- that is a spider, and a spear killing it :P
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  8. #8
    Senior Member
    Join Date
    Dec 2004
    Posts
    100
    It's still not working. Oh well. My mc did have an instance name- laugh. I might give up now. Thanks for your help
    meep =^._.^=

  9. #9
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Please send the FLA file - you are just confused, that's all
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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