<?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>AS3 Game Gears</title>
	<atom:link href="http://www.as3gamegears.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3gamegears.com</link>
	<description>Boost your tools!</description>
	<lastBuildDate>Fri, 18 May 2012 09:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CaptureDevice</title>
		<link>http://www.as3gamegears.com/air-native-extension/capturedevice/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=capturedevice</link>
		<comments>http://www.as3gamegears.com/air-native-extension/capturedevice/#comments</comments>
		<pubDate>Fri, 18 May 2012 09:30:00 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Air Native Extension]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[LGPL]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=597</guid>
		<description><![CDATA[CaptureDevice is an Adobe Air Native Extension for video capturing from cameras. It supports Windows (Direct Show) and Mac (QTkit), is able to handle multiple cameras and updates only on new frame. Sample package { import flash.display.Bitmap; import flash.display.BitmapData; import &#8230; <a href="http://www.as3gamegears.com/air-native-extension/capturedevice/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/inspirit/CaptureDevice" target="_blank">CaptureDevice</a> is an Adobe Air Native Extension for video capturing from cameras. It supports Windows (Direct Show) and Mac (QTkit), is able to handle multiple cameras and updates only on new frame.</p>
<p><strong>Sample</strong></p>
<pre class="brush: as3">package
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.geom.Point;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import ru.inspirit.asfeat.capture.CaptureDevice;
    import ru.inspirit.asfeat.capture.CaptureDeviceInfo;

    /**
     * Simple Demo App
     * @author Eugene Zatepyakin
     */
    [SWF(frameRate='30',backgroundColor='0xFFFFFF')]
    public final class Main extends Sprite
    {
        public var captDevs:Vector.;
        public var captLabs:Vector.;
        public var _txt:TextField;

        public var scrBitmap:Bitmap;
        public var scr_bmp:BitmapData;

        public var dev_info:String;

        public function Main():void
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;

            scr_bmp = new BitmapData(800, 600, false, 0xFFFFFF);
            scrBitmap = new Bitmap(scr_bmp, 'auto', true);
            addChild(scrBitmap);

            //
            _txt = new TextField();
            _txt.width = 200;
            _txt.multiline = true;
            _txt.autoSize = 'left';
            _txt.background = true;
            _txt.backgroundColor = 0xffffff;
            _txt.x = 320;
            _txt.y = 240;

            addChild(_txt);
            //

            initCapture();
        }

        protected function createCaptLab(capt:CaptureDevice):TextField
        {
            var lab:TextField;

            var fmt:TextFormat = new TextFormat('_sans',9, 0xffffff,false,false,false,null,null,'left',4,6);

            lab = new TextField();
            lab.background = true;
            lab.backgroundColor = 0x0;
            lab.autoSize = 'left';
            lab.selectable = false;
            lab.text = capt.name.toUpperCase()  + ' // ' + capt.width + 'x'+capt.height;
            lab.setTextFormat(fmt);

            lab.addEventListener(MouseEvent.CLICK, onLabClick);

            return lab;
        }
        private function onLabClick(e:MouseEvent):void
        {
            var lab:TextField = e.currentTarget as TextField;
            var ind:int = captLabs.indexOf(lab);
            if(ind &gt;= 0 &amp;&amp; ind &lt; captDevs.length)
            {
                var capt:CaptureDevice = captDevs[ind];
                if(capt.isCapturing)
                {
                    capt.stop();
                } else {
                    capt.start();
                }
            }
        }

        protected function initCapture():void
        {
            CaptureDevice.initialize();

            dev_info = '';
            dev_info += 'CaptureInterface init: ' + CaptureDevice.available + '\n';

            var dev_inf:Vector. = CaptureDevice.getDevices(false);
            captDevs = new Vector.();
            captLabs = new Vector.();

            var capt:CaptureDevice;
            var lab:TextField;

            var n:int = dev_inf.length;
            for (var i:int = 0; i &lt; n; ++i)
            {
                var dev:CaptureDeviceInfo = dev_inf[i];
                dev_info += 'Device[' + i + ']: ' + '{ name: '+ dev.name + ', connected: ' + dev.connected +', available: ' + dev.available +' }\n';
                dev_info += '\ttrying to init: ';

                try
                {
                    capt = new CaptureDevice(dev.name, 320, 240);
                    capt.addEventListener('CAPTURE_DEVICE_LOST', onDeviceLost);

                    lab = createCaptLab(capt);

                    captLabs.push(lab);
                    addChild(lab);

                    captDevs.push(capt);
                    dev_info += 'OK';
                }
                catch (err:Error)
                {
                    dev_info += 'failed <img src='http://www.as3gamegears.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ';
                }

                dev_info += '\n';
            }

            // dirty test of dispose method
            /*
            setTimeout(function():void
            {
                captDevs[1].dispose();
                removeChild(captLabs[1]);
                captDevs.splice(1, 1);
                captLabs.splice(1, 1);
            }, 5000);
            */

            if (captDevs.length)
            {
                addEventListener(Event.ENTER_FRAME, updateFrame);
            }

            _txt.text = dev_info;
        }

        private function onDeviceLost(e:Event):void
        {
            var capt:CaptureDevice = e.currentTarget as CaptureDevice;

            // please be carefull
            // this causes app hand on Mac but works on Windows
            capt.dispose();

            var n:int = captDevs.length;
            for (var i:int = 0; i &lt; n; ++i)
            {
                if (captDevs[i].id == capt.id)
                {
                    captDevs.splice(i, 1);

                    captLabs[i].removeEventListener(MouseEvent.CLICK, onLabClick);
                    removeChild(captLabs[i]);
                    captLabs.splice(i,  1);

                    break;
                }
            }

            capt.removeEventListener('CAPTURE_DEVICE_LOST', onDeviceLost);

            e.stopImmediatePropagation();
        }

        private function updateFrame(e:Event):void
        {
            var n:int = captDevs.length;
            var capt:CaptureDevice;
            var lab:TextField;
            var isNewFrame:Boolean;
            var pt:Point = new Point();

            var sw:Number = stage.stageWidth;
            var sh:Number = stage.stageHeight;

            var _str:String = '\n';
            for (var i:int = 0; i &lt; n; ++i)             {                 capt = captDevs[i];                 isNewFrame = capt.requestFrame(CaptureDevice.GET_FRAME_BITMAP);                 //isNewFrame = capt.requestFrame(CaptureDevice.GET_FRAME_RAW_BYTES);                 //isNewFrame = capt.requestFrame(CaptureDevice.GET_FRAME_RAW_BYTES | CaptureDevice.GET_FRAME_BITMAP);                                  _str += 'device[' + capt.name + '] update ' + isNewFrame + '\n';                                  if(isNewFrame)                 {                     pt.x = 320*(i%2);                     pt.y = 240*(i&gt;&gt;1);

                    scr_bmp.copyPixels(capt.bmp, capt.bmp.rect, pt);
                    /*
                    var raw:ByteArray = capt.raw;
                    raw.position = 0;
                    var size:int = capt.width * capt.height;
                    var cols:Vector. = new Vector.(capt.width * capt.height);
                    for (var j:int = 0; j &lt; size; ++j)
                    {
                        var _r:uint = raw.readUnsignedByte();
                        var _g:uint = raw.readUnsignedByte();
                        var _b:uint = raw.readUnsignedByte();
                        cols[j] = _r &lt;&lt; 16 | _g &lt;&lt; 8 | _b;
                    }
                    scr_bmp.setVector(new Rectangle(pt.x + 320, pt.y, capt.width, capt.height), cols);
                    */

                    lab = captLabs[i];
                    lab.x = pt.x;
                    lab.y = pt.y;
                }
            }

            _txt.text = dev_info + _str;
        }

    }

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/air-native-extension/capturedevice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual Controllers</title>
		<link>http://www.as3gamegears.com/input/virtual-controllers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtual-controllers</link>
		<comments>http://www.as3gamegears.com/input/virtual-controllers/#comments</comments>
		<pubDate>Wed, 16 May 2012 12:00:02 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Input]]></category>
		<category><![CDATA[CC-BY-SA 3.0]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=595</guid>
		<description><![CDATA[Virtual Controllers is a set of classes that enable thumbstick and button ui elements for touch based devices. Sample package com.flashgen.ui.controls { import flash.display.Sprite; import flash.events.TouchEvent; import flash.system.Capabilities; import flash.events.MouseEvent; import flash.events.Event; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode; import flash.events.KeyboardEvent; import flash.ui.Keyboard; public &#8230; <a href="http://www.as3gamegears.com/input/virtual-controllers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/FlashGen/Virtual_Controllers" target="_blank">Virtual Controllers</a> is a set of classes that enable thumbstick and button ui elements for touch based devices.</p>
<p><strong>Sample</strong></p>
<pre class="brush: as3">package com.flashgen.ui.controls
{
	import flash.display.Sprite;
	import flash.events.TouchEvent;
	import flash.system.Capabilities;
	import flash.events.MouseEvent;
	import flash.events.Event;
	import flash.ui.Multitouch;
	import flash.ui.MultitouchInputMode;
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;

	public class ThumbStick extends Sprite
	{
		private var _thumb		:Sprite;
		private var _surround	:Sprite;
		private var _boundary	:Sprite;

		private var _degrees	:Number;
		private var _radius		:Number = 25;	

		private var _primaryKeyCode		:int;
		private var _secondaryKeyCode	:int;

		private var _previousPrimaryKeyCode		:int;
		private var _previousSecondaryKeyCode	:int = 0;

		public function ThumbStick()
		{
			_thumb = thumb;
			_surround = surround;
			_boundary = boundary;
			_boundary.width = 200;
			_boundary.height = 200;
			_boundary.alpha = 0;

			if(Capabilities.cpuArchitecture == "ARM")
			{
				Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
				_thumb.addEventListener(TouchEvent.TOUCH_BEGIN, onThumbDown);
				_thumb.addEventListener(TouchEvent.TOUCH_END, onThumbUp);
				_surround.addEventListener(TouchEvent.TOUCH_END, onThumbUp);
				_boundary.addEventListener(TouchEvent.TOUCH_END, onThumbUp);
			}
			else
			{
				_thumb.addEventListener(MouseEvent.MOUSE_DOWN, onTestThumbDown);
				_thumb.addEventListener(MouseEvent.MOUSE_UP, onTestThumbUp);
				_surround.addEventListener(MouseEvent.MOUSE_UP, onTestThumbUp);
				_boundary.addEventListener(MouseEvent.MOUSE_UP, onTestThumbUp);
			}
		}

		protected function initDrag():void
		{
			_thumb.startDrag();
			addEventListener(Event.ENTER_FRAME, onThumbDrag);
		}

		protected function resetThumb():void
		{
			removeEventListener(Event.ENTER_FRAME, onThumbDrag);

			killAllEvents();

			_thumb.stopDrag();
			_thumb.x = 0;
			_thumb.y = 0;
		}

		protected function onThumbDrag(e:Event):void
		{
			// Store the current x/y of the knob
			var _currentX		:Number = _thumb.x;
			var _currentY		:Number = _thumb.y;

			// Store the registration point of the surrounding 'joystick holder'
			var _registrationX	:Number = _surround.x;
			var _registrationY	:Number = _surround.y;

			// Subtract the two from each other to get the actual x/y
			var _actualX	:Number = _currentX - _registrationX;
			var _actualY	:Number =  _currentY - _registrationY;

			// Calculate the degrees for use when creating the zones.
			_degrees = Math.round(Math.atan2(_actualY, _actualX) * 180/Math.PI);

			// Calculate the radian value of the knobs current position
			var _angle 		:Number = _degrees * (Math.PI / 180);

			// As we want to lock the orbit of the knob we need to calculate x/y at the maximum distance
			var _maxX		:Number = Math.round((_radius * Math.cos(_angle)) + _registrationX);
			var _maxY		:Number = Math.round((_radius * Math.sin(_angle)) + _registrationY);

			// Check to make sure that the value is positive or negative
			if(_currentX &gt; 0 &amp;&amp; _currentX &gt; _maxX || _currentX &lt; 0 &amp;&amp; _currentX &lt; _maxX) 				_thumb.x = _maxX; 			 			if(_currentY &gt; 0 &amp;&amp; _currentY &gt; _maxY || _currentY &lt; 0 &amp;&amp; _currentY &lt; _maxY) 				_thumb.y = _maxY; 		 			dispatchKeyCombo(); 		} 		 		protected function dispatchKeyCombo():void 		{ 			_secondaryKeyCode = 0; 			 			// Thumb stick position - Right 			if(_degrees &gt;= -22 &amp;&amp; _degrees = 68 &amp;&amp; _degrees = 158 &amp;&amp; _degrees = -179 &amp;&amp; _degrees = -112 &amp;&amp; _degrees = -157 &amp;&amp; _degrees = 113)
			{
				_primaryKeyCode = Keyboard.DOWN;
				_secondaryKeyCode = Keyboard.LEFT;
			}
			// Thumb stick position - Up/Right
			else if(_degrees &gt;=-67 &amp;&amp; _degrees = 23 &amp;&amp; _degrees  0)
				dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, _secondaryKeyCode));

			dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, _primaryKeyCode));
		}

		protected function killAllEvents():void
		{
			if(_primaryKeyCode)
				dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, _previousPrimaryKeyCode));

			if(_secondaryKeyCode &gt; 0)
				dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 0, _previousSecondaryKeyCode));
		}

		protected function onThumbDown(e:TouchEvent):void
		{
			initDrag();
		}

		protected function onThumbUp(e:TouchEvent):void
		{
			resetThumb();
		}

		protected function onTestThumbDown(e:MouseEvent):void
		{
			initDrag();
		}

		protected function onTestThumbUp(e:MouseEvent):void
		{
			resetThumb();
		}
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/input/virtual-controllers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minko Collada</title>
		<link>http://www.as3gamegears.com/misc/minko-collada/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minko-collada</link>
		<comments>http://www.as3gamegears.com/misc/minko-collada/#comments</comments>
		<pubDate>Mon, 14 May 2012 12:17:36 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[LGPL]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=593</guid>
		<description><![CDATA[Minko Collada is an extension for Minko game engine to handle the Collada file format. It provides you with methods to read animations, controllers, effects, geometries, images, materials, nodes and visual scenes.]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/aerys/minko-collada" target="_blank">Minko Collada</a> is an extension for <a title="Minko" href="http://www.as3gamegears.com/engines/3d-engines/minko/" rel="as3gamegears">Minko</a> game engine to handle the Collada file format. It provides you with methods to read animations, controllers, effects, geometries, images, materials, nodes and visual scenes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/misc/minko-collada/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BitmapFont</title>
		<link>http://www.as3gamegears.com/text/bitmapfont/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bitmapfont</link>
		<comments>http://www.as3gamegears.com/text/bitmapfont/#comments</comments>
		<pubDate>Fri, 11 May 2012 12:55:51 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=590</guid>
		<description><![CDATA[BitmapFont is a cross-platform bitmap font implementation. It allows you to create text fields and customize several graphical aspects, such as background color, shadow, alignment, scale, padding and color. The set of classes is heavily based on classes from Pixelizer. Sample &#8230; <a href="http://www.as3gamegears.com/text/bitmapfont/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/Beeblerox/BitmapFont" target="_blank">BitmapFont</a> is a cross-platform bitmap font implementation. It allows you to create text fields and customize several graphical aspects, such as background color, shadow, alignment, scale, padding and color.</p>
<p>The set of classes is heavily based on classes from <a title="Pixelizer" href="http://www.as3gamegears.com/engines/2d-engines/pixelizer/" rel="as3gamegears">Pixelizer</a>.</p>
<p><strong>Sample</strong></p>
<pre class="brush: as3">package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;

	import pxBitmapFont.PxBitmapFont;
	import pxBitmapFont.PxTextAlign;
	import pxBitmapFont.PxTextField;

	/**
	 * ...
	 * @author Zaphod
	 */
	public class Main extends Sprite
	{

		[Embed(source = "../assets/fontData10pt.png")]
		private var FontImage:Class;

		private var fontString:String;

		private var tf:PxTextField;
		private var tf2:PxTextField;

		public function Main():void
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}

		private function init(e:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point

			fontString = " !\"#$%&amp;'()*+,-./" + "0123456789:;?" + "@ABCDEFGHIJKLMNO" + "PQRSTUVWXYZ[]^_" + "abcdefghijklmno" + "pqrstuvwxyz{|}~\\";
			var font:PxBitmapFont = new PxBitmapFont((new FontImage()).bitmapData, fontString);

			tf = new PxTextField();
			addChild(tf);
			tf.color = 0x0000ff;
			tf.background = true;
			tf.backgroundColor = 0x00ff00;
			tf.text = "Hello World!\nand this is\nmultiline!!!";
			tf.shadow = true;
		//	tf.outlineColor = 0x0000ff;
			tf.width = 250;
			tf.alignment = PxTextAlign.CENTER;
			tf.multiLine = true;
			tf.lineSpacing = 5;
			tf.fontScale = 2.5;
			tf.padding = 5;
			tf.scaleX = tf.scaleY = 2.5;
		//	tf.alpha(0.5);

			tf2 = new PxTextField(font);
			tf2.y = 100;
			addChild(tf2);
			tf2.color = 0x0000ff;
			tf2.background = true;
			tf2.backgroundColor = 0x00ff00;
			tf2.text = "Hello World!\nand this is\nmultiline!!!";
			tf2.shadow = true;
		//	tf2.shadowColor = 0xff0000;
			tf2.outlineColor = 0xff0000;
			tf2.width = 610;
			tf2.alignment = PxTextAlign.RIGHT;
			tf2.lineSpacing = 5;
			tf2.fontScale = 2.5;
			tf2.padding = 20;
			tf2.letterSpacing = 25;
			tf2.autoUpperCase = true;
			tf2.multiLine = true;
			tf2.wordWrap = true;
			tf2.fixedWidth = false;
			tf2.text = "Hello!" + "\n\n" + "world!";
		//	tf2.scaleX = tf2.scaleY = 2.5;
		//	tf2.alpha(0.5);

			stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
		}

		private function onMouseMove(e:MouseEvent):void
		{
			tf.text = "mouseX = " + Math.floor(e.localX);
		//	tf2.text = "mouseY = " + Math.floor(e.localY) + "; mouseX = " + Math.floor(e.localX) + ";\n" + "mouseY = " + Math.floor(e.localY) + "\n" + "mouseY = " + Math.floor(e.localY);
		}

	}

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/text/bitmapfont/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HydraP2P</title>
		<link>http://www.as3gamegears.com/multiplayer/hydrap2p/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hydrap2p</link>
		<comments>http://www.as3gamegears.com/multiplayer/hydrap2p/#comments</comments>
		<pubDate>Wed, 09 May 2012 12:46:28 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Multiplayer]]></category>
		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=588</guid>
		<description><![CDATA[HydraP2P is a library aiming to simplify the peer-to-peer API introduced in Flash Player 10.1. It is able to handle connections to the Cirrus service and is channel based, which means it splits up peer-to-peer communication into different channels, rather than filtering in &#8230; <a href="http://www.as3gamegears.com/multiplayer/hydrap2p/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/devboy/HydraP2P" target="_blank">HydraP2P</a> is a library aiming to simplify the peer-to-peer API introduced in Flash Player 10.1. It is able to handle connections to the <a href="http://labs.adobe.com/technologies/cirrus/" target="_blank">Cirrus service</a> and is channel based, which means it splits up peer-to-peer communication into different channels, rather than filtering in a single one.</p>
<p>HydraP2P has a typed command system, so there is no parsing of objects or arrays outside of the API. The user tracking-system provides information about all connected users on a per channel level.</p>
<p><strong>Sample</strong></p>
<pre class="brush: as3">var stratusServiceUrl : String = "rtmfp://stratus.rtmfp.net/YOUR-API_KEY";
_hydraService = new HydraService("HydraChatExample", stratusServiceUrl);
_hydraService.addEventListener(HydraEvent.SERVICE_CONNECT_SUCCESS, serviceEvent);
_hydraService.addEventListener(HydraEvent.SERVICE_CONNECT_FAILED, serviceEvent);
_hydraService.addEventListener(HydraEvent.SERVICE_CONNECT_REJECTED, serviceEvent);

_chatChannel = new HydraChatChannel(_hydraService, "HydraChatExample/ChatChannel");
_chatChannel.addEventListener(HydraUserEvent.USER_CONNECT, userEvent);
_chatChannel.addEventListener(HydraUserEvent.USER_DISCONNECT, userEvent);
_chatChannel.addEventListener(HydraChatEvent.MESSAGE_RECEIVED, messageEvent);
_chatChannel.addEventListener(HydraChatEvent.MESSAGE_SENT, messageEvent);

_hydraService.connect(_loginBox.username);

private function serviceEvent(event : HydraEvent) : void
{
	switch( event.type )
	{
		case HydraEvent.SERVICE_CONNECT_SUCCESS:
			_statusBox.text = "Connected as " + _hydraService.user.name;
			_chatWindow.visible = true;
			break;
		case HydraEvent.SERVICE_CONNECT_FAILED:
			_statusBox.text = "Connection failed.";
			break;
		case HydraEvent.SERVICE_CONNECT_REJECTED:
			_statusBox.text = "Connection rejected.";
			break;
	}
}

private function messageEvent(event : HydraChatEvent) : void
{
	_chatWindow.addMessage(event.sender.name, event.message);
}

private function userEvent(event : HydraUserEvent) : void
{
	_chatWindow.updateUsers(_chatChannel.userTracker.users);
}

private function sendMessage(e:Event) : void
{
	if( _chatWindow.messageInput.length &gt; 0 )
	{
		_chatChannel.sendChatMessage(_chatWindow.messageInput);
		_chatWindow.clearMessageInput();
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/multiplayer/hydrap2p/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>As3GameGears turned two years old!</title>
		<link>http://www.as3gamegears.com/uncategorized/as3gamegears-turned-two-years-old/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=as3gamegears-turned-two-years-old</link>
		<comments>http://www.as3gamegears.com/uncategorized/as3gamegears-turned-two-years-old/#comments</comments>
		<pubDate>Tue, 08 May 2012 03:03:37 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=585</guid>
		<description><![CDATA[I am very pleased to say As3GameGears just turned two years old! The very first thing I want to write is thank you very much, Flash community! You are great and the support I receive from every single comment, tweet, &#8230; <a href="http://www.as3gamegears.com/uncategorized/as3gamegears-turned-two-years-old/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am very pleased to say <strong>As3GameGears</strong> just turned two years old! The very first thing I want to write is <strong>thank you</strong> very much, Flash community! You are great and the support I receive from every single comment, tweet, email and mention keeps me going every day <img src='http://www.as3gamegears.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Before I share my plans for the future, I want to show some number I have so far. Below is the monthly visitors count since I started the site, back in April, 2010, until now:</p>
<p><a href="http://www.as3gamegears.com/wp-content/uploads/2012/05/as3gamegears_visitors_overview_2010_2012.png"><img class="aligncenter size-large wp-image-587" title="as3gamegears_visitors_overview_2010_2012" src="http://www.as3gamegears.com/wp-content/uploads/2012/05/as3gamegears_visitors_overview_2010_2012-1024x162.png" alt="As3GameGears - Visitors Overview from 2010 to 2012" width="640" height="101" /></a></p>
<p>I am really happy about the site evolution. Flash is a great technology and the numbers show people are using it, specially for game development.</p>
<p>After those two years, As3GameGears has <strong>243</strong> tools, filed under <strong>20</strong> categories, licensed under <strong>21</strong> licenses, all that available at <a href="http://api.as3gamegears.com">api.as3gamegears.com</a>. You can explore all that information to find a tool to use native features from a specific platforms, such as <a href="http://www.as3gamegears.com/category/air-native-extension/ios/" target="_blank">iOS</a>, or you can take a look at <a href="http://www.as3gamegears.com/category/monetization/" target="_blank">monetization</a> solutions. Whatever you need, we&#8217;ve got you covered!</p>
<p>For the future, I will continue to catalog Flash tools out there and keep working on making such information available easily. For instance I am working on <strong>As3GameGears tooltip</strong>, a JS plugin that allows anyone to use our data just by hovering a link, e.g.: <a title="Flixel" href="http://www.as3gamegears.com/engines/flixel/" rel="as3gamegears" target="_blank">Flixel</a> and <a title="Foxhole" href="http://www.as3gamegears.com/ui/foxhole/" rel="as3gamegears" target="_blank">Foxhole</a>.</p>
<p>One more time, thank you all!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/uncategorized/as3gamegears-turned-two-years-old/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Starling 1.1 released</title>
		<link>http://www.as3gamegears.com/blog/starling-1-1-released/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=starling-1-1-released</link>
		<comments>http://www.as3gamegears.com/blog/starling-1-1-released/#comments</comments>
		<pubDate>Mon, 07 May 2012 23:12:13 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[AS3 Game Gears Blog]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=583</guid>
		<description><![CDATA[Starling, the GPU powered Flash game engine, reached the 1.1 milestone. It has several bugfixes and performance improvements, as well as a set of sweet new features: Support for Multi-Resolution Development: Create your game for just one resolution and deploy it &#8230; <a href="http://www.as3gamegears.com/blog/starling-1-1-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Starling, the GPU powered Flash game engine, reached the <a href="http://gamua.com/starling/download/" target="_blank">1.1 milestone</a>. It has several bugfixes and performance improvements, as well as a set of sweet new features:</p>
<ul>
<li>Support for <strong>Multi-Resolution Development</strong>: Create your game for just one resolution and deploy it to any screen out there, simply by providing different sets of textures.</li>
<li>Use <strong>Blend Modes</strong> for interesting optical effects, without any sacrifices on performance.</li>
<li>Enjoy a <strong>Performance Improvement</strong> on the 1st Generation iPad and comparable devices. Benchmark results skyrocketed by 500%!</li>
<li>Display <strong>Live Statistics</strong> (framerate, memory consumption) through the new &#8220;showStats&#8221; feature</li>
</ul>
<p>You can also take a look at the brand new <a href="http://wiki.starling-framework.org/" target="_blank">Starling Wiki</a>, a place where you can find Starling related content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/blog/starling-1-1-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pixelizer</title>
		<link>http://www.as3gamegears.com/engines/2d-engines/pixelizer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pixelizer</link>
		<comments>http://www.as3gamegears.com/engines/2d-engines/pixelizer/#comments</comments>
		<pubDate>Mon, 07 May 2012 03:04:53 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=581</guid>
		<description><![CDATA[Pixelizer is an entity and component based game framework. Since it is based on entities and components, it&#8217;s is very easy to extend and reuse. Features: easy extendable component based framework nestable entities for easy manipulation of groups lots of premade &#8230; <a href="http://www.as3gamegears.com/engines/2d-engines/pixelizer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://johanpeitz.com/pixelizer" target="_blank">Pixelizer</a> is an entity and component based game framework. Since it is based on entities and components, it&#8217;s is very easy to extend and reuse.</p>
<p>Features:</p>
<ul>
<li>easy extendable component based framework</li>
<li>nestable entities for easy manipulation of groups</li>
<li>lots of premade components and entities</li>
<li>fast 2D rendering</li>
<li>automated collision detection and response</li>
<li>spritesheets, animations and tilemaps</li>
<li>prerendering of movieclips</li>
<li>automatic panning and volume of moving sounds</li>
<li>exact mouse and keyboard input</li>
<li>fancy text rendering</li>
<li>handy math and string routines</li>
<li>effective object pools</li>
<li>useful logging</li>
<li>and much more</li>
</ul>
<p><strong>Sample</strong></p>
<pre class="brush: as3">package examples.spritesheet {
	import examples.assets.AssetFactory;
	import flash.display.MovieClip;
	import flash.display.StageQuality;
	import pixelizer.components.render.PxAnimationComponent;
	import pixelizer.components.render.PxBlitRenderComponent;
	import pixelizer.components.render.PxTextFieldComponent;
	import pixelizer.Pixelizer;
	import pixelizer.prefabs.gui.PxTextFieldEntity;
	import pixelizer.PxEntity;
	import pixelizer.PxInput;
	import pixelizer.PxScene;
	import pixelizer.render.PxAnimation;
	import pixelizer.render.PxSpriteSheet;
	import pixelizer.utils.PxMath;

	/**
	 * ...
	 * @author Johan Peitz
	 */
	public class SpriteSheetExampleScene extends PxScene {

		private var _animComp : PxAnimationComponent;
		private var _timePassed : Number = 0;
		private var _animID : int = 0;

		public function SpriteSheetExampleScene() {
			var i : int;

			var sheet : PxSpriteSheet = new PxSpriteSheet();
			var numFrames : int = sheet.addFramesFromMovieClip( AssetFactory.mc, StageQuality.HIGH );
			var frames : Array = [];
			for ( i = 0; i &lt; numFrames; i++ ) {
				frames.push( i );
			}
			sheet.addAnimation( new PxAnimation( "loop", frames, 10, PxAnimation.ANIM_LOOP ) );
			var e : PxEntity = new PxEntity( 120, 85 );
			e.addComponent( new PxBlitRenderComponent() );
			var anim : PxAnimationComponent = new PxAnimationComponent( sheet );
			anim.gotoAndPlay( "loop" );
			e.addComponent( anim );
			addEntity( e );

			sheet = new PxSpriteSheet();
			numFrames = sheet.addFramesFromMovieClip( AssetFactory.mc, StageQuality.LOW );
			frames = [];
			for ( i = 0; i &lt; numFrames; i++ ) { 				frames.push( i ); 			} 			sheet.addAnimation( new PxAnimation( "loop", frames, 10, PxAnimation.ANIM_LOOP ) ); 			e = new PxEntity( 200, 85 ); 			e.addComponent( new PxBlitRenderComponent() ); 			anim = new PxAnimationComponent( sheet ); 			anim.gotoAndPlay( "loop" ); 			e.addComponent( anim ); 			addEntity( e ); 			 			sheet = new PxSpriteSheet(); 			sheet.addFramesFromBitmapData( AssetFactory.player, 16, 16 ); 			sheet.addAnimation( new PxAnimation( "idle", [ 0 ] ) ); 			sheet.addAnimation( new PxAnimation( "run", [ 0, 1 ], 10, PxAnimation.ANIM_LOOP ) ); 			sheet.addAnimation( new PxAnimation( "jump", [ 2 ] ) ); 			sheet.addAnimation( new PxAnimation( "die", [ 3, 4 ], 10, PxAnimation.ANIM_LOOP ) ); 			e = new PxEntity( 90, 160 ); 			e.addComponent( new PxBlitRenderComponent() ); 			_animComp = new PxAnimationComponent( sheet ); 			_animComp.gotoAndPlay( "run" ); 			e.addComponent( _animComp ); 			addEntity( e ); 			 			addEntity( new PxTextFieldEntity( "Frames from SWF (high quality).         Frames from SWF (low quality)." ) ).transform.setPosition( 20, 20 ); 			addEntity( new PxTextFieldEntity( "Frames from image." ) ).transform.setPosition( 20, 120 ); 		} 		 		override public function dispose() : void { 			_animComp = null; 			 			super.dispose(); 		} 		 		override public function update( pDT : Number ) : void { 			_timePassed += pDT; 			if ( _timePassed &gt; 1 ) {
				_timePassed -= 1;
				_animID++;
				if ( _animID == 4 ) {
					_animID = 0;
				}
				switch ( _animID ) {
					case 0:
						_animComp.gotoAndPlay( "idle" );
						break;
					case 1:
						_animComp.gotoAndPlay( "run" );
						break;
					case 2:
						_animComp.gotoAndPlay( "jump" );
						break;
					case 3:
						_animComp.gotoAndPlay( "die" );
						break;

				}

			}

			if ( PxInput.isPressed( PxInput.KEY_ESC ) ) {
				engine.popScene();
			}

			super.update( pDT );
		}

	}

}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/engines/2d-engines/pixelizer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASaudio</title>
		<link>http://www.as3gamegears.com/sound/asaudio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asaudio</link>
		<comments>http://www.as3gamegears.com/sound/asaudio/#comments</comments>
		<pubDate>Fri, 04 May 2012 03:01:08 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[Sound]]></category>
		<category><![CDATA[LGPL]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=579</guid>
		<description><![CDATA[ASaudio is a small library dedicated to simple and efficient sound handling. It has a straight-forward, clear and coherent syntax. A great feature is that you can put a bunch of sounds into a Group or a Playlist object and control &#8230; <a href="http://www.as3gamegears.com/sound/asaudio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/asaudio/" target="_blank">ASaudio</a> is a small library dedicated to simple and efficient sound handling. It has a straight-forward, clear and coherent syntax. A great feature is that you can put a bunch of sounds into a Group or a Playlist object and control them globally. You can also put groups into other groups, and thus create complex hierarchical structures.</p>
<p>The 4 main structures (Track, Group, Playlist and Mixer) implements a common interface, so for many methods and properties, you can treat every element the same way. Each navigation/sound transform methods (<code>start()</code>, <code>stop()</code>, <code>mute()</code>, <code>left/right/center()</code>, etc.) has a &#8221;fade&#8221; option to make smooth sound transitions (tiny internal tween engine, with a single timer).</p>
<p><strong>Sample</strong></p>
<pre class="brush: as3">var track:Track = new Track("path/to/track.mp3");
track.start();
track.volume = .5;

// groups
var group:Group = new Group( [new Track("path/to/track1.mp3"), new Track("path/to/track2.mp3"), new Track("path/to/track3.mp3")] );
group.pan = -1;
group.addChild(new Track("path/to/track4.mp3"));
group.start();</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/sound/asaudio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foxhole</title>
		<link>http://www.as3gamegears.com/ui/foxhole/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=foxhole</link>
		<comments>http://www.as3gamegears.com/ui/foxhole/#comments</comments>
		<pubDate>Wed, 02 May 2012 09:48:00 +0000</pubDate>
		<dc:creator>Dovyski</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">http://www.as3gamegears.com/?p=577</guid>
		<description><![CDATA[Foxhole consists of various UI controls designed for mobile built on the top of Starling framework. Below is a list of available UI controls: Button: a typical button control, with optional toggle support. Includes a label and an icon, both optional. &#8230; <a href="http://www.as3gamegears.com/ui/foxhole/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/joshtynjala/foxhole-starling" target="_blank">Foxhole</a> consists of various UI controls designed for mobile built on the top of <a title="Starling" href="http://www.as3gamegears.com/engines/2d-engines/starling/" rel="as3gamegears">Starling</a> framework. Below is a list of available UI controls:</p>
<ul>
<li><strong>Button</strong>: a typical button control, with optional toggle support. Includes a label and an icon, both optional.</li>
<li><strong>Label</strong>: a single-line, non-interactive text control. Uses bitmap fonts. A simplified replacement for <code>starling.text.TextField</code> that is built on <code>FoxholeControl</code>.</li>
<li><strong>List</strong>: a touch-based, vertical list control. It has elastic edges and you can &#8220;throw&#8221; it.</li>
<li><strong>PickerList</strong>: a control similar to a combo box. Appears as a button when closed. The list is displayed as a fullscreen overlay on top of the stage.</li>
<li><strong>Progress Bar</strong>: displays the progress of a task over time. Non-interactive.</li>
<li><strong>Screen</strong>: an abstract class for implementing a single screen within a menu developed with ScreenNavigator. Includes common helper functionality, including back/menu/search hardware key callbacks, calculating scale from original resolution to current stage size, and template functions for initialize, layout and destroy.</li>
<li><strong>ScreenHeader</strong>: a header that displays a title along with a horizontal regions on the sides for additional UI controls. The left side is typically for navigation (to display a back button, for example) and the right for additional actions.</li>
<li><strong>ScreenNavigator</strong>: a state machine for menu systems. Uses events or signals to trigger navigation between screens or to call functions. Includes very simple dependency injection.</li>
<li><strong>Slider</strong>: a typical horizontal or vertical slider control.</li>
<li><strong>TabBar</strong>: a line of tabs, where one may be selected at a time.</li>
<li><strong>TextInput</strong>: a text entry control that allows users to enter and edit a single line of uniformly-formatted text. Uses <code>StageText</code>.</li>
<li><strong>ToggleSwitch</strong>: a sliding on/off switch. A common alternative to a checkbox in mobile environments.</li>
</ul>
<p><strong>Sample</strong></p>
<pre class="brush: as3">[Embed(source="pathToAtlasImage.png")]
private static const EMBEDDED_ATLAS_BITMAP:Class;

[Embed(source="pathToAtlasXml.xml",mimeType="application/octet-stream")]
private static const EMBEDDED_ATLAS_XML:Class;

[Embed(source="pathToFntFile.fnt",mimeType="application/octet-stream")]
private static const EMBEDDED_FONT_XML:Class;

var atlas:TextureAtlas = new TextureAtlas( Texture.fromBitmap( new EMBEDDED_ATLAS_BITMAP() ), XML( new EMBEDDED_ATLAS_XML() ) );

var font:BitmapFont = new BitmapFont( atlas.getTexture( "font-texture-from-atlas" ), XML( new EMBEDDED_FONT_XML() ) );

var button:Button = new Button();
button.label = "Click Me";
button.verticalAlign = Button.VERTICAL_ALIGN_MIDDLE;
button.horizontalAlign = Button.HORIZONTAL_ALIGN_CENTER;
button.defaultTextFormat = new BitmapFontTextFormat(font, NaN, 0x343434);
button.defaultSkin = new Image( atlas.getTexture( "button-up-skin" ) );
button.downSkin = new Image( atlas.getTexture( "button-down-skin" ) );
button.onRelease.add( function( button:Button ):void
{
    trace( "tapped!" );
});
this.addChild( button );
button.validate();
trace( button.width, button.height ); // same as width and height of the defaultSkin texture</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.as3gamegears.com/ui/foxhole/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

