<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Adding icons to Panel containers</title>
	<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Fri, 05 Dec 2008 10:25:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: FlexBeginner</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-17136</link>
		<author>FlexBeginner</author>
		<pubDate>Tue, 02 Dec 2008 15:19:20 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-17136</guid>
		<description>Hi,

Is there a way to make the image thats been added to panel titleBar to make it visible and invisible with a button click ?

Thank you for the help in advance</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Is there a way to make the image thats been added to panel titleBar to make it visible and invisible with a button click ?</p>
<p>Thank you for the help in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-13710</link>
		<author>peterd</author>
		<pubDate>Fri, 27 Jun 2008 17:41:04 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-13710</guid>
		<description>Joel,

Check out Ben Stucki's IconUtility class at &lt;a href="http://blog.benstucki.net/?p=42" rel="nofollow"&gt;&lt;u&gt;IconUtility Component for Dynamic Run-Time Icons&lt;/u&gt;&lt;/a&gt;.

Peter</description>
		<content:encoded><![CDATA[<p>Joel,</p>
<p>Check out Ben Stucki&#8217;s IconUtility class at <a href="http://blog.benstucki.net/?p=42" rel="nofollow"><u>IconUtility Component for Dynamic Run-Time Icons</u></a>.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-13708</link>
		<author>Joel</author>
		<pubDate>Fri, 27 Jun 2008 15:02:46 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-13708</guid>
		<description>Is there any way of getting around embedding the titleIcon and being able to populate it dynamically?</description>
		<content:encoded><![CDATA[<p>Is there any way of getting around embedding the titleIcon and being able to populate it dynamically?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stranger</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6497</link>
		<author>Stranger</author>
		<pubDate>Wed, 30 Jan 2008 06:11:11 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6497</guid>
		<description>Hi, 

I want to shuffle the panels. Say for Example, if i have two panels that are created at run time using action script. I have one panel after the other in a canvas vertically. If i drag one panel and drop it over the other panel, the dragged panel must be placed on the position where the other panel is and the entire order of panels must get shuffled. 

If its confusing, in the above example, if i drag the left panel and drop it over the right panel, the right should come to left and the left panel should come to right. 

How can i do this. 

Any suggestions or example. 

Thanks for the help in advance.

Stranger</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I want to shuffle the panels. Say for Example, if i have two panels that are created at run time using action script. I have one panel after the other in a canvas vertically. If i drag one panel and drop it over the other panel, the dragged panel must be placed on the position where the other panel is and the entire order of panels must get shuffled. </p>
<p>If its confusing, in the above example, if i drag the left panel and drop it over the right panel, the right should come to left and the left panel should come to right. </p>
<p>How can i do this. </p>
<p>Any suggestions or example. </p>
<p>Thanks for the help in advance.</p>
<p>Stranger</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6054</link>
		<author>adam</author>
		<pubDate>Mon, 14 Jan 2008 00:48:15 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6054</guid>
		<description>Peter,

Thank you for the quick response.  Your code worked first time around for me, so thank you for that as well.  I will take your advice, I have already posted the question at FlexCoders.  I agree best method probably would be extending the Panel. Peter...thanks again.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Thank you for the quick response.  Your code worked first time around for me, so thank you for that as well.  I will take your advice, I have already posted the question at FlexCoders.  I agree best method probably would be extending the Panel. Peter&#8230;thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6039</link>
		<author>peterd</author>
		<pubDate>Sun, 13 Jan 2008 08:50:39 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6039</guid>
		<description>Adam,

Not sure if this is the "best" way, but this seems to work (although it does use mx_internal namespace, so I can't guarantee it will work this way in the future (or in past versions).

Since I don't have a very high confidence level in this code, I'll just post it in the comments here instead of making it a new entry.

&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;!-- http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/ --&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&#62;

    &#60;mx:Script&#62;
        &#60;![CDATA[
            import mx.core.UIComponent;
            import mx.controls.Image;

            private function init():void {
                var titleBar:UIComponent = panel.mx_internal::getTitleBar();
                var titleIcon:Bitmap = panel.mx_internal::titleIconObject;

                var icon:Image = new Image();
                icon.source = new Bitmap(titleIcon.bitmapData);
                icon.toolTip = "I'm a mystery tool tip";
                icon.width = titleIcon.width;
                icon.height = titleIcon.height;
                icon.x = titleIcon.x;
                icon.y = titleIcon.y;

                var depth:int = titleBar.getChildIndex(titleIcon);
                titleBar.removeChildAt(depth);
                titleBar.addChildAt(icon, depth);
            }
        ]]&#62;
    &#60;/mx:Script&#62;

    &#60;mx:Panel id="panel"
            title="My icon has a tool tip"
            titleIcon="@Embed('asterisk_orange.png')"
            width="320"
            height="120"
            creationComplete="init();" /&#62;

&#60;/mx:Application&#62;
&lt;/pre&gt;

You may want to try asking on a high volume list, such as FlexCoders and see if you can get any other suggestions. It may be better to extend the Panel class and use an Image control instead of the Bitmap display object. Plus, by extending Panel, you could add a custom parameter (such as titleIconToolTip which would make the code easier to reuse.

Hope that helps,
Peter</description>
		<content:encoded><![CDATA[<p>Adam,</p>
<p>Not sure if this is the &#8220;best&#8221; way, but this seems to work (although it does use mx_internal namespace, so I can&#8217;t guarantee it will work this way in the future (or in past versions).</p>
<p>Since I don&#8217;t have a very high confidence level in this code, I&#8217;ll just post it in the comments here instead of making it a new entry.</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- <a href="http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/" rel="nofollow">http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/</a> &#8211;&gt;
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221;
        layout=&#8221;vertical&#8221;
        verticalAlign=&#8221;middle&#8221;
        backgroundColor=&#8221;white&#8221;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.UIComponent;
            import mx.controls.Image;

            private function init():void {
                var titleBar:UIComponent = panel.mx_internal::getTitleBar();
                var titleIcon:Bitmap = panel.mx_internal::titleIconObject;

                var icon:Image = new Image();
                icon.source = new Bitmap(titleIcon.bitmapData);
                icon.toolTip = &#8220;I&#8217;m a mystery tool tip&#8221;;
                icon.width = titleIcon.width;
                icon.height = titleIcon.height;
                icon.x = titleIcon.x;
                icon.y = titleIcon.y;

                var depth:int = titleBar.getChildIndex(titleIcon);
                titleBar.removeChildAt(depth);
                titleBar.addChildAt(icon, depth);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Panel id=&#8221;panel&#8221;
            title=&#8221;My icon has a tool tip&#8221;
            titleIcon=&#8221;@Embed(&#8217;asterisk_orange.png&#8217;)&#8221;
            width=&#8221;320&#8243;
            height=&#8221;120&#8243;
            creationComplete=&#8221;init();&#8221; /&gt;

&lt;/mx:Application&gt;
</pre>
<p>You may want to try asking on a high volume list, such as FlexCoders and see if you can get any other suggestions. It may be better to extend the Panel class and use an Image control instead of the Bitmap display object. Plus, by extending Panel, you could add a custom parameter (such as titleIconToolTip which would make the code easier to reuse.</p>
<p>Hope that helps,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6035</link>
		<author>adam</author>
		<pubDate>Sat, 12 Jan 2008 18:31:01 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6035</guid>
		<description>tooltip for titleicon?</description>
		<content:encoded><![CDATA[<p>tooltip for titleicon?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6034</link>
		<author>adam</author>
		<pubDate>Sat, 12 Jan 2008 18:14:22 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/08/02/adding-icons-to-panel-containers/#comment-6034</guid>
		<description>How can I add a toolTip to the titleIcon? Thanks. You're site has helped me tremendously, keep up the good work....please!</description>
		<content:encoded><![CDATA[<p>How can I add a toolTip to the titleIcon? Thanks. You&#8217;re site has helped me tremendously, keep up the good work&#8230;.please!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
