将swf嵌入到Flash Builder中--“找不到类型"? [英] Embedding swf into flash builder--- "Type was not found"?

查看:116
本文介绍了将swf嵌入到Flash Builder中--“找不到类型"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用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.

这是我的代码:

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);
    }
  }
}

我做错了什么?

(请问我的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();

这篇关于将swf嵌入到Flash Builder中--“找不到类型"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆