<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>manewc &#187; Flash Components</title>
	<atom:link href="http://manewc.com/category/flash-components/feed/" rel="self" type="application/rss+xml" />
	<link>http://manewc.com</link>
	<description>iPhone, Flash, Flex, AIR, &#38; Web Development</description>
	<lastBuildDate>Sat, 31 Oct 2009 16:47:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TextArea Component</title>
		<link>http://manewc.com/2008/10/02/textarea-component/</link>
		<comments>http://manewc.com/2008/10/02/textarea-component/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 17:16:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/?p=209</guid>
		<description><![CDATA[So I was in need of using the TextArea Component because it offers the scrollbar attachment ability. Out of the box it works fine, but I wanted to get rid of the border and just display the scrollbar. I found a simple solution to do this with this line of code:

myTextAreaComponent.setStyle("upSkin",Sprite);

This was great, but if [...]]]></description>
			<content:encoded><![CDATA[<p>So I was in need of using the TextArea Component because it offers the scrollbar attachment ability. Out of the box it works fine, but I wanted to get rid of the border and just display the scrollbar. I found a simple solution to do this with this line of code:</p>
<pre name="code" class="c-sharp">
myTextAreaComponent.setStyle("upSkin",Sprite);
</pre>
<p>This was great, but if the user clicked anywhere within the text area, there would be this blue border that appeared.. so to get rid of that, I used this line of code:</p>
<pre name="code" class="c-sharp">
myTextAreaComponent.setStyle("focusRectSkin",Sprite);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/10/02/textarea-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checkbox Component</title>
		<link>http://manewc.com/2008/07/30/checkbox-component/</link>
		<comments>http://manewc.com/2008/07/30/checkbox-component/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 17:30:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/?p=159</guid>
		<description><![CDATA[A little piece that utilized the Checkbox component, Button component, and Yahoo!&#8217;s Alert Manager component. Things like this are probably more appropriate for Flex and MXML, but for now I will stick with CS3.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Main_266626073"
			class="flashmovie"
			width="700"
			height="300">
	<param name="movie" value="/projects/flash/Checkboxes/Main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/Checkboxes/Main.swf"
			name="fm_Main_266626073"
			width="700"
			height="300">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

package
{
	// Components Used:
	// --------------------
	// Yahoo! Alert Manager
	// Button
	// CheckBox

	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import com.yahoo.astra.fl.managers.AlertManager;
	import fl.controls.Button;
	import fl.controls.CheckBox;

	public class Main extends Sprite
	{
		private [...]]]></description>
			<content:encoded><![CDATA[<p>A little piece that utilized the Checkbox component, Button component, and Yahoo!&#8217;s Alert Manager component. Things like this are probably more appropriate for Flex and MXML, but for now I will stick with CS3.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Main_408281567"
			class="flashmovie"
			width="700"
			height="300">
	<param name="movie" value="/projects/flash/Checkboxes/Main.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/Checkboxes/Main.swf"
			name="fm_Main_408281567"
			width="700"
			height="300">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<pre name="code" class="c-sharp">
package
{
	// Components Used:
	// --------------------
	// Yahoo! Alert Manager
	// Button
	// CheckBox

	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import com.yahoo.astra.fl.managers.AlertManager;
	import fl.controls.Button;
	import fl.controls.CheckBox;

	public class Main extends Sprite
	{
		private var cb:CheckBox;
		private var cb2:CheckBox;
		private var checkBoxStatus:String = "";
		private var cbArr:Array;

		public function Main()
		{
			// CHECK BOX 1
			cb = new CheckBox();
			cb.label = "Checkbox 1";
			cb.x = 10;
			cb.y = 10;

			cb.addEventListener ( MouseEvent.CLICK, alertCheck );

			addChild ( cb );

			// CHECK BOX 2
			cb2 = new CheckBox();
			cb2.label = "Checkbox 2";
			cb2.x = 100;
			cb2.y = 10;

			cb2.addEventListener ( MouseEvent.CLICK, alertCheck );

			addChild ( cb2 );

			// NEW BUTTON
			var button:Button = new Button();
            button.width = 150;
            button.height = 30;
            button.move ( stage.stageWidth / 2 - button.width / 2, stage.stageHeight / 2 - button.height / 2 );
            button.label = "Check Checkboxes";  

            addChild(button);  

            button.addEventListener(MouseEvent.CLICK, alert);
		}

		//event handler to trigger the alert
       	function alert(m:MouseEvent):void
		{
			cbArr = new Array();

			if ( cb.selected ) cbArr.push ( cb.label );

			if ( cb2.selected ) cbArr.push ( cb2.label );

			if ( cbArr.length > 0 )
			{
				checkBoxStatus = "Checked Boxes: " + cbArr;
			}
			else
			{
				checkBoxStatus = "No checkbox values found.";
			}

			AlertManager.createAlert(this, checkBoxStatus, "ALL CHECKBOXES",["close alert"]);
		}

		function alertCheck (m:MouseEvent)
		{
			AlertManager.createAlert(this, m.currentTarget.label + " was checked - the value is: " + m.currentTarget.selected, "Checkbox Status",["close alert"]);
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/07/30/checkbox-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Label Component</title>
		<link>http://manewc.com/2008/07/21/label-component/</link>
		<comments>http://manewc.com/2008/07/21/label-component/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 20:43:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/?p=152</guid>
		<description><![CDATA[The Label Component is described as: A Label component displays one or more lines of plain or HTML-formatted text that can be formatted for alignment and size.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_LabelComponent_1186493124"
			class="flashmovie"
			width="700"
			height="50">
	<param name="movie" value="/projects/flash/LabelComponent/LabelComponent.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/LabelComponent/LabelComponent.swf"
			name="fm_LabelComponent_1186493124"
			width="700"
			height="50">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

package
{
	import flash.display.MovieClip;
	import flash.text.TextFieldAutoSize;
	import fl.controls.Label;

	public class LabelComponent extends MovieClip
	{

		public function LabelComponent()
		{
			var myStr:String = "This is a test of the Label Component - This is a test [...]]]></description>
			<content:encoded><![CDATA[<p>The Label Component is described as: A Label component displays one or more lines of plain or HTML-formatted text that can be formatted for alignment and size.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_LabelComponent_1453750504"
			class="flashmovie"
			width="700"
			height="50">
	<param name="movie" value="/projects/flash/LabelComponent/LabelComponent.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/LabelComponent/LabelComponent.swf"
			name="fm_LabelComponent_1453750504"
			width="700"
			height="50">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<pre name="code" class="c-sharp">
package
{
	import flash.display.MovieClip;
	import flash.text.TextFieldAutoSize;
	import fl.controls.Label;

	public class LabelComponent extends MovieClip
	{

		public function LabelComponent()
		{
			var myStr:String = "This is a test of the Label Component - This is a test of the Label Component";
			var myLbl:Label = new Label();

			myLbl.move(10,10);
			myLbl.width = stage.stageWidth;
			myLbl.height = stage.stageHeight;
			myLbl.text = myStr;
			myLbl.autoSize = TextFieldAutoSize.LEFT;
			addChild(myLbl);
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/07/21/label-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Focus Events</title>
		<link>http://manewc.com/2008/07/15/focus-events/</link>
		<comments>http://manewc.com/2008/07/15/focus-events/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 18:16:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/?p=148</guid>
		<description><![CDATA[So I found this little demo within the Adobe docs, so I decided to add it to my site for future reference. ( I wish I saved the link to the original files, when I find it I will post it)

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_FocusEvents_628784054"
			class="flashmovie"
			width="700"
			height="100">
	<param name="movie" value="/projects/flash/FocusEvents/FocusEvents.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/FocusEvents/FocusEvents.swf"
			name="fm_FocusEvents_628784054"
			width="700"
			height="100">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>

package {
    import flash.display.Sprite;
    import [...]]]></description>
			<content:encoded><![CDATA[<p>So I found this little demo within the Adobe docs, so I decided to add it to my site for future reference. ( I wish I saved the link to the original files, when I find it I will post it)</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_FocusEvents_1316221746"
			class="flashmovie"
			width="700"
			height="100">
	<param name="movie" value="/projects/flash/FocusEvents/FocusEvents.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/FocusEvents/FocusEvents.swf"
			name="fm_FocusEvents_1316221746"
			width="700"
			height="100">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<pre name="code" class="c-sharp">
package {
    import flash.display.Sprite;
    import flash.display.DisplayObject;
    import flash.events.FocusEvent;
    import flash.events.IEventDispatcher;

    public class FocusEvents extends Sprite {
        private var gutter:uint = 50;
        private var childCount:uint = 5;

        public function FocusEvents() {
            var child:Sprite;
            for(var i:uint; i < childCount; i++) {
                child = new CustomSprite();
                configureListeners(child);
                addChild(child);
            }
            refreshLayout();
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
            dispatcher.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
            dispatcher.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
        }

        private function refreshLayout():void {
            var ln:uint = numChildren;
            var child:DisplayObject = getChildAt(0);
            var lastChild:DisplayObject = child;
            for(var i:uint = 1; i < ln; i++) {
                child = getChildAt(i);
                child.x = lastChild.x + lastChild.width + gutter;
                lastChild = child;
            }
        }

        private function focusInHandler(event:FocusEvent):void {
            var target:CustomSprite = CustomSprite(event.target);
        }

        private function focusOutHandler(event:FocusEvent):void {
            var target:CustomSprite = CustomSprite(event.target);
        }

        private function mouseFocusChangeHandler(event:FocusEvent):void {
            var target:CustomSprite = CustomSprite(event.target);
        }
    }
}

import flash.display.Sprite;
import flash.events.MouseEvent;

class CustomSprite extends Sprite {
    private var size:uint = 100;
    private var bgColor:uint = 0x336699;

    public function CustomSprite() {
        buttonMode = true;
        useHandCursor = true;
        addEventListener(MouseEvent.CLICK, clickHandler);
        draw(size, size);
    }

    private function draw(w:uint, h:uint):void {
        graphics.beginFill(bgColor);
        graphics.drawRect(0, 0, w, h);
        graphics.endFill();
    }

    private function clickHandler(event:MouseEvent):void {
        var target:Sprite = Sprite(event.target);
        stage.focus = target;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/07/15/focus-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DataGrid Styles</title>
		<link>http://manewc.com/2008/07/14/datagrid-styles/</link>
		<comments>http://manewc.com/2008/07/14/datagrid-styles/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 17:59:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/?p=147</guid>
		<description><![CDATA[I recently had an inquiry about the ability to change the row font color of the datagrid component on rollover &#8211; with this in mind, I wanted to explore more with the styling of the component. So far, we have the ability to change the background color on rollover, but not the font color &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an inquiry about the ability to change the row font color of the datagrid component on rollover &#8211; with this in mind, I wanted to explore more with the styling of the component. So far, we have the ability to change the background color on rollover, but not the font color &#8211; still looking for a solution for this.</p>
<p>The CustomRowColors.as file grabbed from: <a href="http://blogs.adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html">http://blogs.adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html</a></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_DataGridExample_1402897708"
			class="flashmovie"
			width="700"
			height="120">
	<param name="movie" value="/projects/flash/DataGridStyles/DataGridExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/DataGridStyles/DataGridExample.swf"
			name="fm_DataGridExample_1402897708"
			width="700"
			height="120">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You change fonts by setting a custom text format using a TextFormat object, and the setStyle() or setRendererStyle() methods. If you want to set the text format for a DataGrid component&#8217;s header, use the setStyle() method along with the headerTextFormat style. If you want to set the text format for each row in the DataGrid component, use the setRendererStyle() method along with the textFormat style. Here is the updated DataGridExample.as file:</p>
<pre name="code" class="c-sharp">
package
{
	import flash.display.MovieClip;
	import fl.controls.DataGrid;
	import fl.data.DataProvider;
	import flash.text.TextFormat;
	import flash.events.MouseEvent;

	public class DataGridExample extends MovieClip
	{

		private var myDataGrid:DataGrid;
		private var myDP:DataProvider;

		public function DataGridExample()
		{
			var tfh:TextFormat = new TextFormat();
			tfh.color = 0xff0000;

			var tf:TextFormat = new TextFormat();
			tf.font = "Times New Roman";

			var myDP:DataProvider = new DataProvider();
			myDP.addItem({ID:"01", Name:"Morgan", Email:"Morgan@blah.com", Web:"manewc.com", rowColor:"green"});
			myDP.addItem({ID:"02", Name:"Ashley", Email:"Ashley@blah.com", Web:"google.com", rowColor:"red"});
			myDP.addItem({ID:"03", Name:"Michael", Email:"Michael@blah.com", Web:"yahoo.com", rowColor:"green"});

			var myDataGrid:DataGrid = new DataGrid();
			myDataGrid.setStyle("headerTextFormat", tfh); // for the headers
			myDataGrid.setRendererStyle("textFormat", tf); // for each row

			myDataGrid.setStyle("cellRenderer", CustomRowColors);
			myDataGrid.addColumn("ID");
			myDataGrid.addColumn("Name");
			myDataGrid.addColumn("Email");
			myDataGrid.addColumn("Web");
			myDataGrid.dataProvider = myDP;
			myDataGrid.width = 680;
			myDataGrid.move(10, 10);
			addChild(myDataGrid);
		}

	}
}
</pre>
<p>and the CustomRowColors.as file:</p>
<pre name="code" class="c-sharp">
// found: http://blogs.adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html
package {

    // Import the required component classes.
    import fl.controls.listClasses.CellRenderer;
    import fl.controls.listClasses.ICellRenderer;

	/**
	* This class sets the upSkin style based on the current item's rowColor value
	* in the data provider.
	* Make sure the class is marked "public" and in the case of our custom cell renderer,
	* extends the CellRenderer class and implements the ICellRenderer interface.
	*/
	public class CustomRowColors extends CellRenderer implements ICellRenderer
	{
		/**
		* Constructor.
		*/
		public function CustomRowColors():void {
			super();
		}

		/**
		* This method returns the style definition object from the CellRenderer class.
		*/
		public static function getStyleDefinition():Object
		{
			return CellRenderer.getStyleDefinition();
		}

		/**
		* This method overrides the inherited drawBackground() method and sets the renderer's
		* upSkin style based on the row's rowColor value in the data provider. For example,
		* if the item's rowColor value is "green", the upSkin style is set to the
		* CellRenderer_upSkinGreen linkage in the library. If the rowColor value is "red", the
		* upSkin style is set to the CellRenderer_upSkinRed linkage in the library.
		*/
		override protected function drawBackground():void
		{
			switch (data.rowColor)
			{
				case "green":
					setStyle("upSkin", CellRenderer_upSkinGreen);
					setStyle("overSkin", CellRenderer_upSkinWhite);
					break;
				case "red":
					setStyle("upSkin", CellRenderer_upSkinRed);
					setStyle("overSkin", CellRenderer_upSkinWhite);
					break;
				default:
					break;
			}

			super.drawBackground();
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/07/14/datagrid-styles/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ProgressBar Component</title>
		<link>http://manewc.com/2008/05/09/progressbar-component/</link>
		<comments>http://manewc.com/2008/05/09/progressbar-component/#comments</comments>
		<pubDate>Sat, 10 May 2008 02:26:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/2008/05/09/progressbar-component/</guid>
		<description><![CDATA[I have always wondered how the progress component worked.. seems easy enough.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ProgressBarDemo_1318058627"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="/projects/flash/ProgressBar/ProgressBarDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/ProgressBar/ProgressBarDemo.swf"
			name="fm_ProgressBarDemo_1318058627"
			width="550"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
Here is the document class

package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	import flash.text.TextFieldAutoSize;
	import fl.containers.UILoader;
	import fl.controls.Label;
	import fl.controls.ProgressBar;

	public class ProgressBarDemo extends Sprite
	{
		private var url:String = "http://manewc.com/projects/flash/i/gahlord.jpg";
		private var myLabel:Label;
		private var myProgressBar:ProgressBar;
		private var myUILoader:UILoader;

		public function ProgressBarDemo()
		{
			myUILoader = new UILoader();
			myUILoader.autoLoad = false;
			myUILoader.source = url;
			myUILoader.move(10, 10);
			myUILoader.scaleContent = false;
			myUILoader.load();

			myProgressBar = new [...]]]></description>
			<content:encoded><![CDATA[<p>I have always wondered how the progress component worked.. seems easy enough.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ProgressBarDemo_1258094664"
			class="flashmovie"
			width="550"
			height="400">
	<param name="movie" value="/projects/flash/ProgressBar/ProgressBarDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/ProgressBar/ProgressBarDemo.swf"
			name="fm_ProgressBarDemo_1258094664"
			width="550"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here is the document class</p>
<pre class="c-sharp" name="code">
package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	import flash.text.TextFieldAutoSize;
	import fl.containers.UILoader;
	import fl.controls.Label;
	import fl.controls.ProgressBar;

	public class ProgressBarDemo extends Sprite
	{
		private var url:String = "http://manewc.com/projects/flash/i/gahlord.jpg";
		private var myLabel:Label;
		private var myProgressBar:ProgressBar;
		private var myUILoader:UILoader;

		public function ProgressBarDemo()
		{
			myUILoader = new UILoader();
			myUILoader.autoLoad = false;
			myUILoader.source = url;
			myUILoader.move(10, 10);
			myUILoader.scaleContent = false;
			myUILoader.load();

			myProgressBar = new ProgressBar();
			myProgressBar.source = myUILoader;
			myProgressBar.move(myUILoader.x, myUILoader.y);
			myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler);
			myProgressBar.addEventListener(Event.COMPLETE, completeHandler);
			addChild(myProgressBar);

			myLabel = new Label();
			myLabel.text = "xx";
			myLabel.autoSize = TextFieldAutoSize.LEFT;
			myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height);
			addChild(myLabel);
		}

		function progressHandler(event:ProgressEvent):void
		{
			myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";
		}

		function completeHandler(event:Event):void
		{
		    myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
			myProgressBar.removeEventListener(Event.COMPLETE, completeHandler);

			addChildAt(myUILoader, 0);
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/05/09/progressbar-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Player with XML and the FLVPlayback and DataGrid Components</title>
		<link>http://manewc.com/2008/04/07/video-player-with-xml-and-the-flvplayback-and-datagrid-components/</link>
		<comments>http://manewc.com/2008/04/07/video-player-with-xml-and-the-flvplayback-and-datagrid-components/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 17:09:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://manewc.com/2008/04/07/video-player-with-xml-and-the-flvplayback-and-datagrid-components/</guid>
		<description><![CDATA[I just created a simple video player. I wanted the data grid component to hold a description of the videos in the xml file as well as display the thumbnail image for the movies. In addition to this there is the ability to link to a specified Skin movie to  apply to the video [...]]]></description>
			<content:encoded><![CDATA[<p>I just created a simple video player. I wanted the data grid component to hold a description of the videos in the xml file as well as display the thumbnail image for the movies. In addition to this there is the ability to link to a specified Skin movie to  apply to the video player. Here are a few sites of the classes that I used:</p>
<p><a href="http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/#section14">http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/#section14</a></p>
<p><a href="http://www.communitymx.com/content/article.cfm?cid=88033">http://www.communitymx.com/content/article.cfm?cid=88033</a></p>
<p>The XML files holds the location of the thumbnail image, the location of the .flv movie and a description node for a description of the movie. An example of the xml is:</p>
<p>&lt;rss&gt;<br />
&lt;channel&gt;<br />
&lt;item&gt;<br />
&lt;thumbnail&gt;/path/to/thumbnail.jpg&lt;/thumbnail&gt;&lt;flvurl&gt;/path/to/flvmovie.flv&lt;/flvurl&gt;<br />
&lt;description&gt;Here is my description&lt;/description&gt;<br />
&lt;/item&gt;<br />
&lt;item&gt;<br />
&lt;thumbnail&gt;/path/to/thumbnail.jpg&lt;/thumbnail&gt;&lt;flvurl&gt;/path/to/flvmovie.flv&lt;/flvurl&gt;<br />
&lt;description&gt;Here is my description&lt;/description&gt;<br />
&lt;/item&gt;<br />
&lt;/channel&gt;<br />
&lt;/rss&gt;</p>
<p>Here is the main document class used:</p>
<pre class="c-sharp" name="code">
package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLLoader;
    import flash.net.URLRequest;
	import fl.controls.DataGrid;
	import fl.controls.dataGridClasses.DataGridColumn;
	import fl.data.DataProvider;

	public class Main extends Sprite
	{
		private var myDataGrid:DataGrid = new DataGrid();
        private var dp:DataProvider;
		private var xml:XML;
		private var fpp:FLVPlaybackPro = new FLVPlaybackPro();

		public function Main()
		{
			var loader:URLLoader = new URLLoader();
            loader.addEventListener(Event.COMPLETE, DataGridLoad);
            loader.load(new URLRequest("/path/to/xml/file.xml"));
		}

		private function DataGridLoad(e:Event):void
		{
			xml = new XML(e.target.data);
			var il:XMLList = xml.channel.item;

			var dp:DataProvider = new DataProvider();

			for (var i:uint=0; i<il.length(); i++)
			{
				dp.addItem({data:il.thumbnail.text()[i], Title:il.description.text()[i], flvurl:il.flvurl.text()[i]});
			}

			var dataCol:DataGridColumn = new DataGridColumn("data");
			dataCol.headerText = "Image";
			dataCol.cellRenderer = LoaderCellRenderer;

			var titleCol:DataGridColumn = new DataGridColumn("Title");

			var flvCol:DataGridColumn = new DataGridColumn("flvurl");

			myDataGrid = new DataGrid();
			myDataGrid.addColumn(dataCol);
			myDataGrid.addColumn(titleCol);
			myDataGrid.dataProvider = dp;
			myDataGrid.rowHeight = 100;
			myDataGrid.width = 500;
			myDataGrid.rowCount = dp.length - 1;
			myDataGrid.move(0, 380);
			addChild(myDataGrid);

			// Listen for Events
			myDataGrid.addEventListener(Event.CHANGE, listClick)

			// Load the player
			FLVPlayer();

			// Play the first video
			FLVPlay(il.flvurl.text()[0]);
		}

		private function FLVPlayer():void
		{
			fpp = new FLVPlaybackPro();

			fpp.x = 0;
			fpp.y = 0;
			fpp.width = 500;
			fpp.height = 333;

			addChild(fpp);

			/* Enter your path to the Flash Skin Component */
			fpp.skin = "SkinUnderAllNoCaption.swf";
			fpp.skinBackgroundColor = 0x666666;
		}

		private function FLVPlay(flvurl:String):void
		{
			fpp.source = flvurl;
		}

		private function listClick(e:Event)
		{
			FLVPlay(myDataGrid.selectedItem.flvurl);
		}

	}
}
</pre>
<p>The FLVPlaybackPro</p>
<pre class="c-sharp" name="code">
package {

    import fl.video.FLVPlayback;

    public class FLVPlaybackPro extends FLVPlayback {

       public function FLVPlaybackPro(){
          super();
       }
    }
}
</pre>
<p>The cell renderer class for the data grid component used:</p>
<pre class="c-sharp" name="code">
package {
    // Import the required component classes.
    import fl.containers.UILoader;
    import fl.controls.listClasses.ICellRenderer;
    import fl.controls.listClasses.ListData;
    import fl.core.InvalidationType;
    import fl.data.DataProvider;
    import flash.events.Event;

    /**
     * This class creates a custom cell renderer which displays an image in a cell.
     * Make sure the class is marked "public" and in the case of our custom cell renderer,
     * extends the UILoader class and implements the ICellRenderer interface.
     */
    public class LoaderCellRenderer extends UILoader implements ICellRenderer {
        protected var _data:Object;
        protected var _listData:ListData;
        protected var _selected:Boolean;

        /**
         * Constructor.
         */
        public function LoaderCellRenderer():void {
            super();
        }

        /**
         * Gets or sets the cell's internal _data property.
         */
        public function get data():Object {
            return _data;
        }
        /**
         * @private (setter)
         */
        public function set data(value:Object):void {
            _data = value;
            source = value.data;
        }

        /**
         * Gets or sets the cell's internal _listData property.
         */
        public function get listData():ListData {
            return _listData;
        }
        /**
         * @private (setter)
         */
        public function set listData(value:ListData):void {
            _listData = value;
            invalidate(InvalidationType.DATA);
            invalidate(InvalidationType.STATE);
        }

        /**
         * Gets or sets the cell's internal _selected property.
         */
        public function get selected():Boolean {
            return _selected;
        }
        /**
         * @private (setter)
         */
        public function set selected(value:Boolean):void {
            _selected = value;
            invalidate(InvalidationType.STATE);
        }

        /**
         * Sets the internal mouse state.
         */
        public function setMouseState(state:String):void {
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/04/07/video-player-with-xml-and-the-flvplayback-and-datagrid-components/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[AS 3] Color Picker with the ColorPicker Component</title>
		<link>http://manewc.com/2008/03/17/as-3-color-picker-with-the-colorpicker-component/</link>
		<comments>http://manewc.com/2008/03/17/as-3-color-picker-with-the-colorpicker-component/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 17:29:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/2008/03/17/as-3-color-picker-with-the-colorpicker-component/</guid>
		<description><![CDATA[Of course to begin don&#8217;t forget to drop this component in your library. A simple demonstration of assigning a color to an object being added to the stage.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ColorPickerComponent_1789604092"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="/projects/flash/ColorPickerComponent/ColorPickerComponent.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/ColorPickerComponent/ColorPickerComponent.swf"
			name="fm_ColorPickerComponent_1789604092"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
Here is the Document Class file ColorPickerComponent.as:

package
{
	import flash.display.Sprite;
	import flash.display.Shape;
	import fl.controls.ColorPicker;
	import fl.events.ColorPickerEvent;
	import flash.geom.ColorTransform;

	public class ColorPickerComponent extends Sprite
	{
		private var bg:Shape; // for the background
		private var tf:ColorTransform;
		private [...]]]></description>
			<content:encoded><![CDATA[<p>Of course to begin don&#8217;t forget to drop this component in your library. A simple demonstration of assigning a color to an object being added to the stage.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ColorPickerComponent_837866845"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="/projects/flash/ColorPickerComponent/ColorPickerComponent.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/ColorPickerComponent/ColorPickerComponent.swf"
			name="fm_ColorPickerComponent_837866845"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here is the Document Class file ColorPickerComponent.as:</p>
<pre name="code" class="c-sharp">
package
{
	import flash.display.Sprite;
	import flash.display.Shape;
	import fl.controls.ColorPicker;
	import fl.events.ColorPickerEvent;
	import flash.geom.ColorTransform;

	public class ColorPickerComponent extends Sprite
	{
		private var bg:Shape; // for the background
		private var tf:ColorTransform;
		private var holder:Sprite;

		public function ColorPickerComponent()
		{

			colorBox("000000");

			var myColorPicker:ColorPicker = new ColorPicker();
			myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler);
			myColorPicker.move(10, 10);
			addChild(myColorPicker);
		}

		private function changeHandler(e:ColorPickerEvent):void {
    		colorBox(e.target.hexValue);
		}

		private function colorBox(color:String)
		{
			if (numChildren != 0) // check to see if there are any shapes
			{
				removeChildAt(0); // removes the shape
			}

			var bg:Shape = new Shape();
			bg.graphics.beginFill(0x336699);
			bg.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);

			var tf:ColorTransform = bg.transform.colorTransform;
			var newcolor = "0x" + color;
			tf.color = newcolor;
			bg.transform.colorTransform = tf;

			addChildAt(bg,0);
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/03/17/as-3-color-picker-with-the-colorpicker-component/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[AS 3] TileList Component</title>
		<link>http://manewc.com/2008/02/21/as-3-tilelist-component/</link>
		<comments>http://manewc.com/2008/02/21/as-3-tilelist-component/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 18:40:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/2008/02/21/as-3-tilelist-component/</guid>
		<description><![CDATA[A simple example of loading in some images in the TileList component. Make sure you add the TileList component to your library in or for this to work.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_TileListDemo_26814562"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="/projects/flash/TileList/TileListDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/TileList/TileListDemo.swf"
			name="fm_TileListDemo_26814562"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
Here is the document class TileListDemo.as:

/*
Reference
http://www.adobe.com/devnet/flash/quickstart/tilelist_component_as3/
*/
package
{
	import flash.display.Sprite;
	import fl.controls.TileList;
	import fl.controls.ScrollBarDirection;
	import flash.text.TextFormat;

	public class TileListDemo extends Sprite
	{
		private var tlc:TileList;

		public function TileListDemo()
		{
			// create TileList instance
			var tlc:TileList = new [...]]]></description>
			<content:encoded><![CDATA[<p>A simple example of loading in some images in the TileList component. Make sure you add the TileList component to your library in or for this to work.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_TileListDemo_254042546"
			class="flashmovie"
			width="600"
			height="400">
	<param name="movie" value="/projects/flash/TileList/TileListDemo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/TileList/TileListDemo.swf"
			name="fm_TileListDemo_254042546"
			width="600"
			height="400">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Here is the document class TileListDemo.as:</p>
<pre name="code" class="c-sharp">
/*
Reference
http://www.adobe.com/devnet/flash/quickstart/tilelist_component_as3/
*/
package
{
	import flash.display.Sprite;
	import fl.controls.TileList;
	import fl.controls.ScrollBarDirection;
	import flash.text.TextFormat;

	public class TileListDemo extends Sprite
	{
		private var tlc:TileList;

		public function TileListDemo()
		{
			// create TileList instance
			var tlc:TileList = new TileList();

			// create TextFormat object to style labels
			var tf:TextFormat = new TextFormat();
			tf.font = "Verdana";
			tf.bold = true;
			tf.color = 0xFF6666;
			tf.size = 14;

			// add content to the TileList
			tlc.addItem({label:"Image 1", source:"http://manewc.com/projects/flash/TileList/1.jpg"});
			tlc.addItem({label:"Image 2", source:"http://manewc.com/projects/flash/TileList/2.jpg"});
			tlc.addItem({label:"Image 3", source:"http://manewc.com/projects/flash/TileList/3.jpg"});
			tlc.addItem({label:"Image 4", source:"http://manewc.com/projects/flash/TileList/4.jpg"});
			tlc.addItem({label:"Image 5", source:"http://manewc.com/projects/flash/TileList/5.jpg"});
			tlc.addItem({label:"Image 6", source:"http://manewc.com/projects/flash/TileList/6.jpg"});

			// set column and row values
			tlc.columnWidth = 500;
			tlc.rowHeight = 300;
			tlc.columnCount = 1;
			tlc.rowCount = 1;
			tlc.height = 320;
			tlc.width = 500;

			// enable scrolling
			tlc.scrollPolicy = "on";

			// position
			tlc.move(stage.stageWidth/2 - tlc.width / 2,stage.stageHeight/2 - tlc.height/2);

			// add to the display
			addChild(tlc); 

			// set style for labels
			tlc.setRendererStyle("textFormat", tf);
			tlc.setRendererStyle("imagePadding", 5);
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/02/21/as-3-tilelist-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[AS 3] DataGrid Component</title>
		<link>http://manewc.com/2008/02/14/as-3-data-grid-component/</link>
		<comments>http://manewc.com/2008/02/14/as-3-data-grid-component/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 19:11:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Components]]></category>

		<guid isPermaLink="false">http://manewc.com/2008/02/14/as-3-data-grid-component/</guid>
		<description><![CDATA[I was never a huge fan of Flash Components back in the day, now I find that they are essential in building flash applications. Here is an example of using the Data Grid Component. In this example we add data to the grid by applying the addItem method. You can also add data via an [...]]]></description>
			<content:encoded><![CDATA[<p>I was never a huge fan of Flash Components back in the day, now I find that they are essential in building flash applications. Here is an example of using the Data Grid Component. In this example we add data to the grid by applying the addItem method. You can also add data via an xml file or an array. To get this to work you simply just add the DataGrid component to your library. I just accomplished this by dropping the component out of the component panel, placing it on the stage, then deleting it. This automatically adds it to the library.</p>
<p>You should roll your mouse over the table below to demonstrate the methods of the DataGrid Component.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_DataGridExample_645016906"
			class="flashmovie"
			width="550"
			height="140">
	<param name="movie" value="/projects/flash/DataGrid/DataGridExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/projects/flash/DataGrid/DataGridExample.swf"
			name="fm_DataGridExample_645016906"
			width="550"
			height="140">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<pre name="code" class="c-sharp">
package
{
	import flash.display.MovieClip;
	import fl.controls.DataGrid;
	import fl.data.DataProvider;

	public class DataGridExample extends MovieClip
	{

		private var myDataGrid:DataGrid;
		private var myDP:DataProvider;

		public function DataGridExample()
		{
			var myDP:DataProvider = new DataProvider();
			myDP.addItem({ID:"01", Name:"Morgan", Email:"Morgan@blah.com", Web:"manewc.com"});
			myDP.addItem({ID:"02", Name:"Ashley", Email:"Ashley@blah.com", Web:"google.com"});
			myDP.addItem({ID:"03", Name:"Michael", Email:"Michael@blah.com", Web:"yahoo.com"});

			var myDataGrid:DataGrid = new DataGrid();
			myDataGrid.addColumn("ID");
			myDataGrid.addColumn("Name");
			myDataGrid.addColumn("Email");
			myDataGrid.addColumn("Web");
			myDataGrid.dataProvider = myDP;
			myDataGrid.width = 530;
			myDataGrid.move(10, 10);
			addChild(myDataGrid);
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://manewc.com/2008/02/14/as-3-data-grid-component/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
