我的Apllication是在Flex 3.5中...我的代碼是在這裏,如何獲取textare的id值? Button.Mxml如何獲取id值從一個mxml文件到flex中的另一個mxml文件?
<mx:Button width="20" height="20" label="TextArea" id="textarea" click="setShape(DrawObject.TEXT);showTextArea()"/>
我的另一個文件是在這裏: Main.Mxml
private function doMouseDown_canvas():void
{
if(this.shapeStyle==DrawObject.TEXT)
{
if(isDrawing)
{
isDrawing = false;
this.d = drawFactory.makeDrawObject(this.shapeStyle,segment, this.drawColor, this.thickness, textarea.text);
dispatchEvent(new Event(BoardMediator.SEND_SHAPE));
textarea.visible = false;
}else
{
isDrawing = true;
x1 = canvas.mouseX;
y1 = canvas.mouseY;
segment.push(x1);
segment.push(y1);
textarea.text = "";
textarea.visible = true;
textarea.x = canvas.mouseX;
textarea.y = canvas.mouseY;
textarea.setFocus();
locateEditor();
}
}else
{
isDrawing = true;
x1 = canvas.mouseX;
y1 = canvas.mouseY;
segment.push(x1);
segment.push(y1);
canvas.rawChildren.addChild(feedback);
}
}
請注意讓問題更清楚嗎?我不知道你在問什麼。 –
不知道問題是什麼。 。 。 – Nate