Creating Flash Content for use in Flex July 29, 2010Posted by Tournas Dimitrios in Flash, Flex.
This guide will help you use the power and features of Flash within your Flex project. You will be creating a Flex Component from your Flash project.
- What this means to a Flash designer or developer is that you can take your design and animations and bring that into a Flex project.
- What this means to a Flex developer is that you or a Flash designer can create your animations and designs in Flash and export a swc that you can bring into your Flex project as a Flex component or Flex container complete with states, events, transitions and skins. This is without having to write code in Flash to do it, well, except if you need to dispatch events.
First thing that must be done is installing the Flex component Kit for Flash CS3 (see this article ) .
How do I create a Flash Component for Flex :
- In Flash create a new Flash project and save it into a folder
- In your new Flash project , create a movieclip via Insert > New Symbol (this will be the asset that we will use in Flex)
The name of the symbol will be the name of the Flex component . Name it something descriptive like “redcircle” . Be sure to remove any spaces
- Go into this movieclip . IE double click it in the library. BE SURE TO DO THIS!!!!!
- Create a layer called “content” and add graphics , images or text to the first or second frame . For example , draw a red circle .
- Select the movie clip in the library
- Goto Commands > Convert to Flex Component
- Goto file > Publish
This will create the swc file that we will use in Flex
How do I use the Flash component in my Flex project ?
- Open your Flex project and select it from the navigation tab.
- Project > Properties > Library Path > Add swc (add the swc file that was created by Flash )
- From the source mode editing mode , and inside the mxml area writhe “redc” and voila the code editing feature of Flex will reveal the redcircle component that was create with Flash . Also the namespace will be created automatically
Read further : Importing Flash CS3 Assets into Flex here>>
Download these files and see this article in action from here >>