A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Swap depth issue

  1. #1
    Member
    Join Date
    May 2005
    Posts
    53

    Swap depth issue

    Hi all, been trying to work this problem out for the past couple of hours with no luck.

    On stage I have the following:
    Background image/pattern = mcb
    masked image = car
    Mask = qtr_mc

    Basically I have loaded from an external swf the background (mcb) and what I want is to have the mask (qtr_mc) obscure part of the background and to show the image underneath (in this instance "car").

    Now part of the problem is that both the background and the mask have been set a depth of -16384 (according to the trace command I have inserted in the script). I seem to have a problem changing the depth so that the mask sits on top of the background.

    The script is:
    code:
    this.createEmptyMovieClip("mcb",0)
    mcb.swapDepths(0)
    trace(getDepth(mcb))
    trace(getDepth(qtr_mc))
    //load first movie into clip 1 to start with the first image
    mcb.loadMovie("levQuarterRound.swf");
    mcb._y = 0;
    //variables that store current clip and current content index
    activeTarget = mcb;
    qtr_mc.swapDepths(1);
    car.setMask(qtr_mc);



    Maybe an alternative solution is not to call the background as an external swf but to have it directly on stage.

    Any clues as to where I'm going wrong?

  2. #2
    Flash, Mans greatest invention
    Join Date
    Jul 2005
    Posts
    382
    why cant you just use this.getNextHighestDepth()

  3. #3
    Member
    Join Date
    May 2005
    Posts
    53
    Alas no luck with getnexthighestDepth().

    Also for some reason this was not in my sourcecode text book.

  4. #4
    Flash, Mans greatest invention
    Join Date
    Jul 2005
    Posts
    382
    what version of flash are you using im guessing mx and below at ur code but..

    POST your fla

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