<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GhostWire Studios &#187; Window</title>
	<atom:link href="http://www.ghostwire.com/blog/archives/tag/window/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghostwire.com/blog</link>
	<description>Flash UI Components</description>
	<lastBuildDate>Tue, 23 Aug 2011 03:51:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>uiWindow: Background Drop Shadow + Glow Effect</title>
		<link>http://www.ghostwire.com/blog/archives/uiwindow-background-drop-shadow-glow-effect/</link>
		<comments>http://www.ghostwire.com/blog/archives/uiwindow-background-drop-shadow-glow-effect/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 16:02:47 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Filters]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://www.ghostwire.com/blog/?p=1600</guid>
		<description><![CDATA[The default behavior of the uiWindow container is to cast a drop shadow when it is active in the foreground, and not do so when it is inactive or when it is maximized to fill the stage. This behavior is determined by the component instance&#8217;s background property value. Default Shadow The following is the default [...]]]></description>
			<content:encoded><![CDATA[<p>The default behavior of the <a href="http://www.ghostwire.com/aspireui/docs/usage/uiwindow">uiWindow</a> container is to cast a drop shadow when it is active in the foreground, and not do so when it is inactive or when it is maximized to fill the stage.  This behavior is determined by the component instance&#8217;s <code>background</code> property value.</p>
<p><span id="more-1600"></span><br />
<strong>Default Shadow</strong><br />
The following is the default <code>background</code> property value for all <code>uiWindow</code> instances:<br />
<code>{shadow_up:0x000000, shadow_up_maximized:-1};</code><br />
That tells the instance it should render a drop shadow of color 0&#215;000000 when its visual state is &#8220;up&#8221;, and not render any drop shadow when its visual state is &#8220;up_maximized&#8221; (when it is maximized, the drop shadow cannot be seen so applying the effect will be pointless).</p>
<p><img src="http://www.ghostwire.com/blog/wp-content/uploads/winxp.png" alt="winxp" title="winxp" width="480" height="416" class="alignleft size-full wp-image-1608" /></p>
<p><!-- --><br />
<strong>Always Cast Drop Shadow</strong><br />
To make a <code>uiWindow</code> instance <em>always</em> cast a drop shadow, you can set its background property as below:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> win:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
win.<span style="color: #0066CC;">background</span> = <span style="color: #66cc66;">&#123;</span>shadow:0x000000<span style="color: #66cc66;">&#125;</span>;</pre></div></div>

<p><img src="http://www.ghostwire.com/blog/wp-content/uploads/winxp_always.png" alt="winxp_always" title="winxp_always" width="480" height="416" class="alignleft size-full wp-image-1610" /></p>
<p><!-- --><br />
<strong>Never Cast Drop Shadow</strong><br />
To make a <code>uiWindow</code> instance <em>never</em> cast a drop shadow, you can set its background property to <code>null</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> win:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
win.<span style="color: #0066CC;">background</span> = <span style="color: #000000; font-weight: bold;">null</span>;</pre></div></div>

<p><img src="http://www.ghostwire.com/blog/wp-content/uploads/winxp_none.png" alt="winxp_none" title="winxp_none" width="480" height="416" class="alignleft size-full wp-image-1611" /></p>
<p><!-- --><br />
<strong>Glow Effect</strong><br />
As of v1.3.0+, you can also get the <code>uiWindow</code> instance (any <code>uiComponent</code>, actually) to cast a glow effect:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> win:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
win.<span style="color: #0066CC;">background</span> = <span style="color: #66cc66;">&#123;</span>glow_up:0x000000, glow_up_maximized:-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>;</pre></div></div>

<p><img src="http://www.ghostwire.com/blog/wp-content/uploads/wingraylic_glow.png" alt="wingraylic_glow" title="wingraylic_glow" width="480" height="416" class="alignleft size-full wp-image-1616" /></p>
<p><!-- --><br />
<strong>Drop Shadow + Glow</strong><br />
In the &#8220;vista&#8221; theme, the <code>uiWindow</code> instances use drop shadow + glow effects:<br />
<img src="http://www.ghostwire.com/blog/wp-content/uploads/winvista.png" alt="winvista" title="winvista" width="480" height="416" class="alignleft size-full wp-image-1609" /></p>
<p>See: <a href="http://www.ghostwire.com/blog/archives/aspire-ui-components-theme-vista-released/">&#8220;vista&#8221; themed uiWindow demo</a></p>
<p><!-- --><br />
<strong>Specifying Default uiWindow Background Property</strong><br />
If you wish to override the default background property value, ie set the default value for all <code>uiWindow</code> instances, you can do so by defining it in the theme folder&#8217;s &#8220;rules.xml&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Window</span> <span style="color: #000066;">edge</span>=<span style="color: #ff0000;">&quot;5,5,5&quot;</span> <span style="color: #000066;">slices</span>=<span style="color: #ff0000;">&quot;up,out,up_maximized,out_maximized&quot;</span> <span style="color: #000066;">prefs</span>=<span style="color: #ff0000;">&quot;padding|5|background|shadow_up,0,shadow_up_maximized,-1,glow,0,glowDepth,12,glow_up_maximized,-1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework.</p>
<p>You may experiment with the various features by <a href="/aspireui/download/">downloading the trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uiwindow-background-drop-shadow-glow-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aspire UI Components Theme &#8220;vista&#8221; Released</title>
		<link>http://www.ghostwire.com/blog/archives/aspire-ui-components-theme-vista-released/</link>
		<comments>http://www.ghostwire.com/blog/archives/aspire-ui-components-theme-vista-released/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 13:18:59 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Skinning]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://www.ghostwire.com/blog/?p=1515</guid>
		<description><![CDATA[A new bonus theme, emulating the look of Windows Vista OS, has been added to the Aspire UI components library. Below is a live demo (click on the three buttons to bring up windows): 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_VistaThemeDemo_954141518"
			class="flashmovie"
			width="640"
			height="480">
	<param name="movie" value="/aspireui/swf/VistaThemeDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/VistaThemeDemo.swf"
			name="fm_VistaThemeDemo_954141518"
			width="640"
			height="480">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> The SWF above is approximately 84KB (the theme assets are embedded in the SWF). [...]]]></description>
			<content:encoded><![CDATA[<p>A new bonus theme, emulating the look of Windows Vista OS, has been added to the <a href="http://ghostwire.com/aspireui/">Aspire UI</a> components library. Below is a live demo (click on the three buttons to bring up windows):</p>
<p><span id="more-1515"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_VistaThemeDemo_999654026"
			class="flashmovie"
			width="640"
			height="480">
	<param name="movie" value="/aspireui/swf/VistaThemeDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/VistaThemeDemo.swf"
			name="fm_VistaThemeDemo_999654026"
			width="640"
			height="480">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The SWF above is approximately 84KB (the theme assets are embedded in the SWF).</p>
<p><!-- --><br />
<strong>Availability</strong><br />
The new theme has been included in the distributions for both Aspire UI Lite Edition and Aspire UI Standard Edition (v1.3.3).</p>
<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework.</p>
<p>You may experiment with the various features by <a href="/aspireui/download/">downloading the trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/aspire-ui-components-theme-vista-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uiDialog: Displaying Custom Dialog Content</title>
		<link>http://www.ghostwire.com/blog/archives/uidialog-displaying-custom-dialog-content/</link>
		<comments>http://www.ghostwire.com/blog/archives/uidialog-displaying-custom-dialog-content/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 07:38:53 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://www.ghostwire.com/blog/?p=943</guid>
		<description><![CDATA[A modal window is a window that must be dismissed before interaction with the other parts of the application can be resumed. This is usually used to draw attention to a certain task at hand. The uiDialog class helps to display simple modal windows. There are three types of built-in dialogs you can call up [...]]]></description>
			<content:encoded><![CDATA[<p>A modal window is a window that must be dismissed before interaction with the other parts of the application can be resumed.  This is usually used to draw attention to a certain task at hand.</p>
<p>The <a href="/aspireui/docs/usage/uidialog">uiDialog</a> class helps to display simple modal windows.  There are three types of built-in dialogs you can call up using the <code>show()</code> method of the class.</p>
<p><span id="more-943"></span>The <code>show()</code> method has the following signature:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span>textString, titleString, iconString, buttonsArray, promptBoolean, customSprite<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><!-- --><br />
<strong>Alert Dialog</strong><br />
This is used to show a simple pop-up message that end-users must acknowledge by clicking a button:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;This is a simple Alert Dialog.&quot;</span>,<span style="color: #ff0000;">&quot;Warning!&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// show(messageString,titleString);</span></pre></div></div>

<p><img alt="" src="http://www.ghostwire.com/aspireui/docs/_media/usage/uidialog0.png" class="alignnone" width="250" height="155" /></p>
<p><!--more--><br />
<strong>Confirmation Dialog</strong><br />
This is used to ask a question that the end-user must answer by selecting (clicking) a button (from two or more buttons):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Save changes to document?&quot;</span>,<span style="color: #ff0000;">&quot;Proceed?&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Yes&quot;</span>,<span style="color: #ff0000;">&quot;No&quot;</span>,<span style="color: #ff0000;">&quot;Cancel&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// show(messageString,titleString,iconString,buttonsString);</span></pre></div></div>

<p><img alt="" src="http://www.ghostwire.com/aspireui/docs/_media/usage/uidialog1.png" class="alignnone" width="250" height="155" /></p>
<p><!--more--><br />
<strong>Prompt Dialog</strong><br />
This is used to collect simple text input from the end-user:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Please enter your name:&quot;</span>,<span style="color: #ff0000;">&quot;Full Name&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// show(messageString,titleString,iconString,buttonsArray,promptBoolean);</span></pre></div></div>

<p><img alt="" src="http://www.ghostwire.com/aspireui/docs/_media/usage/uidialog2.png" class="alignnone" width="300" height="170" /></p>
<p><!--more--><br />
<strong>Custom Dialog</strong><br />
To facilitate the display of more complex dialogs, the <code>show()</code> method accepts a sixth parameter <code>custom</code> &#8211; a reference to a <code>Sprite</code> instance.  This means that you can create whatever custom dialog content that you require and feed it to the <code>show()</code> method as the <code>custom</code> parameter.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> customContent:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> customDialog:uiDialog = <span style="color: #000000; font-weight: bold;">new</span> uiDialog<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
customDialog.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #ff0000;">&quot;Title&quot;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;ButtonOne&quot;</span>, <span style="color: #ff0000;">&quot;ButtonTwo&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #000000; font-weight: bold;">false</span>, customContent<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><!--more--><br />
<strong>Custom Dialog &#8211; Live Demo</strong><br />
The following is a live demo:<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_CustomDialogDemo_126887004"
			class="flashmovie"
			width="500"
			height="300">
	<param name="movie" value="/aspireui/swf/CustomDialogDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/CustomDialogDemo.swf"
			name="fm_CustomDialogDemo_126887004"
			width="500"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><!--more--><br />
<strong>CustomDialogDemo Class</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// ActionScript 3.0</span>
package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiFrame</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiGrid</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiPane</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiWindow</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiDialog</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiText</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiTextInput</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiLabelButton</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">enums</span>.<span style="color: #0066CC;">ALIGN</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiSkins</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CustomDialogDemo <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> CustomDialogDemo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** make sure stage is not null **</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">else</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span>evt:Event = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** let assets preload before starting application **</span>
			uiSkins.<span style="color: #006600;">manager</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>,main<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// ** instances **</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> responseTxt:uiText;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> userInput:uiTextInput;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> passInput:uiTextInput;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** main application code **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** initializes uiWindow class **</span>
			uiWindow.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** topLevelPane **</span>
			<span style="color: #000000; font-weight: bold;">var</span> topLevelPane:uiPane = <span style="color: #000000; font-weight: bold;">new</span> uiPane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			topLevelPane.<span style="color: #006600;">padding</span>	= <span style="color: #cc66cc;">8</span>;
			topLevelPane.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>,<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span><span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>topLevelPane<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">button</span>:uiLabelButton	= <span style="color: #000000; font-weight: bold;">new</span> uiLabelButton<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Open Custom Dialog&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">button</span>.<span style="color: #006600;">alignX</span>			= <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">CENTER</span>;
			<span style="color: #0066CC;">button</span>.<span style="color: #006600;">alignY</span>			= <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">BOTTOM</span>;
			<span style="color: #0066CC;">button</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,on_btnClick,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			topLevelPane.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">button</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			responseTxt = <span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			topLevelPane.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>responseTxt<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">// ** end topLevelPane **</span>
&nbsp;
			on_btnClick<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_btnClick<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> userLabel:uiText		= <span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Username:&quot;</span><span style="color: #66cc66;">&#41;</span>;
			userLabel.<span style="color: #006600;">alignY</span>		= <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">CENTER</span>;
&nbsp;
			userInput			= <span style="color: #000000; font-weight: bold;">new</span> uiTextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			userInput.<span style="color: #006600;">fillX</span>			= <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> passLabel:uiText		= <span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Password:&quot;</span><span style="color: #66cc66;">&#41;</span>;
			passLabel.<span style="color: #006600;">alignY</span>		= <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">CENTER</span>;
&nbsp;
			passInput			= <span style="color: #000000; font-weight: bold;">new</span> uiTextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			passInput.<span style="color: #006600;">displayAsPassword</span>	= <span style="color: #000000; font-weight: bold;">true</span>;
			passInput.<span style="color: #0066CC;">restrict</span>		= <span style="color: #ff0000;">&quot;0-9a-zA-Z&quot;</span>;
			passInput.<span style="color: #006600;">fillX</span>			= <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> loginGrid:uiGrid		= <span style="color: #000000; font-weight: bold;">new</span> uiGrid<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			loginGrid.<span style="color: #006600;">columns</span>		= <span style="color: #cc66cc;">2</span>;
			loginGrid.<span style="color: #006600;">spacingH</span>		= <span style="color: #cc66cc;">4</span>;
			loginGrid.<span style="color: #006600;">spacingV</span>		= <span style="color: #cc66cc;">8</span>;
			loginGrid.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>userLabel<span style="color: #66cc66;">&#41;</span>;
			loginGrid.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>userInput<span style="color: #66cc66;">&#41;</span>;
			loginGrid.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>passLabel<span style="color: #66cc66;">&#41;</span>;
			loginGrid.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>passInput<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> loginFrm:uiFrame		= <span style="color: #000000; font-weight: bold;">new</span> uiFrame<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			loginFrm.<span style="color: #006600;">title</span>			= <span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Account&quot;</span><span style="color: #66cc66;">&#41;</span>;
			loginFrm.<span style="color: #006600;">content</span>		= loginGrid;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> loginDialog:uiDialog = <span style="color: #000000; font-weight: bold;">new</span> uiDialog<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			loginDialog.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_loginDialogClose, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			loginDialog.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #ff0000;">&quot;User Login&quot;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;OK&quot;</span>, <span style="color: #ff0000;">&quot;Cancel&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #000000; font-weight: bold;">false</span>, loginFrm<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">// show(message, title, icon, buttons, prompt, custom);</span>
			userInput.<span style="color: #0066CC;">setFocus</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			responseTxt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Pending...&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_loginDialogClose<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> dialog:uiDialog = evt.<span style="color: #0066CC;">target</span> as uiDialog;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dialog<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dialog.<span style="color: #006600;">response</span> == <span style="color: #ff0000;">&quot;OK&quot;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					responseTxt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Username: &quot;</span>+userInput.<span style="color: #0066CC;">text</span>
					+ <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Password: &quot;</span> + passInput.<span style="color: #0066CC;">text</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">else</span>
				<span style="color: #66cc66;">&#123;</span>
					responseTxt.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Login canceled!&quot;</span>
					+ <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>By the way... do you spell cancel'ed with one or two el's?&quot;</span>
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of the components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework.<br />
You may experiment with the various features by downloading the <a href="/aspireui/download/">trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uidialog-displaying-custom-dialog-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uiWindow: Implementing &#8220;Confirm Close&#8221; Dialog</title>
		<link>http://www.ghostwire.com/blog/archives/uiwindow-implementing-confirm-close-dialog/</link>
		<comments>http://www.ghostwire.com/blog/archives/uiwindow-implementing-confirm-close-dialog/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 14:10:52 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=525</guid>
		<description><![CDATA[A uiWindow container has a title bar that contains a close button if the instance has been set to be closeable by end-users. If closing the window would in turn produce any result that the end-user may regret, for example if closing the window is equivalent to aborting an ongoing task, or data collected from [...]]]></description>
			<content:encoded><![CDATA[<p>A <code>uiWindow</code> container has a title bar that contains a close button if the instance has been set to be closeable by end-users.  If closing the window would in turn produce any result that the end-user may regret, for example if closing the window is equivalent to aborting an ongoing task, or data collected from the end-user would be lost, then it is often appropriate to ask the end-user to confirm if he would like to close the window. This is usually done by showing a modal dialog asking the end-user to confirm the action.</p>
<p><span id="more-525"></span><br />
<strong>ConfirmCloseDialogDemo Example</strong><br />
The following demonstrates how a &#8220;Confirm Close&#8221; dialog can be implemented:<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ConfirmCloseDialogDemo_358253631"
			class="flashmovie"
			width="500"
			height="400">
	<param name="movie" value="/aspireui/swf/ConfirmCloseDialogDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/ConfirmCloseDialogDemo.swf"
			name="fm_ConfirmCloseDialogDemo_358253631"
			width="500"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package 
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiWindow</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiDialog</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiLabelButton</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiText</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">enums</span>.<span style="color: #006600;">WINDOW</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiSkins</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ConfirmCloseDialogDemo <span style="color: #0066CC;">extends</span> Sprite 
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ConfirmCloseDialogDemo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">else</span> addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			uiSkins.<span style="color: #006600;">manager</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>, main<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myWindow:uiWindow;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> confirmDialog:uiDialog;
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** main application code **</span>
			uiWindow.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			myWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span>WINDOW.<span style="color: #006600;">CAN_CLOSE</span> <span style="color: #66cc66;">|</span> WINDOW.<span style="color: #006600;">CAN_MOVE</span><span style="color: #66cc66;">&#41;</span>;
			myWindow.<span style="color: #006600;">title</span> = <span style="color: #ff0000;">&quot;Hello World!&quot;</span>;
			myWindow.<span style="color: #006600;">contentPadding</span> = <span style="color: #cc66cc;">10</span>;
			myWindow.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Close this window by pressing the close button on the title bar.&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			myWindow.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			myWindow.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_close, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> openBtn:uiLabelButton = <span style="color: #000000; font-weight: bold;">new</span> uiLabelButton<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Open Window&quot;</span><span style="color: #66cc66;">&#41;</span>;
			openBtn.<span style="color: #006600;">move</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>openBtn<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			openBtn.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, on_openBtnClick, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
		 <span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_openBtnClick<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			myWindow.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_close<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>confirmDialog == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				evt.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** cancels close action **</span>
				confirmDialog = <span style="color: #000000; font-weight: bold;">new</span> uiDialog<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				confirmDialog.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_confirmClose, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
				confirmDialog.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Do you really want to close this window?&quot;</span>, <span style="color: #ff0000;">&quot;Proceed?&quot;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Yes&quot;</span>, <span style="color: #ff0000;">&quot;No&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_confirmClose<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			confirmDialog.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_confirmClose<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>confirmDialog.<span style="color: #006600;">response</span> === <span style="color: #ff0000;">&quot;Yes&quot;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				myWindow.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** confirmDialog now exists **</span>
			<span style="color: #66cc66;">&#125;</span>
			confirmDialog = <span style="color: #000000; font-weight: bold;">null</span>; <span style="color: #808080; font-style: italic;">// ** confirmDialog no longer exists **</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><!-- --><br />
<strong>How It Works</strong><br />
First, we listen for the Event.CLOSE event on the window instance:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">myWindow.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_close, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>When the close button is clicked, the window attempts to close itself, dispatching the <code>Event.CLOSE</code> event and the listener <code>on_close()</code> method is called:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_close<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>confirmDialog == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		evt.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** cancels close action **</span>
		confirmDialog = <span style="color: #000000; font-weight: bold;">new</span> uiDialog<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		confirmDialog.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_confirmClose, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
		confirmDialog.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Do you really want to close this window?&quot;</span>, <span style="color: #ff0000;">&quot;Proceed?&quot;</span>, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Yes&quot;</span>, <span style="color: #ff0000;">&quot;No&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The <code>on_close()</code> method checks if the <code>confirmDialog</code> instance exists, if not, the close action is aborted and the <code>confirmDialog</code> instance is created and shown.</p>
<p>When the end-user dismisses the dialog by clicking the &#8220;Yes&#8221; or &#8220;No&#8221; button, or the close button on the dialog&#8217;s title bar, the <code>on_confirmClose()</code> method is called:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_confirmClose<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	confirmDialog.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>, on_confirmClose<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>confirmDialog.<span style="color: #006600;">response</span> === <span style="color: #ff0000;">&quot;Yes&quot;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		myWindow.<span style="color: #0066CC;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** confirmDialog now exists **</span>
	<span style="color: #66cc66;">&#125;</span>
	confirmDialog = <span style="color: #000000; font-weight: bold;">null</span>; <span style="color: #808080; font-style: italic;">// ** confirmDialog no longer exists **</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>We check if the dialog was dismissed by clicking the &#8220;Yes&#8221; button, if so, the <code>myWindow.close()</code> method is called. This time round, when the <code>on_close()</code> method is called, the <code>confirmDialog</code> instance exists and therefore the close event will not be aborted/canceled (the <code>on_close()</code> method does nothing and the window proceeds to be closed).</p>
<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of these components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework.<br />
You may experiment with the various features by downloading a <a href="/aspireui/download/">trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uiwindow-implementing-confirm-close-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uiWindow: Setting Minimum Size Of Viewable Area</title>
		<link>http://www.ghostwire.com/blog/archives/uiwindow-setting-minimum-size-of-viewable-area/</link>
		<comments>http://www.ghostwire.com/blog/archives/uiwindow-setting-minimum-size-of-viewable-area/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 07:32:21 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=574</guid>
		<description><![CDATA[When using the Aspire UI library, each component instance will attempt to compute its own &#8220;ideal&#8221; preferred size if its size is not explicitly set. This &#8220;ideal&#8221; size typically means the minimum size at which the component may render itself fully (or sufficiently without appearing distorted), taking into account its child display objects such as [...]]]></description>
			<content:encoded><![CDATA[<p>When using the <a href="/aspireui/">Aspire UI</a> library, each component instance will attempt to compute its own &#8220;ideal&#8221; preferred size if its size is not explicitly set. This &#8220;ideal&#8221; size typically means the minimum size at which the component may render itself fully (or sufficiently without appearing distorted), taking into account its child display objects such as labels or embedded images, if any.</p>
<p>To be very clear, for any Aspire UI component, if <code>width</code> and <code>height</code> is explicitly set, then this explicit size becomes the preferred size.  This means that if you set the size of a component instance explicitly, you are overriding what the component deems to be ideal.</p>
<p><span id="more-574"></span><br />
<strong>Default Window Size</strong><br />
In the case of the <a href="/aspireui/docs/usage/uiwindow">uiWindow</a> component, the preferred size of the container depends on the composite preferred sizes of its child content and the title bar. A <code>uiWindow</code> instance may also contain a status bar and a menu bar, in which case the preferred sizes of these will also be taken into account when computing the window&#8217;s preferred size.</p>
<p>If you do not set the <code>width</code> and <code>height</code> of a <code>uiWindow</code> container explicitly, it will attempt to display its content fully by giving itself a size big enough to accommodate the content. If the content is relatively big (compared to the available application Stage area), you should consider putting it inside a scroll pane. See the previous post &#8211; <a href="/blog/archives/using-uiwindow-implementing-scrollable-content/">Using uiWindow: Implementing Scrollable Content</a>.</p>
<p><!-- --><br />
<strong>Content</strong><br />
The <code>content</code> property of a <code>uiWindow</code> returns a reference to the embedded <a href="/aspireui/docs/usage/uiform">uiForm</a> container.  This <code>uiForm</code> container in turn contains the child display objects that make up the &#8220;content&#8221; of the window (the window itself does not contain the child objects directly).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> win:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
win.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>childObject<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><!-- --><br />
<strong>Minimum Viewable Area</strong><br />
If a <code>uiWindow</code> container is <a href="/aspireui/docs/usage/uiwindow#mode">resizable</a> by end-users, the <em>minimum size of the viewable area</em> depends on the preferred size of the <code>content</code>.  Therefore, to change the minimum size of the viewable area, you need to explicitly set the size of this <code>content</code> (which is the embedded <code>uiForm</code> instance containing any child display objects that make up the &#8220;content&#8221;).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> win:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
win.<span style="color: #006600;">content</span>.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// sets minimum viewable area to 50x50</span></pre></div></div>

<p><!-- --><br />
<strong>Live Demo</strong><br />
We made some changes to the example shown in the previous post <a href="http://ghostwire.com/blog/archives/using-uiwindow-implementing-scrollable-content/">Using uiWindow: Implementing Scrollable Content</a>:</p>
<ul>
<li> set minimum viewable area of window to 50&#215;50
<li> set window size to 300&#215;250 (note the difference between setting content size and window size)
<li> set &#8220;livedragging&#8221; to &#8220;true&#8221;, to demonstrate live drag-resizing
</ul>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_WinViewSizeDemo_857518547"
			class="flashmovie"
			width="480"
			height="300">
	<param name="movie" value="/aspireui/swf/WinViewSizeDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/WinViewSizeDemo.swf"
			name="fm_WinViewSizeDemo_857518547"
			width="480"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><!-- --><br />
<strong>WinViewSizeDemo Class</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiScrollPane</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiWindow</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiImage</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiCursors</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiSkins</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WinViewSizeDemo <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> WinViewSizeDemo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** let assets preload before starting application **</span>
			uiSkins.<span style="color: #006600;">manager</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>, main<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** main application code **</span>
&nbsp;
			uiCursors.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			uiWindow.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create the content **</span>
			<span style="color: #000000; font-weight: bold;">var</span> img:uiImage = <span style="color: #000000; font-weight: bold;">new</span> uiImage<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;flower.jpg&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create a scroll pane **</span>
			<span style="color: #000000; font-weight: bold;">var</span> imgsp:uiScrollPane	= <span style="color: #000000; font-weight: bold;">new</span> uiScrollPane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			imgsp.<span style="color: #006600;">fillX</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			imgsp.<span style="color: #006600;">fillY</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			imgsp.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>img<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** add content to scroll pane **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create the window **</span>
			<span style="color: #000000; font-weight: bold;">var</span> imgWin:uiWindow	= <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			imgWin.<span style="color: #006600;">title</span>		= <span style="color: #ff0000;">&quot;Flower&quot;</span>;
			imgWin.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>imgsp<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** add scroll pane to window **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** show window **</span>
			imgWin.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** set minimum viewable area size to 50x50 **</span>
			imgWin.<span style="color: #006600;">content</span>.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** set window size to 300x250 **</span>
			imgWin.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">300</span>, <span style="color: #cc66cc;">250</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** demonstrate live drag-resizing **</span>
			imgWin.<span style="color: #006600;">liveDragging</span> = <span style="color: #000000; font-weight: bold;">true</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of the components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by <a href="/aspireui/download/">downloading a trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uiwindow-setting-minimum-size-of-viewable-area/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using uiWindow: Implementing Scrollable Content</title>
		<link>http://www.ghostwire.com/blog/archives/using-uiwindow-implementing-scrollable-content/</link>
		<comments>http://www.ghostwire.com/blog/archives/using-uiwindow-implementing-scrollable-content/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 05:15:28 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=629</guid>
		<description><![CDATA[The uiWindow container does not automatically embed any scroll pane since this is not always required by its content. For example, the window may be set to be non-resizable and is big enough to show all the content. Or you may decide that the content should be scaled/resized to fit the viewable area. If scrollable [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="/aspireui/docs/usage/uiwindow">uiWindow</a> container does not automatically embed any scroll pane since this is not always required by its content. For example, the window may be set to be non-resizable and is big enough to show all the content. Or you may decide that the content should be scaled/resized to fit the viewable area.</p>
<p>If scrollable content is required, you may implement it using the <a href="/aspireui/docs/usage/uiscrollpane">uiScrollPane</a> class &#8211; create a <code>uiScrollPane</code> instance and add it to the <code>content</code> of the <code>uiWindow</code> instance. You would then add child display objects to the <code>content</code> of the <code>uiScrollPane</code> instance, instead of the <code>content</code> of the <code>uiWindow</code> container itself.</p>
<p>The <code>fillX</code> and <code>fillY</code> properties of the <code>uiScrollPane</code> instance should be set to <code>true</code> to enable automatic resizing when the <code>uiWindow</code> container is resized.</p>
<p><span id="more-629"></span><strong>Example</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiScrollPane</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">uiWindow</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #006600;">uiImage</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiCursors</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #006600;">uiSkins</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ScrollWinDemo <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ScrollWinDemo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** let assets preload before starting application **</span>
			uiSkins.<span style="color: #006600;">manager</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>, main<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** main application code **</span>
&nbsp;
			uiCursors.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			uiWindow.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create the content **</span>
			<span style="color: #000000; font-weight: bold;">var</span> img:uiImage = <span style="color: #000000; font-weight: bold;">new</span> uiImage<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;flower.jpg&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create a scroll pane **</span>
			<span style="color: #000000; font-weight: bold;">var</span> imgsp:uiScrollPane	= <span style="color: #000000; font-weight: bold;">new</span> uiScrollPane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			imgsp.<span style="color: #006600;">fillX</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			imgsp.<span style="color: #006600;">fillY</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			imgsp.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>img<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** add content to scroll pane **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** create the window **</span>
			<span style="color: #000000; font-weight: bold;">var</span> imgWin:uiWindow	= <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			imgWin.<span style="color: #006600;">title</span>		= <span style="color: #ff0000;">&quot;Flower&quot;</span>;
			imgWin.<span style="color: #006600;">content</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>imgsp<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// ** add scroll pane to window **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** show window **</span>
			imgWin.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><!-- --><br />
<strong>Demo</strong><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ScrollWinDemo_1829735241"
			class="flashmovie"
			width="480"
			height="300">
	<param name="movie" value="/aspireui/swf/ScrollWinDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/ScrollWinDemo.swf"
			name="fm_ScrollWinDemo_1829735241"
			width="480"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of the components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by <a href="/aspireui/download/">downloading a trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/using-uiwindow-implementing-scrollable-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using uiWindow: Setting the color and transparency level of the background overlay of modal windows</title>
		<link>http://www.ghostwire.com/blog/archives/using-uiwindow-setting-the-color-and-transparency-level-of-the-background-overlay-of-modal-windows/</link>
		<comments>http://www.ghostwire.com/blog/archives/using-uiwindow-setting-the-color-and-transparency-level-of-the-background-overlay-of-modal-windows/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 12:25:27 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=251</guid>
		<description><![CDATA[What are modal windows? In user interface design, a modal window is one that commands the end-user&#8217;s immediate attention &#8211; the user must interact with the window and/or close it before he may return to the main application. When using the Aspire UI library, a modal window is created by including WINDOW.IS_MODAL in the &#8220;mode&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What are modal windows?</strong><br />
In user interface design, a modal window is one that commands the end-user&#8217;s immediate attention &#8211; the user must interact with the window and/or close it before he may return to the main application.</p>
<p>
When using the <a href="/aspireui/">Aspire UI</a> library, a modal window is created by including WINDOW.IS_MODAL in the &#8220;mode&#8221; parameter of the <a href="/aspireui/docs/usage/uiwindow">uiWindow</a> constructor:</p>
<p><span id="more-251"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> modalWin:uiWindow = <span style="color: #000000; font-weight: bold;">new</span> uiWindow<span style="color: #66cc66;">&#40;</span>WINDOW.<span style="color: #006600;">CAN_CLOSE</span><span style="color: #66cc66;">|</span>WINDOW.<span style="color: #006600;">CAN_MOVE</span><span style="color: #66cc66;">|</span>WINDOW.<span style="color: #006600;">IS_MODAL</span><span style="color: #66cc66;">&#41;</span>;
modalWin.<span style="color: #006600;">title</span> = <span style="color: #ff0000;">&quot;A Modal Window&quot;</span>;
modalWin.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">/**
TIP:
The resulting value of WINDOW.CAN_CLOSE|WINDOW.CAN_MOVE|WINDOW.IS_MODAL
is the same as WINDOW.MODAL
**/</span></pre></div></div>

</p>
<p><!-- --><br />
<strong>Modal background</strong><br />
Opening a modal window inserts a &#8220;background overlay&#8221; behind it that disables mouse-interactivity with the other parts of the application, until the modal window is dismissed.  By default, this background overlay is completely transparent.  This transparency level was chosen because such is the case observed in desktop applications and therefore would be what most end-users would be familiar with.</p>
<p>However, considering that the main purpose of a modal window is to attract user awareness, it is possible that applications may find it advantageous to colorize the background in order to highlight the modal window to end-users.</p>
<p>To change the color and/or transparency level of the background overlay, the static uiWindow properties &#8220;modalColor&#8221; and &#8220;modalAlpha&#8221; are used respectively.</p>
<p>The &#8220;modalAlpha&#8221; property indicates the transparency level of the background overlay. This value should be between 0.0 (totally transparent) and 1.0 (totally opaque).</p>
<p>The &#8220;modalColor&#8221; property indicates the color of the background overlay. Applicable only if the &#8220;modalAlpha&#8221; property has a non-zero and non-NaN value. If undefined, the resulting color will be black.</p>
<p><!-- --><br />
<strong>Example</strong><br />
The following is a modified version of the <a href="/blog/archives/uidialog-example/">uiDialog live demo</a> shown previously (modified here to demonstrate the use of the &#8220;modalColor&#8221; and &#8220;modalAlpha&#8221; properties):<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_DialogDemo_1511203194"
			class="flashmovie"
			width="420"
			height="300">
	<param name="movie" value="/aspireui/swf/DialogDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/DialogDemo.swf"
			name="fm_DialogDemo_1511203194"
			width="420"
			height="300">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<ul>
<li>The <a href="/aspireui/docs/usage/uidialog">uiDialog</a> class is a subclass of uiWindow &#8211; uiDialog instances are all modal windows.</li>
<li>Before Dialog A (&#8220;alert&#8221; dialog) is shown, uiWindow.modalColor is set to 0xFF0000 (red).</li>
<li>Before Dialog B (&#8220;confirm&#8221; dialog) is shown, uiWindow.modalColor is set to 0x00FF00 (green).</li>
<li>Before Dialog C (&#8220;prompt&#8221; dialog) is shown, uiWindow.modalColor is set to 0x0000FF (blue).</li>
<li>In all three cases, uiWindow.modalAlpha is set to 0.5.</li>
<li>Although the example uses red-green-blue colors for the modal window background overlay, it is unlikely that you would actually use those colors in your application. The red-green-blue colors were used simply to demonstrate <em>what is possible</em>. A more &#8220;universally appropriate&#8221;, useful setting that would blend into most themes would probably be uiWindow.modalAlpha=0.8 and uiWindow.modalColor=0xFFFFFF.</li>
<li>Notice that if you click outside the modal window, the window blinks/flashes rapidly a few times &#8211; the intention is to draw the user&#8217;s attention to the modal window (this behavior is built into the uiWindow class).</li>
</ul>
<p>The code for the example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">containers</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">controls</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #0066CC;">data</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">enums</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">ghostwire</span>.<span style="color: #006600;">ui</span>.<span style="color: #006600;">managers</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">system</span>.<span style="color: #0066CC;">Capabilities</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DialogDemo <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// ** instances **</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> responseText:uiText;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> DialogDemo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** make sure stage is not null **</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>,init<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** let assets preload before starting application **</span>
			uiSkins.<span style="color: #006600;">manager</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">INIT</span>,main<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** initializes uiWindow class **</span>
			uiWindow.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// ** main application code **</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// ** topLevelPane **</span>
			<span style="color: #000000; font-weight: bold;">var</span> topLevelPane:uiPane = <span style="color: #000000; font-weight: bold;">new</span> uiPane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			topLevelPane.<span style="color: #006600;">padding</span>	= <span style="color: #cc66cc;">10</span>;
			topLevelPane.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>,<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span><span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>topLevelPane<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> buttons:uiBox	= <span style="color: #000000; font-weight: bold;">new</span> uiBox<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			buttons.<span style="color: #006600;">alignX</span>		= <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">CENTER</span>;
			buttons.<span style="color: #006600;">spacing</span>		= <span style="color: #cc66cc;">20</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> winButtonA:uiLabelButton = <span style="color: #000000; font-weight: bold;">new</span> uiLabelButton<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Dialog A&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> winButtonB:uiLabelButton = <span style="color: #000000; font-weight: bold;">new</span> uiLabelButton<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Dialog B&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> winButtonC:uiLabelButton = <span style="color: #000000; font-weight: bold;">new</span> uiLabelButton<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Dialog C&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			winButtonA.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,on_click,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			winButtonB.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,on_click,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			winButtonC.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,on_click,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			buttons.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>winButtonA<span style="color: #66cc66;">&#41;</span>;
			buttons.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>winButtonB<span style="color: #66cc66;">&#41;</span>;
			buttons.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>winButtonC<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			topLevelPane.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>buttons<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			responseText		= <span style="color: #000000; font-weight: bold;">new</span> uiText<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			responseText.<span style="color: #006600;">alignX</span> = <span style="color: #0066CC;">ALIGN</span>.<span style="color: #006600;">CENTER</span>;
			responseText.<span style="color: #006600;">y</span>		= <span style="color: #cc66cc;">150</span>;
			topLevelPane.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>responseText<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">// ** end topLevelPane **</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_click<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span>uiLabelButton<span style="color: #66cc66;">&#40;</span>evt.<span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Dialog A&quot;</span>:
					uiWindow.<span style="color: #006600;">modalAlpha</span> = <span style="color: #cc66cc;">0.5</span>;
					uiWindow.<span style="color: #006600;">modalColor</span> = 0xFF0000;
					uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;This is a simple Alert Dialog.&quot;</span>,<span style="color: #ff0000;">&quot;Warning!&quot;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">break</span>;
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Dialog B&quot;</span>:
					uiWindow.<span style="color: #006600;">modalAlpha</span> = <span style="color: #cc66cc;">0.5</span>;
					uiWindow.<span style="color: #006600;">modalColor</span> = 0x00FF00;
					uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Save changes to document?&quot;</span>,<span style="color: #ff0000;">&quot;Proceed?&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;Yes&quot;</span>,<span style="color: #ff0000;">&quot;No&quot;</span>,<span style="color: #ff0000;">&quot;Cancel&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">break</span>;
				<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;Dialog C&quot;</span>:
					uiWindow.<span style="color: #006600;">modalAlpha</span> = <span style="color: #cc66cc;">0.5</span>;
					uiWindow.<span style="color: #006600;">modalColor</span> = 0x0000FF;
					uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Please enter your name:&quot;</span>,<span style="color: #ff0000;">&quot;Full Name&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">break</span>;
				<span style="color: #000000; font-weight: bold;">default</span>:
					<span style="color: #808080; font-style: italic;">// no default action</span>
			<span style="color: #66cc66;">&#125;</span>
			responseText.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;uiDialog.instance.response property value:nn&quot;</span>+uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #006600;">response</span>;
			uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #0066CC;">CLOSE</span>,on_dialogClose<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> on_dialogClose<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			responseText.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;uiDialog.instance.response property value:nn&quot;</span>+uiDialog.<span style="color: #006600;">instance</span>.<span style="color: #006600;">response</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of these components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by <a href="/aspireui/download/">downloading a trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/using-uiwindow-setting-the-color-and-transparency-level-of-the-background-overlay-of-modal-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uiDialog Example</title>
		<link>http://www.ghostwire.com/blog/archives/uidialog-example/</link>
		<comments>http://www.ghostwire.com/blog/archives/uidialog-example/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 12:45:48 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=16</guid>
		<description><![CDATA[The following SWF features the uiDialog component from Aspire UI Standard Edition: 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_MyDialogExample_879428824"
			class="flashmovie"
			width="420"
			height="550">
	<param name="movie" value="/aspireui/swf/MyDialogExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/MyDialogExample.swf"
			name="fm_MyDialogExample_879428824"
			width="420"
			height="550">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> Dialog A shows a simple message with a single button (an &#8220;alert&#8221; dialog). Dialog B is shown with three buttons each with custom labels (a &#8220;confirmation&#8221; dialog). The &#8220;response&#8221; property returns the text label on the [...]]]></description>
			<content:encoded><![CDATA[<p>The following SWF features the uiDialog component from Aspire UI Standard Edition:</p>
<p><span id="more-16"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_MyDialogExample_2012662386"
			class="flashmovie"
			width="420"
			height="550">
	<param name="movie" value="/aspireui/swf/MyDialogExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/MyDialogExample.swf"
			name="fm_MyDialogExample_2012662386"
			width="420"
			height="550">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<ul>
<li>Dialog A shows a simple message with a single button (an &#8220;alert&#8221; dialog).</li>
<li>Dialog B is shown with three buttons each with custom labels (a &#8220;confirmation&#8221; dialog). The &#8220;response&#8221; property returns the text label on the button pressed.</li>
<li>Dialog C is shown with an input text field (a &#8220;prompt&#8221; dialog). The &#8220;response&#8221; property returns the text typed into the input text field if the OK button or ENTER key is pressed. Otherwise, the property returns null.</li>
<li>A dialog can be closed by pressing the ESCAPE key, in which case the &#8220;response&#8221; property returns null.</li>
<li>The image shown in the dialog is loaded from external PNG file and rendered using the uiImage class. The external image is loaded once and cached.</li>
</ul>
<p>See also: <a href="/aspireui/docs/usage/uidialog">uiDialog usage notes</a></p>
<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by <a href="/aspireui/download/">downloading a trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uidialog-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uiWindow Example using &#8220;classic&#8221; theme</title>
		<link>http://www.ghostwire.com/blog/archives/uiwindow-example-using-classic-theme/</link>
		<comments>http://www.ghostwire.com/blog/archives/uiwindow-example-using-classic-theme/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 01:19:52 +0000</pubDate>
		<dc:creator>sunny</dc:creator>
				<category><![CDATA[Aspire UI]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Skinning]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://ghostwire.com/blog/?p=17</guid>
		<description><![CDATA[One of the key features of the Aspire UI library is the ease of skinning which is done via external PNG images. These images are loaded during run-time instead of being compiled into the application SWF. Not only does it make it easy to (re)design component skins, it also makes it easy to try out [...]]]></description>
			<content:encoded><![CDATA[<p>One of the key features of the Aspire UI library is the ease of skinning which is done via external PNG images. These images are loaded during run-time instead of being compiled into the application SWF. Not only does it make it easy to (re)design component skins, it also makes it easy to try out different themes. As long as a theme is designed and developed correctly, an application can switch themes easily.</p>
<p>The following is the exact same SWF shown in the previous <a href="/blog/archives/uiwindow-example/">uiWindow Example</a>, but this time it is rendered using the &#8220;classic&#8221; theme (included in the Aspire UI distribution):</p>
<p><span id="more-17"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_MyWinExample_1436125277"
			class="flashmovie"
			width="420"
			height="550">
	<param name="movie" value="/aspireui/swf/MyWinExample.swf" />
	<param name="flashvars" value="classic=true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/aspireui/swf/MyWinExample.swf"
			name="fm_MyWinExample_1436125277"
			width="420"
			height="550">
		<param name="flashvars" value="classic=true" />
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Exact same SWF, just with an additional fvars &#8220;classic=true&#8221; set.</p>
<p>Within the application code, a single line of code determines which theme to use:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">uiSkins.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span>theme<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>If the uiSkins.initialize() call is omitted, the &#8220;default&#8221; theme is used.</p>
<p>In the example above, we use the following code to detect if the fvars is set and if so use the &#8220;classic&#8221; theme:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">uiSkins.<span style="color: #006600;">initialize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>loaderInfo.<span style="color: #006600;">parameters</span>.<span style="color: #006600;">classic</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #ff0000;">&quot;classic&quot;</span> : <span style="color: #ff0000;">&quot;default&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>See also: <a href="/aspireui/docs/usage/uiskins">uiSkins usage notes</a></p>
<p>NOTE: By deliberate design, the Aspire UI framework does not support &#8220;on-the-fly&#8221; theme changing during application run-time. A theme is fixed once the uiSkins.initialize() call is made. This is by deliberate design because, as with most desktop applications, it is better to ask end-users to &#8220;re-start&#8221; the application before effecting a new theme.</p>
<p><!-- --><br />
<strong>Aspire UI Components</strong><br />
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of the components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by <a href="/aspireui/download/">downloading a trial version</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ghostwire.com/blog/archives/uiwindow-example-using-classic-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

