我正在使用Flex組件,可以使用右側和左側的手柄調整大小(即,如果單擊並拖動左側,組件將向左增大,如果單擊並拖動右側,它會增長到右邊)。從左側調整Flex/Flash對象的大小?
現在我使用:
var oldX:Number = this.x;
this.x = event.stageX + (initial.x - initial.stageX); // Move the left edge to the left
this.width += oldX - this.x; // Increase the width to compensate for the move to the left
但是,這使得周圍的右側跳,一般長相醜陋。
什麼是「正確」做到這一點?有沒有根本的我犯錯了?
謝謝!
編輯:抖動發生在組件的右側。當我設置this.x
時,組件向左移動,屏幕重新繪製,寬度更新,屏幕再次重繪。
我正在監聽`stage`上的鼠標事件,所以它不是組件在鼠標下移動的問題。 – 2009-05-22 22:25:30
我更新了問題 - 請參閱**編輯**。 – 2009-05-22 22:25:49