Courtesy of Jamie S
We have started using Flex and Flash Builder quite frequently but we wanted still to use our own framework and code library. We found that various sprite manipulation scripts such as [addChild] would error when we were using flex objects. Instead we needed to use [addElement]. But our low-level framework uses [DisplayObjectContainer] in order to retain as much flexibity as possible and the compiler doesn't recognise [addElement] as a function of [DisplayObjectContainer]. We resolved this by using the [call] function:
This turned up a new challenge: our framework uses a number of default graphical elements which are pulled from custom swc files. But these elements are flash sprites and can't be directly attached to flex components. The answer was to create a new UIComponent at runtime and attach the flash spites to them:
var childContainer:UIComponent = new UIComponent;
So, we can continue to rely on the power of our own framework whilst combining it with the platform flexibility of Flex.
Website development at Signals
Our experience and technical expertise in creating websites, intranets and extranets ensures that we deliver real commercial benefit to businesses. Read more about what we do HERE.
Signals LtdBroadgates, Market PlaceHenley-on-ThamesOxfordshire, RG9 2AAUnited KingdomT +44 1491 571 812
Sign-up to our newsletter
Connect with us