<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Creating custom pop-up windows with the PopUpManager class (redux)</title>
	<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Sat, 30 Aug 2008 10:01:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14756</link>
		<author>peterd</author>
		<pubDate>Sun, 17 Aug 2008 07:05:45 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14756</guid>
		<description>Eric,

No problem. Sorry, after re-reading my reply, I worded it very poorly. I meant my solution was a little crude and I'm sure somebody on the FlexCoders list would have a more elegant solution.

Peter</description>
		<content:encoded><![CDATA[<p>Eric,</p>
<p>No problem. Sorry, after re-reading my reply, I worded it very poorly. I meant my solution was a little crude and I&#8217;m sure somebody on the FlexCoders list would have a more elegant solution.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14753</link>
		<author>Eric</author>
		<pubDate>Sun, 17 Aug 2008 03:14:50 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14753</guid>
		<description>I am sorry Peter, I didn't mean to offend anyone. I am very new to flex and I am not familiar with flexcoder list. Thanks a lot for your help anyway. Great blog.</description>
		<content:encoded><![CDATA[<p>I am sorry Peter, I didn&#8217;t mean to offend anyone. I am very new to flex and I am not familiar with flexcoder list. Thanks a lot for your help anyway. Great blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14750</link>
		<author>peterd</author>
		<pubDate>Sat, 16 Aug 2008 22:55:00 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14750</guid>
		<description>Eric,

This is a little crude, and you probably want to ask this question on the FlexCoders list, but you may be able to do what you want if you create a custom TitleWindow component and calculate the width/height yourself based on the Application's width/height multiplied by the desired percent width/height. Something like the following:

&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        showCloseButton="true"
        width="80%"
        percentHeight="80"
        creationComplete="titleWin_creationComplete(event);"
        close="titleWin_close(event);"&#62;

    &#60;mx:Script&#62;
        &#60;![CDATA[
            import mx.events.ResizeEvent;
            import mx.events.FlexEvent;
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;
            import mx.core.Application;

            private function titleWin_creationComplete(evt:FlexEvent):void {
                var titleWin:TitleWindow = evt.target as TitleWindow;
                var widthPct:uint = Application.application.width * titleWin.percentWidth / 100;
                var heightPct:uint = Application.application.height * titleWin.percentWidth / 100;

                titleWin.width = widthPct;
                titleWin.height = heightPct;
                PopUpManager.centerPopUp(titleWin);
            }

            private function titleWin_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }
        ]]&#62;
    &#60;/mx:Script&#62;

    &#60;mx:Label text="Lorem Ipsum" /&#62;

&#60;/mx:TitleWindow&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Eric,</p>
<p>This is a little crude, and you probably want to ask this question on the FlexCoders list, but you may be able to do what you want if you create a custom TitleWindow component and calculate the width/height yourself based on the Application&#8217;s width/height multiplied by the desired percent width/height. Something like the following:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        showCloseButton="true"
        width="80%"
        percentHeight="80"
        creationComplete="titleWin_creationComplete(event);"
        close="titleWin_close(event);"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ResizeEvent;
            import mx.events.FlexEvent;
            import mx.core.IFlexDisplayObject;
            import mx.events.CloseEvent;
            import mx.managers.PopUpManager;
            import mx.core.Application;

            private function titleWin_creationComplete(evt:FlexEvent):void {
                var titleWin:TitleWindow = evt.target as TitleWindow;
                var widthPct:uint = Application.application.width * titleWin.percentWidth / 100;
                var heightPct:uint = Application.application.height * titleWin.percentWidth / 100;

                titleWin.width = widthPct;
                titleWin.height = heightPct;
                PopUpManager.centerPopUp(titleWin);
            }

            private function titleWin_close(evt:CloseEvent):void {
                PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label text="Lorem Ipsum" /&gt;

&lt;/mx:TitleWindow&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiago</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14748</link>
		<author>Tiago</author>
		<pubDate>Sat, 16 Aug 2008 22:01:45 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14748</guid>
		<description>Thank you,

You are doing a great job!</description>
		<content:encoded><![CDATA[<p>Thank you,</p>
<p>You are doing a great job!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14742</link>
		<author>Eric</author>
		<pubDate>Sat, 16 Aug 2008 12:50:46 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-14742</guid>
		<description>Excellent tutorial as usual!

Just one question. If I change the width/height of the popup to percentwidth/percentheight, it doesn't work.  How do I set the size of the popup to, say, 80% of the parent?</description>
		<content:encoded><![CDATA[<p>Excellent tutorial as usual!</p>
<p>Just one question. If I change the width/height of the popup to percentwidth/percentheight, it doesn&#8217;t work.  How do I set the size of the popup to, say, 80% of the parent?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spif</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-13823</link>
		<author>spif</author>
		<pubDate>Mon, 30 Jun 2008 11:26:52 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-13823</guid>
		<description>'All works fine.' 

Thats not true, the example didnt works.What about this? 

var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;

here is error: undefined property dialog</description>
		<content:encoded><![CDATA[<p>&#8216;All works fine.&#8217; </p>
<p>Thats not true, the example didnt works.What about this? </p>
<p>var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;</p>
<p>here is error: undefined property dialog</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ralph</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-13381</link>
		<author>Ralph</author>
		<pubDate>Fri, 13 Jun 2008 16:53:57 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-13381</guid>
		<description>Could you make the popup re-sizable using the cursor?

Thanks</description>
		<content:encoded><![CDATA[<p>Could you make the popup re-sizable using the cursor?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivy</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-12756</link>
		<author>Ivy</author>
		<pubDate>Sun, 18 May 2008 14:42:28 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-12756</guid>
		<description>I want to do instead of info.txt in static I want dynamic that comes from database in text field.How????Anyone help me???</description>
		<content:encoded><![CDATA[<p>I want to do instead of info.txt in static I want dynamic that comes from database in text field.How????Anyone help me???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andres</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-12276</link>
		<author>Andres</author>
		<pubDate>Fri, 25 Apr 2008 03:32:58 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-12276</guid>
		<description>Hi,

I'm trying to apply the style of the titleWindow you used in your &lt;a href="http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/" rel="nofollow"&gt;"Creating a pop up TitleWindow using the PopUpButton control"&lt;/a&gt; example. However, when I use the PopUpManager class, the style isn't applied, it uses the default one like the one in this example, is there anything I can do?

Thanx in advance</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m trying to apply the style of the titleWindow you used in your <a href="http://blog.flexexamples.com/2008/04/13/creating-a-pop-up-titlewindow-using-the-popupbutton-control-in-flex/" rel="nofollow">&#8220;Creating a pop up TitleWindow using the PopUpButton control&#8221;</a> example. However, when I use the PopUpManager class, the style isn&#8217;t applied, it uses the default one like the one in this example, is there anything I can do?</p>
<p>Thanx in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-9030</link>
		<author>peterd</author>
		<pubDate>Sun, 30 Mar 2008 15:32:30 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2008/03/20/creating-custom-pop-up-windows-with-the-popupmanager-class-redux/#comment-9030</guid>
		<description>Gael,

How about this:
&lt;pre class="code"&gt;
&#60;mx:Script&#62;
    &#60;![CDATA[
        import mx.managers.PopUpManager;
        &lt;strong style="color:red;"&gt;import myComponents.Dialog;&lt;/strong&gt;

        private function launchMoreInfo():void {
            var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
            PopUpManager.centerPopUp(win);
        }
    ]]&#62;
&#60;/mx:Script&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Gael,</p>
<p>How about this:</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.managers.PopUpManager;
        <strong style="color:red;">import myComponents.Dialog;</strong>

        private function launchMoreInfo():void {
            var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
            PopUpManager.centerPopUp(win);
        }
    ]]&gt;
&lt;/mx:Script&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>
