if I set isPopUp to true and remove all the listners, I can't even drag and move the window.
with the old code, I can drag and move the window but can't drop it to the last position in dragging. what's wrong with that? thanks. --- In [email protected], claudiu ursica <the_bran...@...> wrote: > > in creation complete add this.isPopUp = true; > Make sure u get rid of all the listeners ... > C > > > > > ________________________________ > From: xmwang1982 <ask...@...> > To: [email protected] > Sent: Fri, March 5, 2010 4:30:30 PM > Subject: [flexcoders] Can't move titlewindow in an Application > > > Hi experts, > > I have a class inheriting TitleWindow, and I add the following code to enable > drag/drop of the title window by press on the title bar: > > private function onCreationComplete( evt:Event) :void > { > this.titleBar. addEventListener (MouseEvent. MOUSE_DOWN, startDragWin) ; > this.titleBar. addEventListener (MouseEvent. MOUSE_UP, stopDragWin) ; > this.titleBar. addEventListener (MouseEvent. MOUSE_OUT, stopDragWin) ; > this.addEventListen er(DragEvent. DRAG_DROP, moveSelf); > } > > private function moveSelf(evt: DragEvent) :void > { > this.x = evt.stageX; > this.y = evt.stageY; > } > > private function startDragWin( evt:MouseEvent) :void > { > > > this.startDrag( ); > } > > > > private function stopDragWin( evt:MouseEvent) :void > { > > this.stopDrag( ); > } > > I added the object as the top level child of an application. However the > settings of x and y are not working. The window is not moved. > > I have been confused for long. Any possible reason? > > Layout of application is: layout="absolute" > > The following attributes were set for the title window in the MXML of the > application > > <MyTitleWindow backgroundAlpha= "0.5" bottom="10" right="10" width="400" > height="300" ...> > > I guess these initial settings don't matter at all. > > Please suggest. Thanks in advance. >

