我想要传递
的内容B1L_bnt.text
到
buddy_txt.text
谁能告诉我黄在这做什么?
function clickHandler(event:MouseEvent):void
{
/*container_mcM.removeEventListener(MouseEvent.CLICK,clickHandler);*/
var clickedObject:DisplayObject = event.target as DisplayObject;
var bobby = Object(root).littlepicker.B1L_bnt.text;
if (clickedObject.name == 'frd_bnt1')
{
Object(root).BFFwho.buddy_txt.text = "bobby";
Object(root).gotoAndPlay(15);
}
答案 0 :(得分:2)
试试这个:
function clickHandler(event:MouseEvent):void
{
/*container_mcM.removeEventListener(MouseEvent.CLICK,clickHandler);*/
var clickedObject:DisplayObject = event.target as DisplayObject;
var bobby = Object(root).littlepicker.B1L_bnt.text;
if (clickedObject.name == 'frd_bnt1')
{
Object(root).BFFwho.buddy_txt.text = bobby;
Object(root).gotoAndPlay(15);
}
问题在于您声明了一个名为bobby
的变量。当您尝试设置buddy_txt
的文本时,您将其设置为文字String' bobby'而不是变量的值。