Title: Re: [flexcoders] centerPopUp in ActionScript component
You cant call centerPopUp(this) in the constructor, but, I was able to call it on the creationComplete event from within my AS component. Here is an example that worked:
package {
import mx.controls.*;
import mx.containers.TitleWindow;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
public class myTitleWindow extends TitleWindow
{
public function myTitleWindow() : void
{
height=160;
width=180;
var btn1:Button = new Button();
btn1.label = button 1;
addChild(btn1);
addEventListener(creationComplete, _center);
}
public function _center(event:FlexEvent): void
{
PopUpManager.centerPopUp(this);
}
}
}
On 8/10/06 5:40 AM, dadrobson [EMAIL PROTECTED] wrote:
I wrote a component in ActionScript that is designed to be used as a
pop-up, and it needs to center itself. I tried invoking
PopUpManager.centerPopUp(this) from the constructor, and then I tried
it in the createChildren method, but the Flash player seemed to ignore
it both times. The pop-up kept appearing in the upper left corner of
the screen.
I don't have this problem with custom MXML components; I simply put
PopUpManager.centerPopUp(this) in the creationComplete event handler,
and it works fine.
Is there a way to successfully invoke PopUpManager.centerPopUp(this)
from inside an ActionScript component?
-Jim
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development
Computer software development
Software design and development
Macromedia flex
Software development best practice
YAHOO! GROUPS LINKS
Visit your group "flexcoders" on the web.
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___