用另一种方法访问MovieClip
var PlayerScore:TextField = new TextField();
//Here we add the new textfield instance to the stage with addchild()
_canvas.addChild(PlayerScore);
var myFormat:TextFormat = new TextFormat();
myFormat.size = 30;
PlayerScore.defaultTextFormat = myFormat;
PlayerScore.text = _player_score.toString();
PlayerScore.width = 250;
PlayerScore.x = 70;
PlayerScore.y = -20;
PlayerScore.textColor = 0xFFFFFF;
我在我的构造函数中使用它
如何
PlayerScore.text = _player_score.toString();
在另一种方法中使用?
var PlayerScore:TextField = new TextField();
//Here we add the new textfield instance to the stage with addchild()
_canvas.addChild(PlayerScore);
var myFormat:TextFormat = new TextFormat();
myFormat.size = 30;
PlayerScore.defaultTextFormat = myFormat;
PlayerScore.text = _player_score.toString();
PlayerScore.width = 250;
PlayerScore.x = 70;
PlayerScore.y = -20;
PlayerScore.textColor = 0xFFFFFF;
I use this in my Constructor
How can I use
PlayerScore.text = _player_score.toString();
In another method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用此方法{
PlayerScore.text = _player_score.toString();
分配变量:示例
将按钮或 mc 添加到舞台,为其指定实例名称“showTextBTN”。
然后添加一个实例名称为“Money”的动态文本框。
在动作时间轴(as3)中添加上述代码;
编译/运行电影
To use this method{
PlayerScore.text = _player_score.toString();
assign a variable:example
Add a button or mc to stage, give it an instance name of "showTextBTN".
Then add a dynamic text box with instance name "Money".
add the above code in the actions timeline (as3);
Compile/ run movie