3 Replies Latest reply on Aug 25, 2008 6:17 AM by Newsgroup_User

    Flash components in Flex

    RossRitchey Level 4
      I have built an interface in Flash CS3 and now have the need to port it over to Flex. I am trying to do it with as little re-build as possible, so I need to port the Flash components over with it. I exported a SWC with all of the components I am using, and added it to the Library Path of an AS project.

      The build gives me no errors, but I do get a #2007 at runtime. The error seems to be stemming from a Yahoo ASTRA Flash component, which was included in the SWC.

      TypeError: Error #2007: Parameter child must be non-null.
      at flash.display::DisplayObjectContainer/addChildAt()
      at fl.controls::BaseButton/drawBackground()
      at fl.controls::LabelButton/draw()
      at fl.controls::Button/draw()
      at com.yahoo.astra.fl.controls.tabBarClasses::TabButton/draw()
      at fl.core::UIComponent/drawNow()
      at com.yahoo.astra.fl.controls::TabBar/drawButtons()
      at com.yahoo.astra.fl.controls::TabBar/draw()
      at fl.core::UIComponent/callLaterDispatcher()

      I have been searching around the net, and the majority of people are saying that this happens when the skins aren't included (so you need to set them before the component is added to the stage). I am using customized programmatic skins, for which the source files are included in the build, and the styles get set before the component is added to the stage (I actually replaced the default ones in the class).

      Does anyone have any other ideas as to how I could fix this?

      PS - It is an ASTRA TabBar component that is giving me issues. I know that Flex has a TabBar and TabNavigator, but I can't find any documentation on how to use these from an AS project (no MXML). I will simply rebuild using the native Flex controls if necessary, and if possible, but would prefer to fix the issue as it currently stands. (I might go back to Flash at some point, and don't want to tie myself to a particular solution, considering I can't use Flex components in Flash).

      PPS - If you are wondering why I am porting to Flex right now, especially if I am considering taking it back to Flash in the future, it is because I have the need to begin building in FlashPlayer 10 functionality, and the only way you can build to FP10 right now (as its in beta) is with a nightly build of Flex.