I am developing mobile app in ActionScript.
Im importing .swf file but get error:
Type was not found or was not a compile-time constant: MySwf.
Here is my code:
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
public class gyyyyppp extends Sprite
{
[Embed(source='assets/g1.swf')] public static const MySwf : Class;
public function gyyyyppp()
{
stage.align = StageAlign.TOP_LEFT;
var p3:MySwf= new MySwf();
addChild(p3);
}
}
}
What I am doing wrong?
(p.s. my swf file is made with non-adobe program)
I’m using Flash Builder
I don’t think you can set the embedded class as the variable type, try this: