3 Replies Latest reply on Jun 26, 2008 7:15 AM by Ski_Free

    Child dimensions larger than parent causes exception

    Ski_Free
      This is easy to reproduce.

      1. Create a Canvas with two child Canvas containers.
      2. Set the parent Canvas scroll policy to off for both scroll bars.
      3. Resize either child to exceed the parent window.
      4. Try swapping the z-order of the two children - you get an exception.

      The exception you get is :

      ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
      at flash.display::DisplayObjectContainer/swapChildren()

      I've attached some minimalist code that reproduces the error. Launch in a debugger, click "swap" everything is ok; click "resize" and then "swap" and the exception is thrown.

      Is this a bug? Is there a workaround?

      Thanks,
      Tony.