I can not run AS included into SWC library. I made two test-projects - one in Flash Pro - just as it was described in the answer here:
- with addition of some AS3 code that animate the blue circle. Second project - Flex ActionScript Mobile project type in Flash Builder.
I exported the Flash Pro project to SWC, with "AS Linkage" box and "Export In Frame 1" boxes checked. Then I add the SWC to Flex project in project properties. I add MovieClip to the Stage:
package {
import ExportSWC_test_fla.*;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.utils.getDefinitionByName;
public class BlueCircleRun extends Sprite
{
public function BlueCircleRun()
{
super();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var symbol:BlueCircle = new BlueCircle();
symbol.x = 150;
symbol.y = 150;
addChild(symbol);
}
}
}
I can see the MovieClip on the stage - when I compile and run Flex project. The problem is - the script in the Movie does not run. How can I run it ? Can I import and run the whole Movie from SWC ? How can I do this ?