<?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>in a rush &#187; Components</title>
	<atom:link href="http://www.robrusher.com/category/flashplatform/flex/components/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robrusher.com</link>
	<description>experience is everything</description>
	<lastBuildDate>Thu, 08 Jul 2010 04:48:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>List, ItemRenderer, toolTip&#8230; oh my!</title>
		<link>http://www.robrusher.com/2010/03/11/list-itemrenderer-tooltip-oh-my/</link>
		<comments>http://www.robrusher.com/2010/03/11/list-itemrenderer-tooltip-oh-my/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 23:01:02 +0000</pubDate>
		<dc:creator>Rush</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[dataTipField]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[toolTip]]></category>

		<guid isPermaLink="false">http://www.robrusher.com/?p=204</guid>
		<description><![CDATA[On my latest project, I was going through several areas of the application adding toolTips to make some of the data that is clipped visible if desired. In doing so, I found out that I needed to use a combination of the different types of tips available. Most components have a toolTip property that you [...]]]></description>
			<content:encoded><![CDATA[<p>On my latest project, I was going through several areas of the application adding <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTips</a> to make some of the data that is clipped visible if desired. In doing so, I found out that I needed to use a combination of the different types of tips available.</p>
<p>Most components have a <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTip</a> property that you can set (typically bound to some data). But the <a title="Flex 3.5 API - List" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/List.html" target="_blank">List</a>-based components are a little different. They use <a title="Flex 3.5 API - dataTipField" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataTipField" target="_blank">dataTipField</a> and the <a title="Flex 3.5 API - dataTipFunction" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataTipFunction" target="_blank">dataTipFunction</a>. The &#8220;data&#8221; version of <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTips</a> is based on the list iterating through it&#8217;s <a title="Flex 3.5 API - dataProvider" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataProvider" target="_blank">dataProvider</a> and then adding <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTip</a> for each row.</p>
<p>So, while adding <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTips</a> to a List with an <a title="Flex 3.5 API - itemRenderer" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#itemRenderer" target="_blank">itemRenderer</a>, I ran into a problem. My <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTips</a> weren&#8217;t showing up when I set the <a title="Flex 3.5 API - dataTipField" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataTipField" target="_blank">dataTipField</a>. The <a title="Flex 3.5 API - dataTipFunction" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataTipFunction" target="_blank">dataTipFunction</a> didn&#8217;t work either. What gives?!</p>
<p>Well, I had an inline <a title="Flex 3.5 API - itemRenderer" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#itemRenderer" target="_blank">itemRenderer</a> for my list. And apparently the <a title="Flex 3.5 API - List" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/List.html" target="_blank">List</a> doesn&#8217;t like adding <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTips</a>, via the <a title="Flex 3.5 API - dataTipField" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#dataTipField" target="_blank">dataTipField</a>, to a component that is inline.</p>
<p><strong>The solution:</strong> Simply add a <a title="Flex 3.5 API - toolTip" href="http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#toolTip" target="_blank">toolTip</a> to the inline component. And in my case, bind it to the <a title="Flex 3.5 API - data" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#data" target="_blank">data</a> property that is passed in by the list.</p>
<p><strong>Note:</strong> You don&#8217;t even need to set <a title="Flex 3.5 API - showDataTips" href="http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html#showDataTips" target="_blank">showDataTips</a> to true.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robrusher.com/2010/03/11/list-itemrenderer-tooltip-oh-my/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically Add Components to a Container</title>
		<link>http://www.robrusher.com/2007/04/28/dynamically-add-components-to-a-container/</link>
		<comments>http://www.robrusher.com/2007/04/28/dynamically-add-components-to-a-container/#comments</comments>
		<pubDate>Sun, 29 Apr 2007 04:19:26 +0000</pubDate>
		<dc:creator>Rush</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Flash Platform]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.robrusher.com/?p=27</guid>
		<description><![CDATA[There are many reasons why you might want to add components to containers dynamically. The most common reasons are for performance or flexibility. Either way, having a good understanding of how it works is essential. First a little background information about what these methods are from The addChild and addChildAt methods come from the DisplayObjectContainer [...]]]></description>
			<content:encoded><![CDATA[<p>There are many reasons why you might want to add components to containers dynamically. The most common reasons are for performance or flexibility. Either way, having a good understanding of how it works is essential.</p>
<p>First a little background information about what these methods are from<br />
The addChild and addChildAt methods come from the DisplayObjectContainer class. The DisplayObjectContainer class is an abstract base class for all objects that can contain child objects.   Being an abstract class means that It cannot be instantiated directly. You instantiate a class that implements it, such as Sprite or UIComponent.</p>
<p>DisplayObjectContainer  is the base class for all objects that can serve as display object containers on  the display list. The display list manages all objects displayed in Flash Player.   Use the DisplayObjectContainer class to arrange the display objects in the display list.  Each DisplayObjectContainer object has its own child list for organizing the z-order of the objects.  The z-order is the front-to-back order that determines which object is drawn in front, which is behind,  and so on.</p>
<p>How to do it:</p>
<ol>
<li>Instantiate a component that inherits the methods from DisplayObjectContainer.</li>
<li>Create a method that will instantiate an object to be added.</li>
<li>Set all of the properties to that object and then pass it to the addItem method</li>
</ol>
<div class="code">&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;!&#8211; Simple example to demonstrate the SWFLoader control. &#8211;&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; creationComplete=&#8221;init();&#8221;&gt;</p>
<p>&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
public function init():void<br />
{<br />
var circle1:Sprite = new Sprite();<br />
circle1.graphics.beginFill( 0xFFCC00 );<br />
circle1.graphics.drawCircle( 40, 40, 40 );<br />
circle1.x = 30;<br />
circle1.y = 30;<br />
myLoader.addChild( circle1 );<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;</p>
<p>&lt;mx:Panel title=&#8221;SWFLoader Control Example&#8221;  height=&#8221;90%&#8221; width=&#8221;90%&#8221;<br />
paddingTop=&#8221;10&#8243; paddingBottom=&#8221;10&#8243; paddingLeft=&#8221;10&#8243; paddingRight=&#8221;10&#8243;&gt;</p>
<p>&lt;mx:Label text=&#8221;The Label control of the outer application.&#8221;/&gt;</p>
<p>&lt;mx:SWFLoader id=&#8221;myLoader&#8221; height=&#8221;50&#8243; width=&#8221;350&#8243; click=&#8221;myLoader.visible=false&#8221;/&gt;</p>
<p>&lt;/mx:Panel&gt;<br />
&lt;/mx:Application&gt;</p></div>
<p>In this simple example, I load another swf (not supplied) using the SWFLoader. Upon creationComplete of the application I add a Sprite to the SWFLoader. Note that I also set the x&amp;y position so that both the loaded swf and the Sprite are not at the origin of the SWFLoader.</p>
<p>You can easily substitute the addItem with addItemAt by adding a level argument to the method call. This will determine which item is on top of the other.</p>
<div class="code">myLoader.addChildAt( circle1, 0 );</div>
<p>So there you have it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robrusher.com/2007/04/28/dynamically-add-components-to-a-container/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
