A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Problems dynamicly setting depth of a line

  1. #1
    Member
    Join Date
    Jul 2006
    Posts
    75

    [F8] Problems dynamicly setting depth of a line

    Hey, I am having problems dynamicly setting depth of a line that I drew from actionscript. I use this in an onclipevent(load) to make a clip to draw a line.
    Code:
    _root.createEmptyMovieClip("wallpiece"+instance, instance);
    after that I would draw a line. The line draws fine but it is in front of all the other instances. In other instances I use this code. In the script I calculate the depth and "try" to set it with this
    Code:
    _root["wallpiece"+instance].swapDepths(this.newdepth);
    Is it even possible to dynamicly set the depth of a dynamicly drawn line?

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Posts
    148
    use MovieClip.getNextHighestDepth(); to let Flash find the next available depth at runtime.

    For example:

    Code:
    _root.createEmptyMovieClip("wallpiece"+instance, this.getNextHighestDepth());

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