<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2009://34.36322-</id>
  <updated>2009-11-20T15:07:15Z</updated>
  <title>Comments for Multifriend Selection Component (http://www.insideria.com/2009/06/multifriend-selection-componen.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2009://34.36322</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=36322" title="Multifriend Selection Component" />
    <published>2009-06-09T13:00:00Z</published>
    <updated>2009-06-09T13:00:00Z</updated>
    <title>Multifriend Selection Component</title>
    <summary>Welcome back to our series. We will continue to work on components that will help us develop facebook applications faster and with less bugs. There is one quite useful component that will will be used throughout the facebook development and that&apos;s the MultiFriend Selection Component. There is already one developed by facebook and is displayed when using standard FBML.</summary>
    <author>
      <name>Mirza Hatipovic</name>
      
    </author>
    
    <category term="Adobe Feed" />
    
    <category term="Features" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[<div style="text-align: left;">&nbsp;&nbsp;&nbsp;Welcome back to our series. We will continue to work on components that will help us develop Facebook applications faster and with less bugs. There is one quite useful component that will will be used throughout the Facebook development and that's the MultiFriend Selection Component. There is already one developed by Facebook and is displayed when using standard FBML. Here is the image of the typical FBML-based component for friends selection:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img1.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img1.html','popup','width=385,height=322,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img1-thumb-385x322.png" width="385" height="322" alt="article10_img1.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">This is what we want to do in ActionScript. Of course we want to enhance it a bit by using ActionScript visual abilities, but the basic idea will be the same.</div>

<div style="text-align: left;">Of course, you may ask yourself why do we repeat ourselves? The FBML component is a nice one and why do we make the effort to work on it at all? The reason is that we really want to have a collection of Flash based components that work in a similar fashion like the Facebook standard components. Also, we really want to use the power of ActionScript so if we build something similar like to sample above, we will be able to connect a lot more easily to the existing application logic inside the swf. </div>

<div style="text-align: left;">Like in the previous examples, we will build the component based on the architecture we followed earlier. The basic idea behind it is that one one Facebook session will be created and passed to the component. The component will then take care of the logic. In this sample, once the valid Facebook session is created, the component will place the friends in a list and make it look pretty. Also, we will be able to use multiple components in one swf and that's where the real power of this architecture lies. So, now we need to move on and create the component. </div>

<div style="text-align: left;">What we need for the start is a blank swf. So, open the same FLA we worked on in the previous article. Remove all code and components.</div> 
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img2.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img2.html','popup','width=556,height=321,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img2-thumb-400x230.png" width="400" height="230" alt="article10_img2.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">Cool, we are really on the right path right now. Next thing we should do here is to create a valid session for Facebook. So this is accomplished with the following code that was shown in the last article:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">import</span> com.facebook.Facebook;
<span class="category1">import</span> com.facebook.utils.FacebookSessionUtil;

<span class="category1">var</span> fbook:Facebook;
<span class="category1">var</span> session:FacebookSessionUtil = <span class="category1">new</span> FacebookSessionUtil("<span class="quote">MY_API_KEY</span>", "<span class="quote">MY_SECRET</span>", loaderInfo);
fbook = session.facebook;</pre>
</code>

</div></div> 

<div style="text-align: left;">Paste this code inside the first frame of the swf on the actions layer.  Now we have a valid Facebook session and can move on. The next thing we need to do is to examine the structure of the MultiFriend component that we will work on. What parts are in there and how do they work together?</div>

<div style="text-align: left;">First of all the component has two main parts: a text field to type in the names and the movieclip that will appear and act as the auto-complete, just below the text field. You can see the sample on the first image at the top and you get the idea. Now let&#8217;s create one empty component movieclip. I will not repeat the explanation of the two frame structure as I already assume that you mastered it. So, we need a component 300 px wide and 20 px high and it should link to the class called facebookUI. MultiFriendField that we are going to create now. The component will create the text field that will let the application users type in and the auto complete movieclip. Here is the blank class code that will help us:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> fl.core.UIComponent;
  	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoData;
  	<span class="category1">import</span> com.facebook.utils.FacebookSessionUtil;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.FacebookUser;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoFieldValues;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.friends.*;
  	<span class="category1">import</span> com.facebook.commands.users.*;
  	<span class="category1">import</span> com.facebook.commands.friends.*;
  	<span class="category1">import</span> com.facebook.net.FacebookCall;
  	<span class="category1">import</span> com.facebook.events.FacebookEvent;
  	<span class="category1">import</span> com.facebook.Facebook;
 
 
 	<span class="category1">public</span> <span class="category1">class</span> MultiFriendField <span class="category1">extends</span> UIComponent{
  
  		<span class="category1">function</span> MultiFriendField() {
   		}
  
  		override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
   
   			<span class="linecomment">// always call super.configUI() in your implementation</span>
   			<span class="category1">super</span>.configUI();
   
   			<span class="category2">trace</span>("<span class="quote">hi...</span>");
   
   		}
  
  		<span class="category1">public</span> <span class="category1">function</span> <span class="category2">load</span>(fbook:Facebook, uid:<span class="category2">Number</span>):<span class="category1">void</span> {
   			
   		}
  
  		<span class="category1">private</span> <span class="category1">function</span> onInfo(e:FacebookEvent):<span class="category1">void</span>{
   			
   		
   		}
  
  		override protected <span class="category1">function</span> draw():<span class="category1">void</span> {
   
   		    <span class="linecomment">// always call super.draw() at the end</span>
   		    <span class="category1">super</span>.draw();
   
   		}	
  		
  	}
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">This is the basic skeleton of the class MultiFriendField. We need to save it in the facebookUI folder in the project directory and link to MultiFriendField symbol in our library with it.</div>
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img3.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img3.html','popup','width=599,height=403,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img3-thumb-400x269.png" width="400" height="269" alt="article10_img3.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">Now when we run the swf (must not be uploaded in the Facebook canvas), we will see the trace message. If the trace message is showing up then it is a sign that we can move on. If there are errors, then it's better to stop and check the code. Again, now the class needs to create the text field and the auto-complete movieclip. This is done via the addChild method like in the previous article. So, first we need to define the the textfield, this will be done immediately after the class definition line:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">public</span> <span class="category1">class</span> MultiFriendField <span class="category1">extends</span> UIComponent{
 
 	<span class="category1">private</span> <span class="category1">var</span> _inputField:<span class="category2">TextField</span> = <span class="category1">new</span> <span class="category2">TextField</span>();
 
 ...</pre>
</code>

</div></div> 

<div style="text-align: left;">Next thing we need to do is to add it to the stage, and it can be done in the configUI method: </div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
 
 			<span class="linecomment">// always call super.configUI() in your implementation</span>
 			<span class="category1">super</span>.configUI();
 
 			<span class="category1">this</span>.addChild(_inputField);
 			_inputField.<span class="category2">type</span> = "<span class="quote">input</span>";
 			_inputField.<span class="category2">border</span> = <span class="category1">true</span>;
 			_inputField.<span class="category2">width</span> = 300;
 			_inputField.<span class="category2">height</span> = 20;
 
 		}</pre>
</code>

</div></div> 

<div style="text-align: left;">
Now when we run the swf (don't need to compile it), we see the input text field that is resized and we also can type in text. </div>

<br/>

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img4.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img4.html','popup','width=566,height=258,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img4-thumb-400x182.png" width="400" height="182" alt="article10_img4.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">Wait, it would be nice if we could resemble the look and feel of the original Facebook components. We need to use Trebuchet MS font. So here is how it looks like:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
 
 	<span class="linecomment">// always call super.configUI() in your implementation</span>
 	<span class="category1">super</span>.configUI();
 
 	<span class="category1">this</span>.addChild(_inputField);
 			
 	<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
 	tf.<span class="category2">font</span> = "<span class="quote">Trebuchet MS</span>";
 	_inputField.defaultTextFormat = tf;
 			
 	_inputField.<span class="category2">type</span> = "<span class="quote">input</span>";
 	_inputField.<span class="category2">border</span> = <span class="category1">true</span>;
 	_inputField.<span class="category2">width</span> = 300;
 	_inputField.<span class="category2">height</span> = 20;
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">That&#8217;s cool, now when we run the sample we will see the new font and look far more similar to the original Facebook interface. </div>
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img5.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img5.html','popup','width=441,height=204,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img5-thumb-400x185.png" width="400" height="185" alt="article10_img5.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">Cool, it looks now far more pretty then the previous one. We have now implemented the first part of the component with the input text field and it was the easy one. Let's move on to the though part, the movieclip that will actually display the friends. </div>

<div style="text-align: left;">Well, we do need to work a bit with inheritance in this part. First we need to create the clap that will &#8220;snap&#8221; to the text field. Go to Insert -> New Symbol and select new movieclip. Make sure it has the fields set like in the image below.  </div>
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img6.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img6.html','popup','width=584,height=384,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img6-thumb-400x263.png" width="400" height="263" alt="article10_img6.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">As we can see the clip is linked to the class SnapClip. Don&#8217;t ask me why, we will later see that it makes sense. Let&#8217;s create now the SnapClip in the facebookUI folder. Here is how the class looks like here, very simple for now: </div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 
 	<span class="category1">public</span> <span class="category1">class</span> SnapClip <span class="category1">extends</span> <span class="category2">MovieClip</span>{
  		
  		<span class="category1">function</span> SnapClip(){
   			<span class="category1">super</span>();
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> snapTo(t:<span class="category2">TextField</span>):<span class="category1">void</span>{
   			<span class="category1">this</span>.<span class="category2">x</span> = t.<span class="category2">x</span>;
   			<span class="category1">this</span>.<span class="category2">y</span> = t.<span class="category2">y</span> + t.<span class="category2">height</span>;
   		}
  
  	}
 
}</pre>
</code>

</div></div>

<div style="text-align: left;">Save it as SnapClip.as in the facebookUI folder. Now we need to do a few tweaks in the original MultiFriendField class. We will first declare the movieclip:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

...
<span class="category1">private</span> <span class="category1">var</span> _suggestClip:<span class="category2">MovieClip</span> = <span class="category1">new</span> SnapClip();
...</pre>
</code>

</div></div> 

<div style="text-align: left;">here is how the configUI method now looks like:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
 
 			<span class="linecomment">// always call super.configUI() in your implementation</span>
 			<span class="category1">super</span>.configUI();
 
 			<span class="category1">this</span>.addChild(_inputField);
 			
 			<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
 			tf.<span class="category2">font</span> = "<span class="quote">Trebuchet MS</span>";
 			_inputField.defaultTextFormat = tf;
 			
 			_inputField.<span class="category2">type</span> = "<span class="quote">input</span>";
 			_inputField.<span class="category2">border</span> = <span class="category1">true</span>;
 			_inputField.<span class="category2">width</span> = 300;
 			_inputField.<span class="category2">height</span> = 20;
 			
 			<span class="category1">this</span>.addChild(_suggestClip);
 			_suggestClip.snapTo(_inputField);
 			
 
}</pre>
</code>

</div></div> 
   
<div style="text-align: left;">Hmm, I'm pretty sure you may be confused, so here is how the complete class looks like:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> fl.core.UIComponent;
  	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 	<span class="category1">import</span> flash.display.*;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoData;
  	<span class="category1">import</span> com.facebook.utils.FacebookSessionUtil;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.FacebookUser;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoFieldValues;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.friends.*;
  	<span class="category1">import</span> com.facebook.commands.users.*;
  	<span class="category1">import</span> com.facebook.commands.friends.*;
  	<span class="category1">import</span> com.facebook.net.FacebookCall;
  	<span class="category1">import</span> com.facebook.events.FacebookEvent;
  	<span class="category1">import</span> com.facebook.Facebook;
 
 	<span class="category1">public</span> <span class="category1">class</span> MultiFriendField <span class="category1">extends</span> UIComponent{
  
  		<span class="category1">private</span> <span class="category1">var</span> _inputField:<span class="category2">TextField</span> = <span class="category1">new</span> <span class="category2">TextField</span>();
  		<span class="category1">private</span> <span class="category1">var</span> _suggestClip:<span class="category2">MovieClip</span> = <span class="category1">new</span> SnapClip();
  
  		<span class="category1">function</span> MultiFriendField() {
   		}
  
  		override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
   
   			<span class="linecomment">// always call super.configUI() in your implementation</span>
   			<span class="category1">super</span>.configUI();
   
   			<span class="category1">this</span>.addChild(_inputField);
   			
   			<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
   			tf.<span class="category2">font</span> = "<span class="quote">Trebuchet MS</span>";
   			_inputField.defaultTextFormat = tf;
   			
   			_inputField.<span class="category2">type</span> = "<span class="quote">input</span>";
   			_inputField.<span class="category2">border</span> = <span class="category1">true</span>;
   			_inputField.<span class="category2">width</span> = 300;
   			_inputField.<span class="category2">height</span> = 20;
   			
   			<span class="category1">this</span>.addChild(_suggestClip);
   			_suggestClip.snapTo(_inputField);
   			
   
   		}
  
  		override protected <span class="category1">function</span> draw():<span class="category1">void</span> {
   
   		    <span class="linecomment">// always call super.draw() at the end</span>
   		    <span class="category1">super</span>.draw();
   
   		}	
  		
  	}
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">Now let's run the sample. So it should look like this:</div>
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img7.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img7.html','popup','width=531,height=192,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img7-thumb-400x144.png" width="400" height="144" alt="article10_img7.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">I placed one simple rectangle inside the NameSuggest movieclip in order to demonstrate how the movieclip "snaps&#8220; to the text field. This is the desired result. The next step is to "simply&#8220; inherit from this class. We will have the snap functionality integrated and we may call the snapTo() method directly. This is great for us, now as developers we can concentrate on stuff that is more important for the application. So, let's create the skeleton of the class that will derive the SnapClip, here it is:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 
 	<span class="category1">public</span> <span class="category1">class</span> SuggestClip <span class="category1">extends</span> SnapClip{
  
  	
  		
  		<span class="category1">function</span> SuggestClip(){
   
   			<span class="category1">super</span>();
   
   			<span class="category2">trace</span>("<span class="quote">Hello, I'm </span>" + <span class="category1">this</span>);
   
   		}
  				
  	}
 
}</pre>
</code>

</div></div>

<div style="text-align: left;">Well, in the library, we will not link the NameSuggest clip to SnapClip anymore, we will link it just to SuggestClip. </div>
<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img8.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img8.html','popup','width=562,height=312,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img8-thumb-400x222.png" width="400" height="222" alt="article10_img8.png" class="mt-image-none" style="" /></a></span>
<br/>
<div style="text-align: left;">Now, finally when we run it, it should produce the result:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img9.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img9.html','popup','width=423,height=296,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img9-thumb-400x279.png" width="400" height="279" alt="article10_img9.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">That's the desired result. :-) We have the snap functionality, but this time it is handled by the SnapClip. That's cool for us. The SuggestClip will now handle stuff like key board events. The component will make use of the up and down arrow buttons. When the list of friends is displayed, the arrow keys will be used the scroll up and down, like on the image below:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img12.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img12.html','popup','width=385,height=322,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img12-thumb-385x322.png" width="385" height="322" alt="article10_img12.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">So, I hope that the usage of the arrow buttons is clear. Now let's create the key listeners inside the Suggest clip class. This will be done via the activate() / deactivate() methods. As soon as the application user focuses the text field, the name suggestions will be activated:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

_inputField.addEventListener(FocusEvent.FOCUS_IN, focused);</pre>
</code>

</div></div> 

<div style="text-align: left;">and here is the "focused" function:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">private</span> <span class="category1">function</span> focused(e:FocusEvent):<span class="category1">void</span> {
 			
 			<span class="category2">trace</span>("<span class="quote">Field is focused...</span>");
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">Here is now the complete class code for MultiFriendField.as:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> fl.core.UIComponent;
  	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.events.*;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoData;
  	<span class="category1">import</span> com.facebook.utils.FacebookSessionUtil;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.FacebookUser;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.users.GetInfoFieldValues;
  	<span class="category1">import</span> com.facebook.<span class="category2">data</span>.friends.*;
  	<span class="category1">import</span> com.facebook.commands.users.*;
  	<span class="category1">import</span> com.facebook.commands.friends.*;
  	<span class="category1">import</span> com.facebook.net.FacebookCall;
  	<span class="category1">import</span> com.facebook.events.FacebookEvent;
  	<span class="category1">import</span> com.facebook.Facebook;
 
 	<span class="category1">public</span> <span class="category1">class</span> MultiFriendField <span class="category1">extends</span> UIComponent{
  
  		<span class="category1">private</span> <span class="category1">var</span> _inputField:<span class="category2">TextField</span> = <span class="category1">new</span> <span class="category2">TextField</span>();
  		<span class="category1">private</span> <span class="category1">var</span> _suggestClip:<span class="category2">MovieClip</span> = <span class="category1">new</span> SuggestClip();
  
  		<span class="category1">function</span> MultiFriendField() {
   		}
  
  		<span class="category1">private</span> <span class="category1">function</span> focused(e:FocusEvent):<span class="category1">void</span> {
   			
   			<span class="category2">trace</span>("<span class="quote">Field is focused...</span>");
   
   		}
  
  		override protected <span class="category1">function</span> configUI():<span class="category1">void</span> {
   
   			<span class="linecomment">// always call super.configUI() in your implementation</span>
   			<span class="category1">super</span>.configUI();
   
   			<span class="category1">this</span>.addChild(_inputField);
   			
   			<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
   			tf.<span class="category2">font</span> = "<span class="quote">Trebuchet MS</span>";
   			_inputField.defaultTextFormat = tf;
   			
   			_inputField.<span class="category2">type</span> = "<span class="quote">input</span>";
   			_inputField.<span class="category2">border</span> = <span class="category1">true</span>;
   			_inputField.<span class="category2">width</span> = 300;
   			_inputField.<span class="category2">height</span> = 20;
   
   			_inputField.addEventListener(FocusEvent.FOCUS_IN, focused);
   			
   			<span class="category1">this</span>.addChild(_suggestClip);
   			_suggestClip.snapTo(_inputField);
   			
   
   		}
  
  		override protected <span class="category1">function</span> draw():<span class="category1">void</span> {
   
   		    <span class="linecomment">// always call super.draw() at the end</span>
   		    <span class="category1">super</span>.draw();
   
   		}	
  		
  	}
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">Let's run the sample to see if it works. Here is how it looks like:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img10.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img10.html','popup','width=561,height=179,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img10-thumb-400x127.png" width="400" height="127" alt="article10_img10.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">OK, we see now that every time the field is focused, the auto complete needs to be started. Modify the focused function to call the activate method:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">private</span> <span class="category1">function</span> focused(e:FocusEvent):<span class="category1">void</span> {
 			
 	_suggestClip.activate();
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">The activate method is not yet implemented. So, open SuggestClip.as and add the following methods:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">public</span> <span class="category1">function</span> activate():<span class="category1">void</span>{
 	<span class="category2">trace</span>("<span class="quote">Keyboard listening activated...</span>");
 	stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
}

<span class="category1">public</span> <span class="category1">function</span> deactivate():<span class="category1">void</span>{
 	<span class="category2">trace</span>("<span class="quote">Keyboard listening deactivated...</span>");
 	<span class="category1">this</span>.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
}</pre>
</code>

</div></div> 

<div style="text-align: left;">So, now the class SuggestClip is ready to listen for every key input. Here is the keyPressed method that will allow us to capture the key press event:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">private</span> <span class="category1">function</span> keyPressed(e:KeyboardEvent):<span class="category1">void</span> {
 			
 	<span class="category2">trace</span>("<span class="quote">key is pressed...</span>");
 
}</pre>
</code>

</div></div>

<div style="text-align: left;">Now here is the complete overview of the modificed SuggestClip class:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 	<span class="category1">import</span> flash.events.*;
 
 	<span class="category1">public</span> <span class="category1">class</span> SuggestClip <span class="category1">extends</span> SnapClip{
  
  		<span class="category1">function</span> SuggestClip(){
   			<span class="category1">super</span>();
   		}
  
  		<span class="category1">private</span> <span class="category1">function</span> keyPressed(e:KeyboardEvent):<span class="category1">void</span> {
   			<span class="category2">trace</span>("<span class="quote">Key is pressed...&amp;#8220;);
   		}
   
   		public function activate():void{
   			trace(</span>"Keyboard listening activated..."<span class="quote">);
   			stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
   		}
   
   		public function deactivate():void{
   			trace(</span>"Keyboard listening deactivated..."<span class="quote">);
   			this.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
   		}
   		
   	}
   
  }</pre>
</code>

</div></div> 

<div style="text-align: left;">Publish the swf, focus the text field and press on soe of the key on your keyboard, you should see a result similar to this: </div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img11.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img11.html','popup','width=521,height=236,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img11-thumb-400x181.png" width="400" height="181" alt="article10_img11.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">Now, we need to listen when the down and up arrow key is pressed and also we want to check when the enter key is pressed. Later you will see why. Here is the updated keyPressed function:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">private</span> <span class="category1">function</span> keyPressed(e:KeyboardEvent):<span class="category1">void</span> {
 
 	<span class="category1">if</span>(e.keyCode == 40){
  		<span class="category2">trace</span>("<span class="quote">scroll names down...</span>");
  	}
 
 	<span class="category1">if</span>(e.keyCode == 38){
  		<span class="category2">trace</span>("<span class="quote">scroll names up</span>");
  	}
 
 	<span class="category1">if</span>(e.keyCode == 13){
  		<span class="category2">trace</span>("<span class="quote">select this name...</span>");
  	}
 
} </pre>
</code>

</div></div> 

<div style="text-align: left;">From the trace messages we can see what the code intends to do. </div>

<div style="text-align: left;"><strong>Part 2 - Implementing the utility classes</strong></div>

<div style="text-align: left;">We did the first part of the whole job. We created a component has a input text field inside. The SuggestClip, the clip that will display the actual names of the friends is snapped to the text field autoamtically. As soon as it is focused, the key listening is activated. The component listens to the up and down arrow button and the enter key. This is the basic mechanism. </div>

<div style="text-align: left;">What's next?</div>

<div style="text-align: left;">The following 2 classes will play a significant role: the SuggWord.as and the WordButton.as classes. Visually they are on the following locations:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img13.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img13.html','popup','width=385,height=322,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img13-thumb-385x322.png" width="385" height="322" alt="article10_img13.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">SuggWord containts an array of WordButton classes. Every "WordButton&#8220; contains one friend. Once it is clicked, the clips is removed and the text field is filled with the name of the selected friend, just like the original FBML brother. </div>

<div style="text-align: left;">So here is the plan what needs to be done:</div>

<ul>
	<li>Implement the Wordbutton class</li>
	<li>Implement the SuggWord class</li>
	<li>Make it all work together on Facebook</li>
</ul>

<strong><div style="text-align: left;">Implement the WordButton class with the MovieClip</div></strong>

<div style="text-align: left;">When we see the WordButton class on the image above, we notice that it has two states. One default state with white background. On the other side, there is a second rollover state that changes the color of the background. In order to achive that, first we need to implement a MovieClip with 2 states. So go to Insert -> New Symbol and create a MovieClip called WordButton:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img14.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img14.html','popup','width=476,height=188,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img14-thumb-400x157.png" width="400" height="157" alt="article10_img14.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">On the timeline, create the following layer structure:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img15.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img15.html','popup','width=344,height=229,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img15-thumb-344x229.png" width="344" height="229" alt="article10_img15.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">On the lowest BG layer, create 2 frames:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img16.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img16.html','popup','width=326,height=118,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img16-thumb-326x118.png" width="326" height="118" alt="article10_img16.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">Leave the first frame empty and on the second frame, add a simple rectange shape size 200 x 30 px.</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img17.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img17.html','popup','width=489,height=272,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img17-thumb-400x222.png" width="400" height="222" alt="article10_img17.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">On the layer "Field", place the TextField called main_txt. The layer should span 2 frames:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img18.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img18.html','popup','width=398,height=350,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img18-thumb-398x350.png" width="398" height="350" alt="article10_img18.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">On the HiLite layer, place one small rectange with alpha set to 0.3. </div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img19.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img19.html','popup','width=297,height=591,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img19-thumb-297x591.png" width="297" height="591" alt="article10_img19.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">It should be direcly below the text field so it matches the height of the text field. Select it and convert it to a MovieClip. Name it <em>textBG_mc</em>.</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img20.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img20.html','popup','width=309,height=386,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img20-thumb-309x386.png" width="309" height="386" alt="article10_img20.png" class="mt-image-none" style="" /></a></span>
<br/>

<div style="text-align: left;">Finally, leave the Actions layer for now. The MovieClip is now ready, we need to connect it now to the right class. Here is how the WordButton.as looks like:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.events.*;
 	<span class="category1">import</span> flash.<span class="category2">text</span>.*;
 
 	<span class="category1">public</span> <span class="category1">class</span> WordButton <span class="category1">extends</span> <span class="category2">MovieClip</span>{
  		
  		<span class="category1">private</span> <span class="category1">var</span> _word:<span class="category2">String</span> = <span class="category1">null</span>;
  		
  		<span class="category1">function</span> WordButton(){
   			<span class="category1">super</span>();
   			<span class="category2">stop</span>();
   			<span class="category2">init</span>();
   		}
  		
  		<span class="category1">private</span> <span class="category1">function</span> <span class="category2">init</span>():<span class="category1">void</span>{
   			<span class="category1">this</span>.buttonMode = <span class="category1">false</span>;
   			textBG_mc.<span class="category2">width</span> = 0;
   			<span class="category1">this</span>.addEventListener(MouseEvent.ROLL_OVER, rolledOver);
   			<span class="category1">this</span>.addEventListener(MouseEvent.ROLL_OUT, rolledOut);
   		}
  
  		<span class="category1">private</span> <span class="category1">function</span> rolledOver(e:MouseEvent):<span class="category1">void</span> {
   			<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
   			tf.<span class="category2">color</span> = 0xffffff;
   			main_txt.defaultTextFormat = tf;
   			main_txt.<span class="category2">setTextFormat</span>(tf);
   			<span class="category1">this</span>.<span class="category2">gotoAndStop</span>(2);
   		}
  
  		<span class="category1">private</span> <span class="category1">function</span> rolledOut(e:MouseEvent):<span class="category1">void</span> {
   			<span class="category1">var</span> tf:<span class="category2">TextFormat</span> = <span class="category1">new</span> <span class="category2">TextFormat</span>();
   			tf.<span class="category2">color</span> = 0x000000;
   			main_txt.defaultTextFormat = tf;
   			main_txt.<span class="category2">setTextFormat</span>(tf);
   			<span class="category1">this</span>.<span class="category2">gotoAndStop</span>(1);
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> setWord(w:<span class="category2">String</span>, len:<span class="category2">Number</span>):<span class="category1">void</span>{
   			main_txt.<span class="category2">visible</span> = <span class="category1">false</span>;
   			main_txt.<span class="category2">htmlText</span> = "<span class="quote">&lt;b&gt;</span>" + w.<span class="category2">substr</span>(0, len) + "<span class="quote">&lt;/b&gt;</span>";
   			<span class="category1">var</span> wid:<span class="category2">Number</span> = main_txt.<span class="category2">textWidth</span>;
   			main_txt.<span class="category2">htmlText</span> = "<span class="quote">&lt;b&gt;</span>" + w.<span class="category2">substr</span>(0, len) + "<span class="quote">&lt;/b&gt;</span>" + w.<span class="category2">substr</span>(len, w.<span class="category2">length</span>);
   			main_txt.<span class="category2">visible</span> = <span class="category1">true</span>;
   			textBG_mc.<span class="category2">width</span> = wid;
   			_word = w;
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> getWord():<span class="category2">String</span>{
   			<span class="category1">return</span> _word;
   		}
  
  	}
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">Implement the SuggWord class</div>

<div style="text-align: left;">The SuggWord class does not have any MovieClip in the library that is linked to it. It "simply" acts as a container for an array of WordButton clips that will appear as suggestions. </div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

package facebookUI{
 
 	<span class="category1">import</span> flash.display.*;
 	<span class="category1">import</span> flash.events.*;
 
 	<span class="category1">public</span> <span class="category1">class</span> SuggWord <span class="category1">extends</span> <span class="category2">MovieClip</span>{
  		
  		<span class="category1">private</span> <span class="category1">var</span> _focusIndex:<span class="category2">Number</span> = 0;
  		<span class="category1">private</span> <span class="category1">var</span> _currentWord:<span class="category2">String</span> = "<span class="quote"></span>";
  		<span class="category1">private</span> <span class="category1">var</span> _clipCounter:<span class="category2">Number</span> = 0;
  		<span class="category1">private</span> <span class="category1">var</span> _clips:<span class="category2">Object</span> = <span class="category1">new</span> <span class="category2">Object</span>();
  		
  		<span class="category1">function</span> SuggWord(){
   			<span class="category1">super</span>();
   		}
  
  		<span class="category1">public</span> <span class="category1">function</span> clearAll():<span class="category1">void</span> {
   			<span class="category1">while</span> (<span class="category1">this</span>.numChildren){
    				<span class="category1">this</span>.removeChildAt(0);
    			}
   			_clips = <span class="category1">new</span> <span class="category2">Object</span>();
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> wordClicked(e:MouseEvent){
   
   			<span class="category1">var</span> clip = e.currentTarget;
   			dispatchWord(clip.getWord());
   
   		}
  		
  		<span class="category1">private</span> <span class="category1">function</span> dispatchWord(word:<span class="category2">String</span>){
   			<span class="category1">var</span> e:SuperEvent = <span class="category1">new</span> SuperEvent("<span class="quote">wordClicked</span>", <span class="category1">true</span>, <span class="category1">true</span>);
   			e.<span class="category1">add</span>("<span class="quote">word</span>", word);
   			dispatchEvent(e);
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> addWord(t:<span class="category2">String</span>, len:<span class="category2">Number</span>):<span class="category1">void</span>{
   			
   			_clipCounter++;
   			
   			<span class="category1">var</span> word_mc:<span class="category2">MovieClip</span> = <span class="category1">new</span> WordButton();
   			word_mc.<span class="category2">name</span> = "<span class="quote">field</span>" + _clipCounter;
   
   			_clips["<span class="quote">field</span>" + _clipCounter] = word_mc;
   
   			<span class="category1">this</span>.addChild(word_mc);
   			word_mc.setWord(t, len);
   
   			<span class="category1">var</span> clip = _clips["<span class="quote">field</span>" + (_clipCounter - 1)];
   			<span class="category1">var</span> prevClipExists = <span class="category2">Boolean</span>(clip);
   
   			<span class="category1">if</span>(prevClipExists){
    				word_mc.<span class="category2">y</span> = clip.<span class="category2">y</span> + clip.<span class="category2">height</span>;
    			} <span class="category1">else</span> {
    				word_mc.<span class="category2">y</span> = 1;	
    			}
   
   			word_mc.addEventListener(MouseEvent.CLICK, wordClicked);
   			
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> focusPrev():<span class="category1">void</span>{
   			<span class="category1">if</span>(_focusIndex == 0){
    				<span class="category1">return</span>;
    			}
   			_focusIndex--;
   			<span class="category1">this</span>["<span class="quote">field</span>" + (_focusIndex + 1)].rolledOut(<span class="category1">new</span> MouseEvent(MouseEvent.ROLL_OUT));
   			<span class="category1">this</span>["<span class="quote">field</span>" + _focusIndex].rolledOver(<span class="category1">new</span> MouseEvent(MouseEvent.ROLL_OVER));
   			_currentWord = <span class="category1">this</span>["<span class="quote">field</span>" + _focusIndex].getWord();
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> focusNext():<span class="category1">void</span>{
   			<span class="category1">if</span>(_focusIndex == (_clipCounter + 1)){
    				<span class="category1">return</span>;
    			}
   			<span class="category1">this</span>["<span class="quote">field</span>" + (_focusIndex + 1)].rolledOut(<span class="category1">new</span> MouseEvent(MouseEvent.ROLL_OUT));
   			<span class="category1">this</span>["<span class="quote">field</span>" + _focusIndex].rolledOver(<span class="category1">new</span> MouseEvent(MouseEvent.ROLL_OVER));
   			_currentWord = <span class="category1">this</span>["<span class="quote">field</span>" + _focusIndex].getWord();
   			_focusIndex++;
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> focusFirst():<span class="category1">void</span>{
   
   			_focusIndex = 1;
   			<span class="category1">var</span> clip = _clips["<span class="quote">field</span>" + _focusIndex];
   
   			<span class="category1">var</span> clipExists = <span class="category2">Boolean</span>(clip);
   			<span class="category1">if</span>(clipExists){
    				clip.rolledOver(<span class="category1">new</span> MouseEvent(MouseEvent.ROLL_OVER));
    				_currentWord = clip.getWord();
    			}
   
   		}
  		
  		<span class="category1">public</span> <span class="category1">function</span> getWord():<span class="category2">String</span>{
   			<span class="category1">return</span> _currentWord;
   		}
  
  	}
 
}

&lt;div style="<span class="quote">text-align: left;</span>"&gt;Make it all work together <span class="category1">on</span> Facebook&lt;/div&gt;

&lt;div style="<span class="quote">text-align: left;</span>"&gt;So, now let'<span class="quote">s move on and implement the two classes. Return to the class MultiFriendField. Let</span>'s <span class="category2">load</span> the friends <span class="category1">in</span> an array. We need to <span class="category1">add</span> those two methods to the MultiFriendField <span class="category1">class</span>:&lt;/div&gt;

<span class="category1">public</span> <span class="category1">function</span> <span class="category2">load</span>(fbook:Facebook):<span class="category1">void</span> {
 			
 	<span class="category1">var</span> <span class="category2">call</span>:GetFriends = <span class="category1">new</span> GetFriends();
 	<span class="category2">call</span>.addEventListener(FacebookEvent.COMPLETE, onFriends);
 	fbook.post(<span class="category2">call</span>);
 
}

<span class="category1">function</span> onFriends(e:FacebookEvent):<span class="category1">void</span>{
  	
  	<span class="category1">var</span> friends = (e.<span class="category2">data</span> as GetFriendsData).friends;
 	
 	<span class="category1">var</span> i;
 	<span class="category1">var</span> len = friends.<span class="category2">length</span>;
 	<span class="category1">var</span> uids:<span class="category2">Array</span> = <span class="category1">new</span> <span class="category2">Array</span>();
 				
 	<span class="category1">for</span>(i = 0; i &lt; len; i++){
  					
  		<span class="category1">var</span> user = friends.<span class="category2">getItemAt</span>(i) as FacebookUser;
  		uids.<span class="category2">push</span>(user.uid);
  					
  	}
 				
 	<span class="category1">var</span> <span class="category2">call</span>:FacebookCall = fbook.post(<span class="category1">new</span> GetInfo(uids, [GetInfoFieldValues.ALL_VALUES]));
 	<span class="category2">call</span>.addEventListener(FacebookEvent.COMPLETE, onDataRecieve);
 	fbook.post(<span class="category2">call</span>);
 
}

<span class="category1">function</span> onDataRecieve(e:FacebookEvent){
  	
 	<span class="category1">var</span> userData = ((e.<span class="category2">data</span> as GetInfoData).userCollection);
 	<span class="category1">var</span> i;
 	<span class="category1">var</span> len = userData.<span class="category2">length</span>;
 		 
 	<span class="category1">for</span>(i = 0; i &lt; len; i++){
  				
  		<span class="category1">var</span> user = userData.<span class="category2">getItemAt</span>(i);
  		<span class="category2">trace</span>(user.first_name + "<span class="quote"> </span>" + user.last_name);
  		_suggestClip.addWord(user.first_name + "<span class="quote"> </span>" + user.last_name);
  				
  	}
}</pre>
</code>

</div></div> 

<div style="text-align: left;">And on the main timeline, where we start our session, we call the load method:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">import</span> com.facebook.Facebook;
<span class="category1">import</span> com.facebook.utils.FacebookSessionUtil;

<span class="category1">var</span> fbook:Facebook;
<span class="category1">var</span> session:FacebookSessionUtil = <span class="category1">new</span> FacebookSessionUtil("<span class="quote">MY_API_KEY</span>", "<span class="quote">MY_SECRET</span>", loaderInfo);
fbook = session.facebook;

friendsField_mc.<span class="category2">load</span>(fbook);</pre>
</code>

</div></div> 

<div style="text-align: left;">So, once uploaded it should produce the list of friends:</div>

<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img21.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img21.html','popup','width=470,height=369,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img21-thumb-400x314.png" width="400" height="314" alt="article10_img21.png" class="mt-image-none" style="" /></a></span>

<div style="text-align: left;">Ok, in the line:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

_suggestClip.addWord(user.first_name + "<span class="quote"> </span>" + user.last_name);</pre>
</code>

</div></div> 

<div style="text-align: left;">we see that the friends are actually added to the list of suggestions. Finally we will try to see them. So, anytime a user types in text, friends should be suggested. Here is how. </div>

<div style="text-align: left;">Add the CHANGE listener for the text field:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

_inputField.addEventListener(Event.CHANGE, textChanged);</pre>
</code>

</div></div> 

<div style="text-align: left;">and the event function:</div>

<div class="acode" style="overflow:auto;padding:10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>

<span class="category1">private</span> <span class="category1">function</span> textChanged(e:Event):<span class="category1">void</span> {
 						
 	_suggestClip.suggest(_inputField.<span class="category2">text</span>);
 
}</pre>
</code>

</div></div> 

<div style="text-align: left;">And here is the result:</div>

<br/>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.insideria.com/assets_c/2009/05/article10_img22.html" onclick="window.open('http://www.insideria.com/assets_c/2009/05/article10_img22.html','popup','width=357,height=413,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.insideria.com/assets_c/2009/05/article10_img22-thumb-357x413.png" width="357" height="413" alt="article10_img22.png" class="mt-image-none" style="" /></a></span>
<br/>

<strong><div style="text-align: left;">Implementing the details</div></strong>

<div style="text-align: left;">Since I do not have any space to cover all the details that would make the component work, I recommend you to download the FLA and take a look at all the small details that are implemented. I know it sounds a bit odd, but there are details in the code that would need an extra article about it. For me it's important that we covered the core and basic functionality, the rest can be found in the source code that is available for <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://www.insideria.com/MultiFriendC.fla">MultiFriendC.fla</a></span>. </div>

<p><br/>To view the entire series please visit <a href="http://www.insideria.com/series-facebook-dev.html">http://www.insideria.com/series-facebook-dev.html</a></p>
]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2066044</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2066044" />
    <title>Comment from Troy Hunnicutt on 2009-06-11</title>
    <author>
        <name>Troy Hunnicutt</name>
        <uri>http://www.geocities.com/troycutt/Portfolio_troy.html</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.geocities.com/troycutt/Portfolio_troy.html">
        <![CDATA[<p>Mr. Hatipovic,</p>

<p>Reading your step by step “How to ActionScript” concerning Facebook, intrigues me as well as to some degree discourages me. I’m absolutely blown away by your grasp of the Actionscript language; you see I obtained my Bachelor of Visual Communications/Digital Design degree online in 2006. And have not been able to venture into that line of work because of my lack of experience. </p>

<p>What would you suggest that I do to learn ActionScript, I need to learn the basics again, but I need a step by step process to get me started again, what do you suggest? </p>

<p>This is my online portfolio, I understand that it is years behind in today’s savvy aesthetics, how would you improve? <br />
<a href="http://www.geocities.com/troycutt/Portfolio_troy.html">http://www.geocities.com/troycutt/Portfolio_troy.html</a></p>

<p>I would love to do it in Adobe Flash CS3 (I have this version) but I don’t know how?</p>

<p><br />
Thank you for your time,</p>

<p>Troy Hunnicutt<br />
troycutt@aol.com<br />
</p>]]>
    </content>
    <published>2009-06-11T15:18:45Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2066271</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2066271" />
    <title>Comment from Quentin on 2009-06-16</title>
    <author>
        <name>Quentin</name>
        <uri>http://wordpress.lehenaff.fr</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://wordpress.lehenaff.fr">
        <![CDATA[<p>Great exemple... I'm wondering as a Flex (certified ^^) developper how to connect this work with the wonderful Flex AutoComplete component</p>

<p><a href="http://web.me.com/hillelcoren/Site/Demo.html">http://web.me.com/hillelcoren/Site/Demo.html</a></p>

<p>Remember that Flex component are in fact ActionScript classes ;)</p>]]>
    </content>
    <published>2009-06-16T12:03:52Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2066273</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2066273" />
    <title>Comment from Quentin on 2009-06-16</title>
    <author>
        <name>Quentin</name>
        <uri>http://wordpress.lehenaff.fr</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://wordpress.lehenaff.fr">
        <![CDATA[<p>Great exemple... I'm wondering as a Flex (certified ^^) developper how to connect this work with the wonderful Flex AutoComplete component</p>

<p><a href="http://web.me.com/hillelcoren/Site/Demo.html">http://web.me.com/hillelcoren/Site/Demo.html</a></p>

<p>Remember that Flex component are in fact ActionScript classes ;)</p>]]>
    </content>
    <published>2009-06-16T12:07:20Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2066288</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2066288" />
    <title>Comment from Mirza on 2009-06-16</title>
    <author>
        <name>Mirza</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi Quentin :-)</p>

<p>well the sample looks great.</p>

<p>I think the component must have some sort of DataProvider that you can utilize, right?</p>

<p>Regards,<br />
Mirza</p>]]>
    </content>
    <published>2009-06-16T15:45:28Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2068160</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2068160" />
    <title>Comment from AP on 2009-07-13</title>
    <author>
        <name>AP</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi,</p>

<p>Great job and very useful for me because I develop a facebook application with Flex but what is the type of friendsField_mc textarea, datagrid ....?</p>

<p>Thank you for your reply</p>]]>
    </content>
    <published>2009-07-13T09:28:04Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2068161</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2068161" />
    <title>Comment from Amelie on 2009-07-13</title>
    <author>
        <name>Amelie</name>
        <uri>http://no</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://no">
        <![CDATA[<p>Hi,</p>

<p>Great job and very useful for me because I develop a facebook application with Flex but what is the type of friendsField_mc textarea, datagrid ....?</p>

<p>Thank you for your reply<br />
</p>]]>
    </content>
    <published>2009-07-13T09:29:18Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2068815</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2068815" />
    <title>Comment from milt on 2009-07-22</title>
    <author>
        <name>milt</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Really a good job mate. It is very useful and it helps me in devolping my applications in Facebook.And it will be used throughout the Facebook development.<a href="http://valwriting.com/thesis_writing">Thesis Writing</a><br />
Thanks, </p>]]>
    </content>
    <published>2009-07-22T16:15:39Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2069805</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2069805" />
    <title>Comment from pamils on 2009-08-05</title>
    <author>
        <name>pamils</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This is already one developed by Facebook and is displayed when using standard FBML. Here is the image of the typical FBML-based component for many. <a href="http://www.apexprofessionalsllc.org/">Timeshare</a><br />
regards, </p>]]>
    </content>
    <published>2009-08-05T08:38:44Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2070037</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2070037" />
    <title>Comment from preissa on 2009-08-09</title>
    <author>
        <name>preissa</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hello sir.This is darren.Well i would like to say that I’m absolutely blown away by your grasp of the Actionscript language; you see I obtained my Bachelor of Visual Communications/Digital Design degree online in 2006. And have not been able to venture into that line of work because of my lack of experience. <a href="http://www.lamps-lighting.com/murray-feiss.html">Murray Feiss Lighting</a><br />
</p>]]>
    </content>
    <published>2009-08-09T15:03:28Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2070116</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2070116" />
    <title>Comment from vexter on 2009-08-11</title>
    <author>
        <name>vexter</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>What would you suggest that I do to learn ActionScript, I need to learn the basics again, but I need a step by step process to get me started again, what do you suggest?<br />
<a href="http://www.powernetshop.at/alpine-ls-kfz/">Lautsprecher</a><br />
</p>]]>
    </content>
    <published>2009-08-11T08:05:37Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2070146</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2070146" />
    <title>Comment from Rachel on 2009-08-11</title>
    <author>
        <name>Rachel</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>O'Reilly has some ActionScript resources that might be helpful:</p>

<p>Learning ActionScript 3.0<br />
<a href="http://oreilly.com/catalog/9780596527877/"><a href="http://oreilly.com/catalog/9780596527877/">http://oreilly.com/catalog/9780596527877/</a></a></p>

<p>Essential ActionScript 3.0<br />
<a href="http://oreilly.com/catalog/9780596526948/"><a href="http://oreilly.com/catalog/9780596526948/">http://oreilly.com/catalog/9780596526948/</a></a></p>

<p>Colin Moock's Lost ActionScript 3.0 Weekend Videos<br />
<a href="http://oreilly.com/catalog/9780596801526"><a href="http://oreilly.com/catalog/9780596801526">http://oreilly.com/catalog/9780596801526</a></a><br />
<a href="http://oreilly.com/catalog/9780596801533"><a href="http://oreilly.com/catalog/9780596801533">http://oreilly.com/catalog/9780596801533</a></a></p>

<p>InsideRIA also has excerpts from some ActionScript books and videos available at <a href="http://insideria.com/book-excerpts.html"><a href="http://insideria.com/book-excerpts.html">http://insideria.com/book-excerpts.html</a></a>.</p>]]>
    </content>
    <published>2009-08-11T15:13:57Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2070360</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2070360" />
    <title>Comment from dydf on 2009-08-13</title>
    <author>
        <name>dydf</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I work for a government department here is Sydney Australia. We service public education. It is a requirement for us to have W3C accessibility. We try as best we can to comply. I run a small team of Flex and Flash developers and we constantly deal with support for keyboard tabbing, alt text/tool tips, video captioning, audio transcripts, alternative text/non-Flash versions, assistive technology support, colour contrast and other similar tasks for our rich Internet apps that we develop.thanks for sharing <br />
Regards,<br />
Petter </p>]]>
    </content>
    <published>2009-08-14T05:21:48Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2070794</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2070794" />
    <title>Comment from dasas on 2009-08-21</title>
    <author>
        <name>dasas</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>To see more just about Multifriend Selection Component, I buy essays for sale or <a href="http://www.exclusivepapers.com">custom written essays</a> at the term paper writing service. The numbers of paper writing services propose the <a href="http://www.exclusivepapers.com">essay writing example</a> just about Multifriend Selection Component. </p>]]>
    </content>
    <published>2009-08-21T10:10:59Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2078889</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2078889" />
    <title>Comment from markweee on 2009-09-02</title>
    <author>
        <name>markweee</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>“We often need to take education out of the classroom and meet citizens where they are, rather than always asking them to come in to us,” the new chair, Dr. Sheila Riggs, said.<br />
<a href="http://www.mustuniversity.com/Must/EarnCollegeDegree.asp">earn degree</a>  AND <a href="http://www.mustuniversity.com/Schools-Majors/Performing-Arts/Music.html">Music degree</a> <br />
</p>]]>
    </content>
    <published>2009-09-02T07:17:25Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2078899</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2078899" />
    <title>Comment from markweee on 2009-09-02</title>
    <author>
        <name>markweee</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>“We often need to take education out of the classroom and meet citizens where they are, rather than always asking them to come in to us,” the new chair, Dr. Sheila Riggs, said.<br />
<a href="http://www.mustuniversity.com/Schools-Majors/Social-Services/Human-Services.html">human services degree</a> </p>]]>
    </content>
    <published>2009-09-02T07:23:55Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2078906</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2078906" />
    <title>Comment from Anonymous on 2009-09-02</title>
    <author>
        <name>Anonymous</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Aside from lecturing students and performing research, the newly-hired chair of the University of Minnesota’s Department of Primary Dental Care said, in her new job, she will strive to keep the community informed about their dental health.<br />
<a href="http://www.mustuniversity.com/Schools-Majors/Social-Sciences/History.html">history degree</a> AND <a href="http://www.mustuniversity.com/Must/EarnCollegeDegree.asp">get degree</a> </p>]]>
    </content>
    <published>2009-09-02T07:30:29Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2082721</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2082721" />
    <title>Comment from Bill Walles on 2009-09-04</title>
    <author>
        <name>Bill Walles</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I was fairly fascinated after<br />
accepting above-written topic .<br />
Anyway, as you wish<br />
to memorize concerning develop Facebook or <br />
get a well done<br />
essay about it, click <a href=" <a href=">custom">http://www.primewritings.com">custom</a> writing and<br />
make a request.<br />
</p>]]>
    </content>
    <published>2009-09-04T07:52:11Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2093348</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2093348" />
    <title>Comment from Luke on 2009-09-11</title>
    <author>
        <name>Luke</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This is incomplete!<br />
I tried the tutorial but there are bit of code missing all over the place.<br />
There still no where to download the SuperEvent.as file, you never told us how to finish SuggestClip.as because there's no suggest() function.</p>

<p>:L</p>]]>
    </content>
    <published>2009-09-11T15:22:56Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2094864</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2094864" />
    <title>Comment from Mike on 2009-09-12</title>
    <author>
        <name>Mike</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This component rocks, it's working fine for me, don't know what these other people are talking about.<br />
<a href="http://www.bromoney.com/cd-rates">cd rates</a><br />
Regards.</p>]]>
    </content>
    <published>2009-09-12T20:17:13Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2107637</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2107637" />
    <title>Comment from AnnaLee on 2009-09-21</title>
    <author>
        <name>AnnaLee</name>
        <uri>http://www.essayslab.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.essayslab.com">
        <![CDATA[<p>We get know close to Multifriend Selection Component  from the different sources. Nevertheless, everybody will propose to <a href="http://www.essayslab.com">buy an essay</a> using the essay writing service. Thus, they from time to time order custom write. </p>

<p><br />
</p>]]>
    </content>
    <published>2009-09-21T07:20:36Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2112655</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2112655" />
    <title>Comment from gramews on 2009-09-23</title>
    <author>
        <name>gramews</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This is a well stated explanation of this <a href="http://paramountessays.com/">Write My Essay</a>. I will not repeat the explanation of the two frame structure as I already assume that you mastered it. So, we need a component 300 px wide and 20 px high and it should link to the class called facebookUI. MultiFriendField that we are going to create now.<br />
Regards,</p>]]>
    </content>
    <published>2009-09-23T11:45:19Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2114152</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2114152" />
    <title>Comment from buy essays on 2009-09-24</title>
    <author>
        <name>buy essays</name>
        <uri>http://www.supremeessays.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.supremeessays.com">
        <![CDATA[<p>I suppose, it is hot stuff about Multifriend Selection Component. Everyone will <a href="http://www.supremeessays.com">buy essay papers</a> or pre written essays at the paper writing service.     <br />
</p>]]>
    </content>
    <published>2009-09-24T08:50:10Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2114244</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2114244" />
    <title>Comment from extenze review on 2009-09-24</title>
    <author>
        <name>extenze review</name>
        <uri>http://www.doesextenzework.org/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.doesextenzework.org/">
        <![CDATA[<p>“We often need to take education out of the classroom and meet citizens where they are, rather than always asking them to come in to us,” the new chair, Dr. Sheila Riggs, said.</p>]]>
    </content>
    <published>2009-09-24T09:59:53Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2114258</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2114258" />
    <title>Comment from extenze review on 2009-09-24</title>
    <author>
        <name>extenze review</name>
        <uri>http://www.doesextenzework.org/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.doesextenzework.org/">
        <![CDATA[<p>Really a good job mate. It is very useful and it helps me in devolping my applications in Facebook.And it will be used throughout the Facebook development</p>]]>
    </content>
    <published>2009-09-24T10:03:34Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2115845</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2115845" />
    <title>Comment from AnnaLee on 2009-09-25</title>
    <author>
        <name>AnnaLee</name>
        <uri>http://www.essayslab.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.essayslab.com">
        <![CDATA[<p>Hot story referring to Multifriend Selection Component! In fact, it is worth to <a href="http://www.essayslab.com">buy an essay</a> to receive a success! </p>

<p><br />
</p>]]>
    </content>
    <published>2009-09-25T07:10:18Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2116250</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2116250" />
    <title>Comment from hellfire on 2009-09-25</title>
    <author>
        <name>hellfire</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This was more easy to <a href="http://bestwritingservice.com/buy-essay.html">buy an essay</a> and some students don’t get know that such good research just about this application could exists and because of it we <a href="http://www.bestwritingservice.com">buy term papers</a>.               </p>]]>
    </content>
    <published>2009-09-25T11:37:31Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2116251</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2116251" />
    <title>Comment from hellfire on 2009-09-25</title>
    <author>
        <name>hellfire</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This was more easy to <a href="http://bestwritingservice.com/buy-essay.html">buy an essay</a> and some students don’t get know that such good research just about this application could exists and because of it we <a href="http://www.bestwritingservice.com">buy term papers</a>.               </p>]]>
    </content>
    <published>2009-09-25T11:38:37Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2116711</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2116711" />
    <title>Comment from John Wade on 2009-09-25</title>
    <author>
        <name>John Wade</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>What would you suggest that I do to learn ActionScript, I need to learn the basics again, but I need a step by step process to get me started again, what do you suggest? <a href="http://www.background-check-tips.com/blog/2009/09/03/access-to-free-death-records-provides-information-peace-of-mind/">free death records</a> | </p>]]>
    </content>
    <published>2009-09-25T19:31:37Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2117719</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2117719" />
    <title>Comment from Andrew Lukas on 2009-09-26</title>
    <author>
        <name>Andrew Lukas</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>It's distinguished for you to hold dear though, you need to <a href=" <a href=">http://www.essaysprofessors.com</a> ">buy term paper or <a href=" <a href=">http://www.essaysprofessors.com</a> ">buy research papers just because a school isn't the finest at everything doesn't mean it can't be the best at sparse things. Essays blogs can keep more usefull for your article  you can also buy essay. But first of all, my gratitude to this article, it has a  actuation.</p>]]>
    </content>
    <published>2009-09-26T13:43:40Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2121395</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2121395" />
    <title>Comment from sacha on 2009-09-29</title>
    <author>
        <name>sacha</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>   Some papers writing services offer intereating interesting just about good, thus <a href=" <a href=">buy">http://www.gogetessays.com">buy</a> custom essay papers or  buy a term paper to get know some facts about good.  </p>]]>
    </content>
    <published>2009-09-29T16:09:47Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2123490</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2123490" />
    <title>Comment from Ram on 2009-10-01</title>
    <author>
        <name>Ram</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>we really want to use the power of ActionScript so if we build something similar like to sample above, we will be able to connect a lot more easily to the existing application logic inside the swf.<br />
<a href="http://www.alton-towers.org.uk/">Alton Towers</a><br />
Regards,</p>]]>
    </content>
    <published>2009-10-01T07:42:22Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2124294</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2124294" />
    <title>Comment from chat on 2009-10-01</title>
    <author>
        <name>chat</name>
        <uri>http://www.webalem.net</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.webalem.net">
        <![CDATA[<p>I saw this fellow while visiting Storm King Art Center over the weekend and admired his unique and colorful style. He looks ready for an adventure in his straw hat and heavy boots, but seems quite content taking a little rest on a nearby bench.</p>]]>
    </content>
    <published>2009-10-01T20:43:44Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2130499</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2130499" />
    <title>Comment from Emo on 2009-10-07</title>
    <author>
        <name>Emo</name>
        <uri>http://www.emo-site.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.emo-site.com">
        <![CDATA[<p>Well i would like to say that I’m absolutely blown away by your grasp of the Actionscript language; you see I obtained my Bachelor of Visual Communications/Digital Design degree online in 2006. And have not been able to venture into that emo line of work because of my lack of experience.<br />
<a href="http://www.emo-site.com">emo</a><br />
</p>]]>
    </content>
    <published>2009-10-07T08:45:08Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2130615</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2130615" />
    <title>Comment from Alice on 2009-10-07</title>
    <author>
        <name>Alice</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Well its really good to see such tutorial you have explained very well but my problem is that i always used flash as a tool never tried action script i just get some points and even understand how it is working but i feel that i dont have courage enough to work on action script..so i switched to vector graphics and <a href="http://www.logoinn.com">logo design</a> work but still i love to learn action script.</p>]]>
    </content>
    <published>2009-10-07T12:25:42Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2132896</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2132896" />
    <title>Comment from Sharon on 2009-10-09</title>
    <author>
        <name>Sharon</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>I saw this fellow while visiting Storm King Art Center over the weekend and admired his unique and colorful style. He looks ready for an adventure in his straw hat and heavy boots, <a href="http://www.couponsmarter.com">coupons</a> are good</p>]]>
    </content>
    <published>2009-10-09T07:01:19Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2138232</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2138232" />
    <title>Comment from Baba on 2009-10-13</title>
    <author>
        <name>Baba</name>
        <uri>http://www.babapandey.com/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.babapandey.com/">
        <![CDATA[<p>You have posted great Article as always. I have read about 60% of your articles and have learned much about coding and programing.<br />
Thanks a lot.<br />
<a href="http://www.cgiutil.com/">Cgi Util</a></p>]]>
    </content>
    <published>2009-10-13T10:09:49Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2168283</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2168283" />
    <title>Comment from brew norman on 2009-11-02</title>
    <author>
        <name>brew norman</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>everything worked in part 1, but when i try part 2 of this tutorial i get this error:<br />
scene 1, layer actions, frame 1, line 8: 1061: Call to a possibly undefined method load through a reference with static type facebookUI:MultiFriendField.</p>

<p>line 8: friendsField_mc.load(fbook);</p>

<p>the code is exactly what is here, copy and paste, with the div style comments removed from the suggword.as file.</p>

<p>any suggestions?</p>]]>
    </content>
    <published>2009-11-02T14:42:39Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2172338</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2172338" />
    <title>Comment from Whit on 2009-11-04</title>
    <author>
        <name>Whit</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Thank you! Very useful </p>]]>
    </content>
    <published>2009-11-05T00:13:04Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.36322-comment:2188176</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.36322" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/06/multifriend-selection-componen.html#comment-2188176" />
    <title>Comment from Faraz Khan on 2009-11-15</title>
    <author>
        <name>Faraz Khan</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Excellent article.. the screenshots really helped the tutorial.. but why would you need to make an app for facebook that already exists.. i may be wrong but doesnt facebook already have this option?<br />
-faraz from <a href="http://bluerayrippers.blogspot.com/">blu ray ripper</a></p>]]>
    </content>
    <published>2009-11-15T19:29:15Z</published>
  </entry>

</feed
