dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: swapChildren / setChildAt depth issues

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    373

    swapChildren / setChildAt depth issues

    I've got a stage with a three movie clips on the stage from left to right next to on another in a line. These clips are nested inside of a MC which is nested inside of an MC. I'm using TweenLite to make it where mousing over one of the three images expands it but I want that MC to be the to depth and right now, only the right one is. I'm trying to use the setChildAt property but I'm getting errors and I'm wondering if this is because it's clips on the stage instead of clips being called by AS3. I'd personally rather keep the clips on the stage myself. So how can I make this work using just one function? Here's my current function code:

    function photoOver(evt:MouseEvent):void {
    evt.target.parent.parent.stop();
    this.swapChildren(DisplayObject(evt.target), this.getChildAt(numChildren-1));
    TweenLite.to(evt.target, .5, {scaleX:1.5, scaleY:1.5});
    }
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  2. #2
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    What errors are you getting?

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    It varies because I'm trying a lot of different combination's. But for the code I posted, I'm getting these errors when I try to mouse over an MC:

    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display:isplayObjectContainer/swapChildren()
    at filmstrip_fla::MainTimeline/photoOver()
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

Tags for this Thread

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