5 Replies Latest reply on Aug 4, 2008 11:51 AM by Peter Lorent

    rawChildren ruins layout in Flex 3

    Thurinus Level 1
      Hey all!

      I've been playing around with Flex lately, and having come from a pure AS3 background, I couldn't help but create some simple effects in there for fun. That's when I hit a snag. Now, with Flex, I'd have to use the UIComponents' rawChildren object in order to add widgets of DisplayObject types... fair enough. Problem is when I do that, the components stop obeying layout rules, transitions stop working, etc.

      The best way to really demonstrate this problem is to see the project itself. Here's a link to the project source:

      http://www.thurinusworks.com/public/problem_src.zip

      In there I created a Panel component that has view states and transitions, and an Application that holds that Panel and houses a bit of actionscript to create a sparkly mouse toy effect. If you commented out all the script for the mouse toy, you'll see that the Panel centers on the Application as you resize the window, and clicking the 'Register' link would display a nice elastic transition effect between view states. When the mouse toy is active, the Panel position stops working correctly, and clicking on the 'Register' link would simply display the view state with no transition. It happens intermittently, but seems to guarantee happening after the first SWF launch, so if you don't see it happening, relaunch the SWF and it should screw up.

      I don't know what's causing it to break like this. It's either my error or a serious bug in Flex, and I dearly hope it's the former... If it is, what must I do to fix it? If it isn't, is there a work-around?

      Thanks for *any* help you can provide!

      Best regards,
      Jay