0
我从Flash CS3中导出了一个SWC,并且资源可以工作,但按钮除外,它们看起来像是另一个库项目。如何在SWC的Flash Builder项目中添加SimpleButton?
代码:
package {
// ...
import flash.display.Sprite;
import flash.display.SimpleButton;
import res.botoes.Pause;
// ...
public class Cena extends Sprite {
// ...
private var botao:SimpleButton;
// ...
public function Cena() {
// ...
botao = new Pause() as SimpleButton;
addChild(botao);
// ...
}
// ...
}
}
确保您输入正确类。你的按钮类是从SimpleButton继承的,还是你的按钮类的名字? – Corey 2013-03-05 20:56:19
是的,我正在导入正确的类,并且该按钮从Flash中导出,所以它扩展了类flash.display.SimpleButton – Guerreiro 2013-03-05 20:59:06
某些代码会很好。 – David 2013-03-05 21:56:26