SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Jumping a clip from one level/layer to another with AS?

    Yer yer..... guess who's got a Flash project all of a sudden, hence all the stupid questions. Again, I can't actually find anything on how to do this. Any ideas?

    Here's my problem. I'm controlling movie clips from buttons.... mouseover effects basically. The problem is that my movie clips need to be able to shuffle themselves in terms of which one as on top as they're activated, ie: all the clips in level 0, but when activated (on mouseover), the active clip jumps in to level 1 (or up a layer... whichever works best/is possible). I know I can load external movies in to specific levels. Question is can you move internal movie clips to a different level or layer with AS or at least get a similar effect....?

    Thanks in advance.

    G

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you talking about levels or depths? I mean is to show the active clip on top of all the others. Best way to do it. is use swapDepths()

    Secnario, onMouseoVer assign current depth to global variable, swapDepths with 1000 or something and on MouseOut swapDepths back to the original depth.

    Let me know if you want to see some actionscript.

  3. #3
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep. Used swapDepth() but had to go a roundabout way of discovering it since I had no idea what you'd term it.... Works great. Here's what I'm doing. On the button:

    Code:
    on (rollOver) {
        _root.tactics1.gotoAndPlay(2);
        _root.tactics1.swapDepths(2);
    }
    on (rollOut) {
        _root.tactics1.gotoAndPlay(11);
        _root.tactics1.swapDepths(1);
    }
    And last frame of the clip:

    Code:
    this.swapDepths(0);
    Why jump back down to Level 0 in two steps? It's more pleasing on the eye cos what I'm doing is scaling something up and then back down again on mouseout. Without that extra level jump, as soon as the mouse goes out of the hit area the movie would leap back behind all the other inactive movies as it scales back down. Not as pretty! This way it goes to an intermediate Level where it won't get in the way of the next activated clip as it scales back, but also won't get lost behind the still inactive clips either. Sort of an air lock between the two states I guess...

    G


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •