<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Globally setting modal styles in a Flex application</title>
	<atom:link href="http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:35:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Martin</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1554</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Fri, 15 May 2009 18:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1554</guid>
		<description>Hi Peter,

Thanks for this tip.  The obvious is just sometimes too obvious ;).

Martin</description>
		<content:encoded><![CDATA[<p>Hi Peter,</p>
<p>Thanks for this tip.  The obvious is just sometimes too obvious ;).</p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1551</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Fri, 15 May 2009 06:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1551</guid>
		<description>Martin,

You could probably try calling titleWindow_close() when the Alert is closed. In the ContactForm component, try something like the following:

&lt;pre class=&quot;code&quot;&gt;
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.controls.Alert;
        import mx.managers.PopUpManager;

        private function titleWindow_close():void {
            PopUpManager.removePopUp(this);
        }

        private function titleWindow_creationComplete():void {
            PopUpManager.centerPopUp(this);
        }

        private function sendButton_click():void {
            Alert.show(&quot;Thanks for the feedback&quot;, &quot;title&quot;, Alert.OK, null, alert_close);
        }

        private function alert_close(evt:Event):void {
            titleWindow_close();
        }
    ]]&gt;
&lt;/mx:Script&gt;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Martin,</p>
<p>You could probably try calling titleWindow_close() when the Alert is closed. In the ContactForm component, try something like the following:</p>
<pre class="code">
&lt;mx:Script&gt;
    &lt;![CDATA[
        import mx.controls.Alert;
        import mx.managers.PopUpManager;

        private function titleWindow_close():void {
            PopUpManager.removePopUp(this);
        }

        private function titleWindow_creationComplete():void {
            PopUpManager.centerPopUp(this);
        }

        private function sendButton_click():void {
            Alert.show("Thanks for the feedback", "title", Alert.OK, null, alert_close);
        }

        private function alert_close(evt:Event):void {
            titleWindow_close();
        }
    ]]&gt;
&lt;/mx:Script&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1557</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Thu, 14 May 2009 20:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1557</guid>
		<description>Hi,

In the example code, the lines:
  Alert.show(&quot;Thanks for the feedback&quot;);
  titleWindow_close();

The form actually closes before the Alert box appears, which makes for a choppy transition.  It would be good if the form still shows in background.  Then, when user clicks &quot;Okay&quot; in Alert box, they both close together.

Obviously this is a problem with Alert being async.  Is there a way around this?

Thank you in advance.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>In the example code, the lines:<br />
  Alert.show(&#8220;Thanks for the feedback&#8221;);<br />
  titleWindow_close();</p>
<p>The form actually closes before the Alert box appears, which makes for a choppy transition.  It would be good if the form still shows in background.  Then, when user clicks &#8220;Okay&#8221; in Alert box, they both close together.</p>
<p>Obviously this is a problem with Alert being async.  Is there a way around this?</p>
<p>Thank you in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cato</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1555</link>
		<dc:creator>Cato</dc:creator>
		<pubDate>Wed, 29 Apr 2009 10:23:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1555</guid>
		<description>Hi Atakan if you grab the modalWindow like I have you can set the x and y on the FlexSprite!and move it down</description>
		<content:encoded><![CDATA[<p>Hi Atakan if you grab the modalWindow like I have you can set the x and y on the FlexSprite!and move it down</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cato</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1553</link>
		<dc:creator>Cato</dc:creator>
		<pubDate>Sun, 26 Apr 2009 14:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1553</guid>
		<description>I did som poking in the frameWork.... here you can change the color in modal state. have fun with it trow in a timer and you can make a panick modal hehe..

&quot;&lt;&quot;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&quot;&gt;&quot;
&quot;&lt;&quot;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&quot;&gt;&quot;

    &quot;&lt;&quot;mx:Style&quot;&gt;&quot;
        global {
            modalTransparencyBlur: 0;
            modalTransparency: 0.8;
            modalTransparencyColor: black;
            modalTransparencyDuration: 500;
        }
    &quot;&lt;&quot;/mx:Style&quot;&gt;&quot;

    &quot;&lt;&quot;mx:Script&quot;&gt;&quot;
        &quot;&lt;&quot;![CDATA[
        	import mx.core.FlexSprite;
        	import mx.utils.ObjectUtil;
        	import mx.managers.SystemManager;
        	import mx.events.StyleEvent;
        	import mx.controls.Button;
        	import mx.managers.PopUpManager;
        	import mx.events.CloseEvent;
        	import mx.containers.TitleWindow;
            import mx.controls.Alert;
            import mx.styles.StyleManager;

            private function showAlert():void {
                Alert.show(&quot;hello&quot;, &quot;world&quot;);
            }


            private var popUp:TitleWindow = null;

			private function opnePopUp():void
			{
					popUp = new TitleWindow();
					popUp.showCloseButton = true;
					popUp.width = 100;
					popUp.height = 100;
					popUp.title = &#039;test popup&#039;;

					var but:Button = new Button();
						but.label = &quot;red&quot;;
						but.addEventListener(MouseEvent.CLICK, setModelTransparencyColorStyleOnOpenPopUp);
						popUp.addChild(but);


					PopUpManager.addPopUp(popUp,this,true);
					PopUpManager.centerPopUp(popUp);

					popUp.addEventListener(CloseEvent.CLOSE, onPopUpClose);

			}

			private function onPopUpClose(event:CloseEvent):void
			{
				PopUpManager.removePopUp(popUp);
			}




            private function setModelTransparencyColorStyleOnOpenPopUp(event:MouseEvent):void {
               var obj:FlexSprite = systemManager.getChildByName(&quot;modalWindow&quot;) as FlexSprite;
               var colorInfo:ColorTransform = obj.transform.colorTransform;
               		colorInfo.color = 0xFF0000;
               		 obj.transform.colorTransform = colorInfo;
            }



            private function setModelTransparencyColorStyle(color:Object):void {
                StyleManager.getStyleDeclaration(&quot;global&quot;).setStyle(&quot;modalTransparencyColor&quot;, color);
                opnePopUp();
            }
        ]]&quot;&gt;&quot;
    &quot;&lt;&quot;/mx:Script&quot;&gt;&quot;

    &quot;&lt;&quot;mx:ApplicationControlBar dock=&quot;true&quot;&quot;&gt;&quot;

        &quot;&lt;&quot;mx:Button label=&quot;red&quot;
                fillColors=&quot;[0xFF0000,0xFF0000]&quot;
                click=&quot;setModelTransparencyColorStyle(0xFF0000);&quot; /&quot;&gt;&quot;
        &quot;&lt;&quot;mx:Button label=&quot;haloGreen&quot;
                fillColors=&quot;[haloGreen,haloGreen]&quot;
                click=&quot;setModelTransparencyColorStyle(&#039;haloGreen&#039;);&quot; /&quot;&gt;&quot;
        &quot;&lt;&quot;mx:Button label=&quot;haloBlue&quot;
                fillColors=&quot;[haloBlue,haloBlue]&quot;
                click=&quot;setModelTransparencyColorStyle(&#039;haloBlue&#039;);&quot; /&quot;&gt;&quot;
        &quot;&lt;&quot;mx:Button label=&quot;haloSilver&quot;
                fillColors=&quot;[haloSilver,haloSilver]&quot;
                click=&quot;setModelTransparencyColorStyle(&#039;haloSilver&#039;);&quot; /&quot;&gt;&quot;
    &quot;&lt;&quot;/mx:ApplicationControlBar&quot;&gt;&quot;

&quot;&lt;&quot;/mx:Application&quot;&gt;&quot;</description>
		<content:encoded><![CDATA[<p>I did som poking in the frameWork&#8230;. here you can change the color in modal state. have fun with it trow in a timer and you can make a panick modal hehe..</p>
<p>&#8220;&lt;&#8221;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&#8221;&gt;&#8221;<br />
&#8220;&lt;&#8221;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221;<br />
        layout=&#8221;vertical&#8221;<br />
        verticalAlign=&#8221;middle&#8221;<br />
        backgroundColor=&#8221;white&#8221;"&gt;&#8221;</p>
<p>    &#8220;&lt;&#8221;mx:Style&#8221;&gt;&#8221;<br />
        global {<br />
            modalTransparencyBlur: 0;<br />
            modalTransparency: 0.8;<br />
            modalTransparencyColor: black;<br />
            modalTransparencyDuration: 500;<br />
        }<br />
    &#8220;&lt;&#8221;/mx:Style&#8221;&gt;&#8221;</p>
<p>    &#8220;&lt;&#8221;mx:Script&#8221;&gt;&#8221;<br />
        &#8220;&lt;&#8221;![CDATA[<br />
        	import mx.core.FlexSprite;<br />
        	import mx.utils.ObjectUtil;<br />
        	import mx.managers.SystemManager;<br />
        	import mx.events.StyleEvent;<br />
        	import mx.controls.Button;<br />
        	import mx.managers.PopUpManager;<br />
        	import mx.events.CloseEvent;<br />
        	import mx.containers.TitleWindow;<br />
            import mx.controls.Alert;<br />
            import mx.styles.StyleManager;</p>
<p>            private function showAlert():void {<br />
                Alert.show("hello", "world");<br />
            }</p>
<p>            private var popUp:TitleWindow = null;</p>
<p>			private function opnePopUp():void<br />
			{<br />
					popUp = new TitleWindow();<br />
					popUp.showCloseButton = true;<br />
					popUp.width = 100;<br />
					popUp.height = 100;<br />
					popUp.title = 'test popup';</p>
<p>					var but:Button = new Button();<br />
						but.label = "red";<br />
						but.addEventListener(MouseEvent.CLICK, setModelTransparencyColorStyleOnOpenPopUp);<br />
						popUp.addChild(but);</p>
<p>					PopUpManager.addPopUp(popUp,this,true);<br />
					PopUpManager.centerPopUp(popUp);</p>
<p>					popUp.addEventListener(CloseEvent.CLOSE, onPopUpClose);</p>
<p>			}</p>
<p>			private function onPopUpClose(event:CloseEvent):void<br />
			{<br />
				PopUpManager.removePopUp(popUp);<br />
			}</p>
<p>            private function setModelTransparencyColorStyleOnOpenPopUp(event:MouseEvent):void {<br />
               var obj:FlexSprite = systemManager.getChildByName("modalWindow") as FlexSprite;<br />
               var colorInfo:ColorTransform = obj.transform.colorTransform;<br />
               		colorInfo.color = 0xFF0000;<br />
               		 obj.transform.colorTransform = colorInfo;<br />
            }</p>
<p>            private function setModelTransparencyColorStyle(color:Object):void {<br />
                StyleManager.getStyleDeclaration("global").setStyle("modalTransparencyColor", color);<br />
                opnePopUp();<br />
            }<br />
        ]]&#8221;&gt;&#8221;<br />
    &#8220;&lt;&#8221;/mx:Script&#8221;&gt;&#8221;</p>
<p>    &#8220;&lt;&#8221;mx:ApplicationControlBar dock=&#8221;true&#8221;"&gt;&#8221;</p>
<p>        &#8220;&lt;&#8221;mx:Button label=&#8221;red&#8221;<br />
                fillColors=&#8221;[0xFF0000,0xFF0000]&#8221;<br />
                click=&#8221;setModelTransparencyColorStyle(0xFF0000);&#8221; /&#8221;&gt;&#8221;<br />
        &#8220;&lt;&#8221;mx:Button label=&#8221;haloGreen&#8221;<br />
                fillColors=&#8221;[haloGreen,haloGreen]&#8221;<br />
                click=&#8221;setModelTransparencyColorStyle(&#8216;haloGreen&#8217;);&#8221; /&#8221;&gt;&#8221;<br />
        &#8220;&lt;&#8221;mx:Button label=&#8221;haloBlue&#8221;<br />
                fillColors=&#8221;[haloBlue,haloBlue]&#8221;<br />
                click=&#8221;setModelTransparencyColorStyle(&#8216;haloBlue&#8217;);&#8221; /&#8221;&gt;&#8221;<br />
        &#8220;&lt;&#8221;mx:Button label=&#8221;haloSilver&#8221;<br />
                fillColors=&#8221;[haloSilver,haloSilver]&#8221;<br />
                click=&#8221;setModelTransparencyColorStyle(&#8216;haloSilver&#8217;);&#8221; /&#8221;&gt;&#8221;<br />
    &#8220;&lt;&#8221;/mx:ApplicationControlBar&#8221;&gt;&#8221;</p>
<p>&#8220;&lt;&#8221;/mx:Application&#8221;&gt;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cato</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1552</link>
		<dc:creator>Cato</dc:creator>
		<pubDate>Sun, 26 Apr 2009 11:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1552</guid>
		<description>Hi Peter, first off all this is a Great Site :)
I have a question on this modal stuff:
The user have a popup that already have a modal state, everytingh is ok, but then the user do something fatal and I want to use a red modalTransparencyColor, I have tryed to alter the modalTransparencyColor but it seams it&#039;s not updating to the red color. But changes after the popup is closed and reopend..</description>
		<content:encoded><![CDATA[<p>Hi Peter, first off all this is a Great Site :)<br />
I have a question on this modal stuff:<br />
The user have a popup that already have a modal state, everytingh is ok, but then the user do something fatal and I want to use a red modalTransparencyColor, I have tryed to alter the modalTransparencyColor but it seams it&#8217;s not updating to the red color. But changes after the popup is closed and reopend..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atakan</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1556</link>
		<dc:creator>Atakan</dc:creator>
		<pubDate>Tue, 03 Mar 2009 16:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1556</guid>
		<description>Hi,

is it possible to use modal-transparency-color for just a specific part of application? i mean think about the second example here...when we click on a button alert(or pop-up) will appear with it&#039;s background but panel with buttons will stay untouched.

thanks,
Atakan</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>is it possible to use modal-transparency-color for just a specific part of application? i mean think about the second example here&#8230;when we click on a button alert(or pop-up) will appear with it&#8217;s background but panel with buttons will stay untouched.</p>
<p>thanks,<br />
Atakan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bp</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1560</link>
		<dc:creator>bp</dc:creator>
		<pubDate>Mon, 04 Aug 2008 00:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1560</guid>
		<description>peter - great stuff thanks for all the posts.

Wondering if you know of any way to control the area of the blur/dim behind a modal.

I have an air app which has custom window border styles which are irregular.  SO the app looks nice overlaid on other apps, that is until a modal creates the dim in its standard rectangular shape which extends beyond my window borders in some areas.

Any ideas?

Thanks! --bp</description>
		<content:encoded><![CDATA[<p>peter &#8211; great stuff thanks for all the posts.</p>
<p>Wondering if you know of any way to control the area of the blur/dim behind a modal.</p>
<p>I have an air app which has custom window border styles which are irregular.  SO the app looks nice overlaid on other apps, that is until a modal creates the dim in its standard rectangular shape which extends beyond my window borders in some areas.</p>
<p>Any ideas?</p>
<p>Thanks! &#8211;bp</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1559</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Mon, 28 Jul 2008 21:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1559</guid>
		<description>Nate,

Good catch! I filed a bug in the public Flex bugbase at http://bugs.adobe.com/jira/browse/SDK-16248 . To get around the issue, it looks like you can set the &lt;code&gt;modalTransparencyDuration&lt;/code&gt; style to 1 millisecond.

Thanks,
Peter</description>
		<content:encoded><![CDATA[<p>Nate,</p>
<p>Good catch! I filed a bug in the public Flex bugbase at <a href="http://bugs.adobe.com/jira/browse/SDK-16248" rel="nofollow">http://bugs.adobe.com/jira/browse/SDK-16248</a> . To get around the issue, it looks like you can set the <code>modalTransparencyDuration</code> style to 1 millisecond.</p>
<p>Thanks,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nate</title>
		<link>http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/comment-page-1/#comment-1558</link>
		<dc:creator>Nate</dc:creator>
		<pubDate>Mon, 28 Jul 2008 20:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/globally-setting-modal-styles-in-a-flex-application/#comment-1558</guid>
		<description>Maybe it&#039;s just me, but I noticed that setting &quot;modaleTransparencyDuration: 0;&quot; seems to set modalTransparencyBlur to 0.  Is anyone else observing this?</description>
		<content:encoded><![CDATA[<p>Maybe it&#8217;s just me, but I noticed that setting &#8220;modaleTransparencyDuration: 0;&#8221; seems to set modalTransparencyBlur to 0.  Is anyone else observing this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
