A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: getDepth();

Hybrid View

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Posts
    312

    getDepth();

    trying to understand getDepth better
    i have main mc and mc b so i do
    main.attachMovie("b", "b1",1);
    it works fine it but if i change depth from 1 to main.getDepth the main mc dissapears. why is that? does main mc get replaced by b1?

  2. #2
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    there are several thousands of depth layers. what you place on on the stage during authoring time is automatically put into the depth range below 0. what you create by actionscript should be put in the positive range.

    there can be only one object per depth layer. thus, your main MC disappears, if you put something else on its depth level.

    if you create mcs per AS and don't want to keep track of which depth has already been taken, you can use mc.getNextHighestDepth();

    e.g.:
    main.attachMovie("b", "b1",main.getNextHighestDepth());

    will attach an mc to main and automatically put it into the next highest depth level inside main that is not yet occupied by another object.
    Please sign here

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