嵌入SWF到Flash Builder ---"类型未找到与QUOT;?未找到、类型、Flash、SWF

2023-09-08 11:53:20 作者:寡淡

我开发的ActionScript手机应用程序。

I am developing mobile app in ActionScript.

林导入的.swf文件,但得到的错误:

Im importing .swf file but get error:

Type was not found or was not a compile-time constant: MySwf.

下面是我的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?

(PS我的SWF文件与非Adobe程序所做的) 我使用Flash Builder

(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:

var p3:MovieClip = new MySwf();