A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: record depth of MC as a variable?

  1. #1
    Senior Member
    Join Date
    Dec 2000
    Posts
    336
    hiya

    does anyone know how i can record the depth of a MC, sorta like:

    mcdepth = myMC._depth

    (just like _visisble or _x or _rotation, etc..)

    then, later set another MC to the depth from that variable using a button? like this maybe (not swapdepths):

    MC2._depth = mcdepth

    any ideas? thanks!

  2. #2
    Aquarium drinker
    Join Date
    Nov 2000
    Location
    Greater than 45 degrees in Minkowski space
    Posts
    571
    Searching over at were-here, I soon found out that MX has this ability built-in. Just look at the Movieclip.getDepth action in the AS dictionary.

    Just more proof that MM actually listened to our complaints about Flash 5

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Posts
    336
    thanks pmineault! right, i know about the getDepth action in MX but it's different, i'm not sure how i use it bc it doesn't work the same way as _visible or _rotation, etc. when i try to trace my variable like this:

    on (press) {
    s1depth = swf1.getDepth;
    }
    on (release) {
    trace(s1depth);
    }

    it returns [type Function] what is that? any ideas on how to correct this? thanks!

  4. #4
    Master Poo Flinger
    Join Date
    Sep 2000
    Posts
    318
    you need to use the parenthesis because it's a function, not a property:

    on (press) {
    s1depth = swf1.getDepth(); //<-- Right here
    }
    on (release) {
    trace(s1depth);
    }

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