Using Flash and Flex Together
Some notes:
Flash can be used to create item rendereres used by Flex
Flash can be used to create custom containers used by Flex
Flex Component Kit (beta)
- extension for Flash CS3
- mx.flash.UIMovieClip
- mx.flash.FlexContentHolder
- Make Flex component command (JSFL script)
- Implements IUIComponent
- Currently adds 14K to your Flash SWC
To use Flex Component Kit, you need:
- Flash CS3
- Extension Mgr CS3
- Flex Builder 3
- Flex Component Kit extension
UIMovieClip -
Extends MovieClip and allows it to be used in Flex
All stuff movie clip can do, like timeline, scaling, rotate, bitmap filters, etc
Implements core Flex interfaces, allowing the component to be used inside Flex containers and as Flex skins
You must override the setActualSize method to know about component resize changes
ContainerMovieClip -
Allows you to use a Flash MovieClip as a Flex container (e.g. Panel container in Flex). Within this container you place a FlexContentHolder to define the area in which the Flex content will reside
Don't use addChild, just assign the Flex content to the content property of the ContainerMovieClip
To create the UIMovieClip In CS3
- Convert to symbol
- Commands->Convert Symbol to Flex Component
- May warn you about the frame rate (Flex default is 24fps so you need to be that or higher), you have to coordinate with Flex developer
- Note that the registration point of the movie clip must be upper left
Other commands to turn symbols into Flex Skins that can be included into a Flex app via CSS
There are stateful and stateless skins (stateless is just declaring one MovieClip per skin, stateful is a multi-frame movie clip with a stop frame)
You can now add events in Flash using meta data that Flex can pick up on
A Flash component can define an animation that plays during a view state change, where the animation corresponds to a view state transition
Blog and examples for doing all of the above stuff: velloff.com

Comments