try it: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="100%" width="100%">
<mx:Script> <![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent): void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = "Example"; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = "This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox."; popup.addChild(tf); PopUpManager.addPopUp(popup, DisplayObject(Application.application), false); //I think "this" instead of DisplayObject(Application.application) will work too. } ]]> </mx:Script> <mx:HBox width="100%" height="2000" id="hbox"> <mx:Button label="Click Me" click="clickeroo(event)"/> </mx:HBox> </mx:Application> João Augusto Zaratine blog.joaoaugusto.com.br (in portuguese) 2010/4/9 turbo_vb <timh...@aol.com> > > > You'll want to create a method that does something like this: > > var target:Point = localToGlobal( new Point( hbox.x, hbox.y ) ); > popup.move( target.x, target.y ); > > Call the method after you add the popup and when the container is scrolled. > In some cases localToContent is more appropriate. > > -TH > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, > "s_grollins" <s.groll...@...> wrote: > > > > Hi all, > > > > I'm trying to work out a specific problem I'm having with positioning in > Flex using the PopUpManager. Basically I'm wanting to create a popup which > will scroll with the parent container - this is necessary because the parent > container is large and if the user's browser window isn't large enough (this > will be the case the majority of the time) - they will have to use the > scrollbar of the container to scroll down. The problem is that the popup is > positioned relative to another component, and it needs to stay by that > component. (also sorry if the code below isn't formatted right, but I pasted > it right from Eclipse). > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > > > > <mx:Script> > > <![CDATA[ > > import mx.core.UITextField; > > import mx.containers.TitleWindow; > > import mx.managers.PopUpManager; > > > > private function clickeroo(event:MouseEvent):void { > > var popup:TitleWindow = new TitleWindow(); > > popup.width = 250; > > popup.height = 300; > > > > popup.title = "Example"; > > var tf:UITextField = new UITextField(); > > tf.wordWrap = true; > > tf.width = popup.width - 30; > > tf.text = "This window stays put and doesn't scroll when the hbox is > scrolled (even with using the hbox as parent in the addPopUp method), I need > the popup to be local to the HBox."; > > popup.addChild(tf); > > > > PopUpManager.addPopUp(popup, hbox, false); > > } > > ]]> > > </mx:Script> > > > > <mx:HBox width="100%" height="2000" id="hbox"> > > <mx:Button label="Click Me" click="clickeroo(event)"/> > > </mx:HBox> > > > > </mx:Application> > > > > > -- João Augusto Zaratine blog.joaoaugusto.com.br