What are the strengths of flex builder3? Code The strength of Flash is the preparation of the front-end interface. How to combine these two advantages to write code in flex builder and then import it to flash cs4, the products used in this article are flex builder3 and Flash CS 4. Use flex builder 3 to create a SWC class library.
Create a new Flex library project and a new class flashclass
Package
{
Import flash. display. movieclip;
Import flash. display. shape;
Public class flashclass extends movieclip
{
Public Function Flashclass ()
{
VaR Child: Shape = New SHAPE ();
Child. Graphics. beginfill ( 0xff3355 );
Child. Graphics. drawrect ( 50 , 100 , 200 , 100 );
child. graphics. endfill ();
addchild (child );
}< P>
}< BR >}
Code
when saved, flex automatically generates the SWC file
open the flash cs4, create a FLA file, open the window and choose Properties> Configuration File> Edit> SCRIPT> Settings> library path> plus sign to navigate to the folder where the SWC file is located, or the SWC file can be
and then write down
var flexobj: flashclass = new flashclass ();
addchild (flexobj );
If the written class is in the package, the corresponding namespace should be introduced.
If You Want To apply the flash components in flex, you only need to export the components as SWC files through flash, then you can add the library path to the flex project.
PS: I used flash cs4 and flex builder 3 both in dashboard.