FLEX action script 高手请进

来源:百度知道 编辑:UC知道 时间:2024/06/14 11:08:22
我想问一下,如果我想在在flex builder中用action script 改变textinput控件的大小,该如何写程序?就是程序运行中可以用鼠标随意控制扩大或者缩小textinput或者是button这样的控件。 答案希望是高手自己写的程序,不是google上随意搜索粘贴过来的。另外想和有flex编程经验的朋友交个朋友,最近在学习这个,遇见很多困难,想请教。谢谢指教。

一个很粗糙的小例子,有待完善.见笑

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" mouseUp="{domouseup(event);}">
<mx:Script>
<![CDATA[
import mx.controls.Button;
private var bx:int;
private var by:int;

private function domousedown(e:MouseEvent):void{
if(e.buttonDown){
bx=t.x;
by=t.y;

}
}
private function domouseup(e:MouseEvent):void{
t.width=t.x+e.localX;
t.height=t.y+e.localY;

}

]]>
</mx:Script>
<mx:Button id="t" label="down" x="10" y="10"
mouseDown="{domousedown(event);}" mouseUp="{domouseup(event);}"/>