Flash 用另一种方法访问MovieClip

Flash 用另一种方法访问MovieClip,flash,actionscript,Flash,Actionscript,我在构造函数中使用它 我如何使用 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.d

我在构造函数中使用它

我如何使用

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=\u player\u score.toString()

分配变量:示例

PlayerScore.text = _player_score.toString();
向stage添加一个按钮或mc,给它一个实例名“showTextBTN”。 然后添加一个实例名为“Money”的动态文本框。 在行动时间表(as3)中添加上述代码;
编译/运行电影

你说的“使用”是什么意思?你是说如何从其他方法/类设置文本?你可以将其设置为静态变量“你是说如何从其他方法/类设置文本?”是的
    var cash:int = 500;  // cash is the variable//

    showTextBTN.addEventListener(MouseEvent.CLICK, variableTotext);

    function variableTotext(){
    Money.text = cash.toString();// the variable cash will output in Money text box
    }