Oct 01 2004

Flex Tip 4: Lessons learned when porting custom SWCs from Flash IDE to Flex

Published by at 22:38 under Wayback Archive

This week I helped someone to port an excisting Flash RIA to Flex. One of the ‘struggles’ was porting the custom components. There are some things you need to be aware of when doing this because they are important for SWCs used by Flex, whilst it’s not important for Flash IDE-only SWCs:

  • Custom SWCs need to be linked to an ActionScript 2.0 class when you are exporting them for Flex. If they are not, they will not work in Flex (the Flash IDE allows you to export SWC without specifying a class and the component will work when used in the Flash IDE)
  • Custom SWCs for Flex that are not a faceless component, always need to extend mx.core.UIObject. If you do not extend UIObject – it often happened to me when making my own Flash IDE SWCs that they were not – your component will not become visible in Flex. Flex threaths this component as a faceless component; I tried this and got the error message that faceless components can only be a direct child of Application, not of VBox etc, which indicated that my component was threated this way. So always extend mx.core.UIObject and don’t forget to define in your publish settings that the classpath is your Flex classes folder, not the build-in Flash classes!

No responses yet

Comments are closed.