I am trying to take an animation I made in flash professional, and use it inside of the Flash Builder IDE.
I have tried importing an image to the stage in flash, converting it to a movie clip and exporting it as a .swc. After adding the swc to a Flash builder project, I was able to create a class specified by the swc file, and by adding the object to the display tree I could see the image when I ran my project.
So I tried the next step which was to animate the image. I imported an image to the stage, inserted some frames and made a 1 second animation. I copied the frames, created a new movie clip and pasted the frames into the movie clip. I then exported it as a .swc.
The problem is that when I do the same thing as before (with the image), the animation is not being displayed at all. However, If I export as a .swf instead of a .swc, I can see my animation play correctly inside an instance of adobe flash player.
My AS3 code:
var testAnimation:MovieClip = new TestAnimation();
...
addchild(testAnimation);
From Flash Pro, assure your symbol has AS Linkage:
You can export individual symbols from the library – Right-click on the symbol and save as SWC:
Or, you can export the entire project as a SWC from Flash Pro’s Publish Settings:
Add the exported SWC to Flash Builder’s build settings. If you don’t want to add individual SWC, create a
libsfolder and Add SWC Folder:Add the display object to the display list, assuring you account for registration point:
Build and run: