asx.string.Lorem, Lorem Ipsum generator

asx.string.Lorem, Lorem Ipsum generator

error: pathspec 'asx/src/asx/string/Lorem.as' did not match any file(s) known to git

--- asx/src/asx/string/Lorem.as
+++ asx/src/asx/string/Lorem.as
@@ -0,0 +1,73 @@
+package asx.string
+{
+	import asx.array.compact;
+	import asx.array.inject;
+	import asx.array.map;
+	import asx.array.random;
+	import asx.array.reject;
+	import asx.array.shuffle;
+	import asx.fn.repeatedly;
+
+	public class Lorem
+	{
+		private static const WORDS:Array = (function():Array {
+			var loremIpsum:String = (<![CDATA[
+alias consequatur aut perferendis sit voluptatem accusantium doloremque aperiam
+eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo aspernatur aut odit aut fugit
+sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt neque dolorem ipsum quia dolor sit amet consectetur
+adipisci velit sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem ut enim ad
+minima veniam quis nostrum exercitationem ullam corporis nemo enim ipsam voluptatem quia voluptas sit suscipit laboriosam nisi ut
+aliquid ex ea commodi consequatur quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae et
+iusto odio dignissimos ducimus qui blanditiis praesentium laudantium totam rem voluptatum deleniti atque corrupti quos dolores et
+quas molestias excepturi sint occaecati cupiditate non provident sed ut perspiciatis unde omnis iste natus error similique sunt
+in culpa qui officia deserunt mollitia animi id est laborum et dolorum fuga et harum quidem rerum facilis est et expedita
+distinctio nam libero tempore cum soluta nobis est eligendi optio cumque nihil impedit quo porro quisquam est qui minus id quod
+maxime placeat facere possimus omnis voluptas assumenda est omnis dolor repellendus temporibus autem quibusdam et aut consequatur
+vel illum qui dolorem eum fugiat quo voluptas nulla pariatur at vero eos et accusamus officiis debitis aut rerum necessitatibus
+saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae itaque earum rerum hic tenetur a sapiente delectus ut
+aut reiciendis voluptatibus maiores doloribus asperiores repellat
+]]>).toString();
+
+			var _words:Array = loremIpsum.split(/\s/g);
+			_words = reject(_words, isEmptyString);
+			return _words;
+		})();
+
+		public static function text(textLength:int = 100, truncate:Boolean = false):String
+		{
+			var source:Array = shuffle(WORDS);
+			var result:String = "";
+			while (result.length < textLength)
+			{
+				result += source.pop() + " ";
+			}
+			result = result.slice(0, -1);
+			return truncate ? result.slice(0, 255): result;
+		}
+
+		public static function words(wordCount:int = 3):String
+		{
+			return shuffle(WORDS).slice(0, wordCount).join(' ');
+		}
+
+		public static function sentence(wordCount:int = 4, randomWordCount:int = 6):String
+		{
+			return capitalize(words(wordCount + (Math.floor(Math.random() * randomWordCount)))) + '.';
+		}
+
+		public static function sentences(sentenceCount:int = 3, wordCount:int = 4):Array
+		{
+			return repeatedly(sentenceCount, sentence, [wordCount]);
+		}
+
+		public static function paragraph(sentenceCount:int = 3, randomSentenceCount:int = 3):String
+		{
+			return sentences(sentenceCount + (Math.floor(Math.random() * randomSentenceCount))).join(' ');
+		}
+
+		public static function paragraphs(paragraphCount:int = 3, sentenceCount:int = 3):Array
+		{
+			return repeatedly(paragraphCount, paragraph, [sentenceCount]);
+		}
+	}
+}


adding more detailed log messages with line number and method name

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rafaelcordoba/cocktail-demo.git/'


improving docs

improving docs


missing test

missing test

error: pathspec 'test/ras3r/reactive_resource/ResponseTest.as' did not match any file(s) known to git

--- test/ras3r/reactive_resource/ResponseTest.as
+++ test/ras3r/reactive_resource/ResponseTest.as
@@ -0,0 +1,33 @@
+package ras3r.reactive_resource
+{
+	import as3spec.*;
+
+	public class ResponseTest extends Spec
+	{
+		public function run () :void
+		{
+			describe ('a new Response', function () :void
+			{
+				const response:Response = new Response;
+
+				it ('should be a Response', function () :void
+				{
+					so(response).should.be.a.kind_of(Response);
+				});
+
+				it ('should parse JSON object notation', function () :void
+				{
+					var object:Object = response.decode_json('{ "title": "Test Title" }');
+					so(object.title).should.equal('Test Title');
+				});
+
+				it ('should parse JSON array notation', function () :void
+				{
+					var array:Object = response.decode_json('[ { "title": "Test Title" }, { "title": "Another Test Title" } ]');
+					so(array).should.be.a.kind_of(Array);
+					so(array[0].title).should.equal('Test Title');
+				});
+			});
+		}
+	}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1290703 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/styles/metadata/LeadingStyle.as
+++ frameworks/projects/advancedgrids/src/mx/styles/metadata/LeadingStyle.as
@@ -1,23 +1,2 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

-/**
- *  Additional vertical space between lines of text.
- *
- *
The default value is 2.

- *
The default value for the ComboBox control is 0.

- *
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
 [Style(name="leading", type="Number", format="Length", inherit="yes")]


refactoring for new slave signature

refactoring for new slave signature


Adding FlowLayout. Doesnt play nicely with invalidated controls yet

error: pathspec 'src/org/openPyro/layout/FlowLayout.as' did not match any file(s) known to git

--- src/org/openPyro/layout/FlowLayout.as
+++ src/org/openPyro/layout/FlowLayout.as
@@ -0,0 +1,58 @@
+package org.openPyro.layout
+{
+	import flare.query.methods.where;
+
+	import flash.display.DisplayObject;
+
+	import org.openPyro.core.UIContainer;
+
+	public class FlowLayout extends AbstractLayout implements ILayout{
+
+		public var horizontalGap:Number = 0;
+		public var verticalGap:Number = 0;
+
+		public function FlowLayout(horizontalGap:Number=0, verticalGap:Number=0){
+			this.horizontalGap = horizontalGap;
+			this.verticalGap = verticalGap;
+		}
+
+		protected var _container:UIContainer;
+		public function set container(container:UIContainer):void
+		{
+			_container = container;
+		}
+
+		public function getMaxWidth(children:Array):Number{
+			return NaN;
+		}
+
+		public function getMaxHeight(children:Array):Number{
+			return NaN
+		}
+
+		override public function calculatePositions(children:Array):Array{
+			super.calculatePositions(children);
+
+			var child:DisplayObject;
+
+			var nowX:Number = _initX;
+			var nowY:Number = _initY;
+
+			for(var i:uint=0; i<children.length; i++){
+				child = children[i] as DisplayObject;
+
+				if(nowX + child.width < _container.width){
+
+				}
+				else{
+					nowX = _initX;
+					nowY += child.height + verticalGap;
+				}
+				var descriptor:LayoutDescriptor = new LayoutDescriptor(child, nowX, nowY);
+				nowX = child.x+child.width + horizontalGap;
+				layoutDescriptors.push(descriptor);
+			}
+			return layoutDescriptors;
+		}
+	}
+}


Updates

Updates

error: pathspec 'client/luadb/src/ldb_public.as' did not match any file(s) known to git

--- client/luadb/src/ldb_public.as
+++ client/luadb/src/ldb_public.as
@@ -0,0 +1,227 @@
+// ActionScript file
+
+import dialogs.*;
+
+import flash.display.*;
+import flash.external.*;
+import flash.media.*;
+import flash.net.*;
+
+import mx.collections.*;
+import mx.containers.TitleWindow;
+import mx.controls.ProgressBar;
+import mx.events.*;
+
+import utils.*;
+
+// Dialog for showing which units can be built on a building.
+// TODO: This will have to go into a separate SWF
+private var progressBarDialog:TitleWindow     	= null;
+private var theProgressBar:ProgressBar        	= null;
+private var gameHost: String				 	= "localhost";
+private var gamePort: int						= 9999;
+private var connecting:Boolean 					= true;
+private var cancelConnect:Boolean 				= false;
+private var connected:Boolean					= false;
+private var currClientId:String					= null;
+private var progressMonitor:*					= null;
+private var dataListeners:Array					= new Array();
+private var jsonParser:JsonParser				= null;
+private var commandCallbacks:*					= {};
+private var numFuncCalls:Number					= 0;
+private var connectDialog:OkCancelDialog		= null;
+
+private function onCreationComplete(event: Object): void
+{
+    // flash.system.Security.allowDomain("localhost:8080");
+    // will be called by JS when it has recieved the result of a command we invoked
+    ExternalInterface.addCallback("CommandCallback", CommandCallback);
+    ExternalInterface.addCallback("OnConnected", OnConnected);
+    ExternalInterface.addCallback("Log", Log);
+    ExternalInterface.addCallback("SetConnected", SetConnected);
+    ExternalInterface.addCallback("HandleEvent", HandleEvent);
+
+    // tell JS we are loaded
+    ExternalInterface.call("LuaDBLoaded");
+}
+
+// Callback for all commands - called by JS when a command is
+// finished or it has recieved a result
+private function CommandCallback(callback_id: *, result: *): void
+{
+	var callback_func:Function = commandCallbacks[callback_id];
+	delete commandCallbacks[callback_id];
+	callback_func(result);
+}
+
+// Called by JS when an event is recieved
+private function HandleEvent(event: *): void
+{
+	Log(JsonParser.JsonEncode(event));
+}
+
+// Sends a command via JS to the debugger.
+private function SendCommand(cmd: String, cmd_data: *, callback: Function): void
+{
+	var currFuncIndex:Number = numFuncCalls++;
+	commandCallbacks[currFuncIndex] = callback;
+	ExternalInterface.call("SendCommand", cmd, cmd_data, currFuncIndex);
+}
+
+
+public function Log(str: String): void
+{
+	trace(str);
+	logArea.text += "\n" + str;
+}
+
+
+public function SetConnected(conn:Boolean): void
+{
+	if (conn)
+	{
+		Log("Connected to debugger successfully");
+	}
+	else
+	{
+		Log("Disconnected to debugger");
+	}
+}
+
+public function isConnected(): Boolean
+{
+	return ExternalInterface.call("IsConnected");
+}
+
+private function OnConnected(): void
+{
+	connectDialog.setVisible(false);
+	SetConnected(true);
+}
+
+private function onMainMenuItem(event): void
+{
+	var which:String = event.item.@id;
+	if (which == "connectMI")
+	{
+		connectDialog = new ConnectDialog();
+		connectDialog.theApp = this;
+		connectDialog.show(true, this);
+	}
+}
+
+public function connect(host: String, port: int, progress:*): Boolean
+{
+	ExternalInterface.call("DoHandshake", host, port);
+	return true;
+}
+
+// List of commands we can send to the debugger
+private function CommandEvaluate(context: String, expr:String): void
+{
+	function result_callback(result: *): void
+	{
+	}
+	SendCommand("eval", {'context': context, 'expr_str': expr}, result_callback);
+}
+
+/*
+
+public function SubscribeToChannel(channel:String): void
+{
+	if (!isConnected())
+		return ;
+
+	var uri:String = "http://" + gameHost + ":" + gamePort + "/bayeux/";
+	var urlreq:URLRequest = new URLRequest(uri);
+	var urldata:String =  JsonParser.JsonEncode({'channel': '/meta/subscribe',
+												 'subscription': channel,
+				   		   						 'clientId': currClientId});
+	urlreq.data =  urldata;
+	urlreq.method = "POST";
+	var urlstream:URLStream 	= new URLStream();
+	var jsonParser:JsonParser 	= new JsonParser();
+
+	function urlStreamEventHandler(evt: Event): void
+	{
+		Log("Event: " + evt.type + ", " + evt.toString());
+		if (urlstream.bytesAvailable > 0)
+		{
+			jsonParser.processInput(urlstream);
+			var nextObject:* = jsonParser.next();
+			if (nextObject != null)
+			{
+				Log("Next Object: " + JsonParser.JsonEncode(nextObject));
+			}
+		}
+	}
+
+	urlstream.addEventListener(Event.COMPLETE, urlStreamEventHandler);
+	urlstream.addEventListener(Event.OPEN, urlStreamEventHandler);
+	urlstream.addEventListener(HTTPStatusEvent.HTTP_STATUS, urlStreamEventHandler);
+	urlstream.addEventListener(IOErrorEvent.IO_ERROR, urlStreamEventHandler);
+	urlstream.addEventListener(ProgressEvent.PROGRESS, urlStreamEventHandler);
+	urlstream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, urlStreamEventHandler);
+	urlstream.load(urlreq);
+}
+
+public function connect(host: String, port: int, progress:*): Boolean
+{
+	if (isConnected())
+		return true;
+
+	connecting 		= true;
+	cancelConnect 	= false;
+	gameHost		= host;
+	gamePort		= port;
+	jsonParser		= new JsonParser();
+
+	var uri:String = "http://" + host + ":" + port + "/bayeux/";
+	var urlreq:URLRequest = new URLRequest(uri);
+	var urldata:String =  JsonParser.JsonEncode({'channel': '/meta/handshake', 'version': '1.0',
+				   		   						 'supportedConnectionTypes':
+				   		   						  	['long-polling', 'callback-polling', 'iframe']});
+	urlreq.data =  urldata;
+	urlreq.method = "POST";
+	var loader:URLLoader = new URLLoader();
+
+	function loaderEventHandler(evt: Event): void
+	{
+		Log("Event: " + evt.type + ", " + evt.toString());
+		if (evt.type == Event.COMPLETE)
+		{
+			var ldr: URLLoader = evt.currentTarget as URLLoader;
+			var jp:JsonParser = new JsonParser();
+			var ba:ByteArray = new ByteArray();
+			ba.writeUTF(ldr.data);
+			ba.position = 0;
+			jp.processInput(ba);
+			var response:* = jp.next();
+			currClientId = response['clientId'];
+
+			connected = true;
+
+			// now subscribe to it!
+			SubscribeToChannel("/ldb");
+			SubscribeToChannel("/channel1");
+			SubscribeToChannel("/channel2");
+			SubscribeToChannel("/channel3");
+			SubscribeToChannel("/channel4");
+			SubscribeToChannel("/channel5");
+		}
+	}
+
+	loader.addEventListener(Event.COMPLETE, loaderEventHandler);
+	loader.addEventListener(Event.OPEN, loaderEventHandler);
+	loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, loaderEventHandler);
+	loader.addEventListener(IOErrorEvent.IO_ERROR, loaderEventHandler);
+	loader.addEventListener(ProgressEvent.PROGRESS, loaderEventHandler);
+	loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loaderEventHandler);
+	loader.load(urlreq);
+	return true;
+}
+
+public function disconnect(): void
+{
+}
+*/


bug fix, Player.removePiece() was removing at (x, x) instead of (x, y).

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rlowke/lowkemedia.git/'


polishing code, documenting class

polishing code, documenting class


Check whether the payload type is Event

Check whether the payload type is Event

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/eric-stanley/robotlegs-framework.git/'


Transferred from the Adobe Open Source Subversion Repository

Revision: 11452
Author:   klin@adobe.com
Date:     2009-11-05T01:43:45.759633Z

Log Message:
-----------
Couple of various fixes.

ComboBox.as - The dropDown was not receiving changes to styles nor dataproviders. This was a result of not recreating the dropDown each time it was shown. I've changed the default of the flag for destroying the dropDown to be true. I've also modified the code to only not destroy the dropDown when it is showing or being shown.

ButtonBar.as - In one case, when calculating the percentage that each button takes of the width, there was a rounding error that caused the total percentage to be less than 100%. I've changed the code to use Numbers to avoid the rounding error.

DropDownList.as - I've fixed the page down code to take into account the case when selectedIndex==-1.

Label.as, SWFLoader.as, TextInput.as - Excluded baseColor style.

TitleWindowBoundsEvent.as - ASDoc change. "afterBounds" is always null when the "windowMoveStart" event is dispatched

QE notes: No
Doc notes: No
Bugs: SDK-21715, SDK-23338, SDK-23512, SDK-23838, SDK-23660
Reviewer: Chet
Tests run: checkintests, ButtonBar, ToggleButtonBar, tabnavigator
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/events/TitleWindowBoundsEvent.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1267913 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/ButtonBar.as
+++ frameworks/projects/mx/src/mx/controls/ButtonBar.as
@@ -698,11 +698,11 @@
                     // Distribute the remaining width to others.
                     else if (excessSpace < 0)
                     {
-                        var assignedWidth:int = c.measuredWidth;
+                        var assignedWidth:Number = c.measuredWidth;
                         if (assignedWidth > averageWidth)
                             assignedWidth = (w - tSmall) / nLarge;

-                        c.percentWidth = Number(assignedWidth) / w * 100;
+                        c.percentWidth = assignedWidth / w * 100;
                     }

                     // If they fit comfortably with extra space left,


add CurrencyFormatter

add CurrencyFormatter

error: pathspec 'frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/CurrencyFormatter.as' did not match any file(s) known to git

--- frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/CurrencyFormatter.as
+++ frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/CurrencyFormatter.as
@@ -0,0 +1,215 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.accessories
+{
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IFormatBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+
+	/**
+	 * The CurrencyFormatter class formats a value in separated groups. The formatter listens
+	 * to a property on a model and when the property changes, formats it and dispatches a
+	 * formatChanged event.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class CurrencyFormatter extends EventDispatcher implements IFormatBead
+	{
+		/**
+		 *  constructor
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function CurrencyFormatter()
+		{
+			super();
+		}
+
+		private var _strand:IStrand;
+
+		/**
+		 *  @copy org.apache.flex.core.IBead#strand
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+
+			// Listen for the beadsAdded event which signals when all of a strand's
+			// beads have been added.
+			IEventDispatcher(value).addEventListener("beadsAdded",handleBeadsAdded);
+		}
+
+		/**
+		 * @private
+		 */
+		private function handleBeadsAdded(event:Event):void
+		{
+			// Listen for the change in the model
+			var model:IBeadModel = _strand.getBeadByType(IBeadModel) as IBeadModel;
+			model.addEventListener(eventName,propertyChangeHandler);
+			model.addEventListener(propertyName+"Change",propertyChangeHandler);
+
+			// format the current value of that property
+			propertyChangeHandler(null);
+		}
+
+		private var _propertyName:String;
+		private var _eventName:String;
+		private var _formattedResult:String;
+		private var _fractionalDigits:Number = 2;
+        private var _currencySymbol:String = "$";
+
+		/**
+		 *  The name of the property on the model to format.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get propertyName():String
+		{
+			if (_propertyName == null) {
+				return "text";
+			}
+			return _propertyName;
+		}
+		public function set propertyName(value:String):void
+		{
+			_propertyName = value;
+		}
+
+		/**
+		 *  The event dispatched by the model when the property changes. The
+		 *  default is propertyName+"Changed".
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get eventName():String
+		{
+			if (_eventName == null) {
+				return _propertyName+"Changed";
+			}
+			return _eventName;
+		}
+		public function set eventName(value:String):void
+		{
+			_eventName = value;
+		}
+
+        /**
+		 *  Number of digits after the decimal separator
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get fractionalDigits():int
+		{
+			return _fractionalDigits;
+		}
+		public function set fractionalDigits(value:int):void
+		{
+            _fractionalDigits = value;
+		}
+
+        /**
+         *  The currency symbol, such as "$"
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get currencySymbol():String
+        {
+            return _currencySymbol;
+        }
+        public function set currencySymbol(value:String):void
+        {
+            _currencySymbol = value;
+        }
+
+        /**
+		 *  The formatted string.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get formattedString():String
+		{
+			return _formattedResult;
+		}
+
+		/**
+		 * @private
+		 */
+		private function propertyChangeHandler(event:Event):void
+		{
+			// When the property changes, fetch it from the model and
+			// format it, storing the result in _formattedResult.
+			var model:IBeadModel = _strand.getBeadByType(IBeadModel) as IBeadModel;
+			var value:Object = model[propertyName];
+			_formattedResult = format(value);
+
+			// Dispatch the formatChanged event so any bead that's interested in
+			// the formatted string knows to use it.
+			var newEvent:Event = new Event("formatChanged");
+			this.dispatchEvent(newEvent);
+		}
+
+        /**
+         *  Computes the formatted string.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function format(value:Object):String
+		{
+			if (value == null) return "";
+
+			var num:Number = Number(value);
+            var source:String = num.toPrecision(fractionalDigits);
+
+			return currencySymbol + source;
+		}
+	}
+}


Add type generics to AS3 test file.

Add type generics to AS3 test file.

fatal: remote error: upload-pack: not our ref 5dd0919f4fe3f526fab411fc37bea2b421de1049
fatal: the remote end hung up unexpectedly


Transferred from the Adobe Open Source Subversion Repository

Revision: 12860
Author:   mhorn@adobe.com
Date:     2009-12-11T20:35:27.553353Z

Log Message:
-----------
asdoc updates for l10n

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/MXFTETextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/FTETextField.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1277951 13f79535-47bb-0310-9956-ffa450edef68

fatal: unable to access 'https://github.com/shyamalschandra/flex-sdk.git/': The requested URL returned error: 403


Katakana

Katakana

fatal: unable to access 'https://github.com/c0d3m0nk3y/Kuroneko.git/': The requested URL returned error: 403


Transferred from the Adobe Open Source Subversion Repository

Revision: 18072
Author:   chiedozi@adobe.com
Date:     2010-10-07T21:09:04.099363Z

Log Message:
-----------
PARB Changes to ViewNavigator feature set.  Changes summarized below:

View
active getter renamed to isActive
Removed context property from View and moved it to ViewNavigator

ViewNavigator
context property is now typed Object
navigationStack property now mx_internal in ViewNavigatorBase
factory parameter for push operations renamed to  viewClass
NavigationStack push and pop api names changed to match ViewNavigator methods
active getter renamed isActive
viewNavigator no longer dispatches a COMPLETE event
defaultTransitions are no longer skin parts.  They are now  mx_internal vars.

TabbedViewNavigator
No longer dispatches complete, instead dispatches IndexChangeEvent.CHANGE

ViewProxy
ViewProxy renamed to ViewDescriptor
persistedData renamed to persistenceData

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/ContainerDestructionPolicy.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewReturnObject.as</path>
<path kind="dir" action="M">/private/flex/sdk/branches/hero_private</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as" copyfrom-rev="18044" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewDescriptor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewProxy.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1264170 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -134,7 +134,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get active() : Boolean
+    public function get isActive():Boolean
     {
         return _active;
     }
@@ -142,7 +142,7 @@
     /**
      * @private
      */
-    mx_internal function setActive(value:Boolean) : void
+    mx_internal function setActive(value:Boolean):void
     {
         if (_active != value)
         {
@@ -261,39 +261,6 @@
      */
     public var navigator:ViewNavigator;

-    //----------------------------------
-    //  context
-    //----------------------------------
-
-    private var _context:String = null;
-
-    /**
-     *  The string that describes the context in which this view was
-     *  created.  This property is assigned to the context
-     *  parameter that is passed into ViewNavigator.pushView().
-     *
-     *  @default null
-     *
-     *  @see spark.components.ViewNavigator
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.1
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get context():String
-    {
-        return _context;
-    }
-
-    /**
-     *  @private
-     */
-    mx_internal function setContext(value:String):void
-    {
-        _context = value;
-    }
-
     //--------------------------------------------------------------------------
     //
     //  UI Template Properties
@@ -332,7 +299,7 @@
         _actionBarVisible = value;

         // Immediately request actionBar's visibility be toggled
-        if (active && navigator)
+        if (isActive && navigator)
         {
             if (_actionBarVisible)
                 navigator.showActionBar();
@@ -548,7 +515,7 @@
 		_tabBarVisible = value;

 		// Immediately request actionBar's visibility be toggled
-		if (active && navigator)
+		if (isActive && navigator)
 		{
             if (hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
             {


starting HttpDataSource

starting HttpDataSource


Modifications on security

Modifications on security

git-svn-id: 27326a786375daad9d33dc990c6f272e4c8f567c@839 fda5f131-174c-0410-8613-e0905860106b

error: pathspec 'org.openwms/trunk/source/org.openwms.common.domain.as/src/main/flex/org/openwms/common/domain/system/usermanagement/SecurityObject.as' did not match any file(s) known to git

--- org.openwms/trunk/source/org.openwms.common.domain.as/src/main/flex/org/openwms/common/domain/system/usermanagement/SecurityObject.as
+++ org.openwms/trunk/source/org.openwms.common.domain.as/src/main/flex/org/openwms/common/domain/system/usermanagement/SecurityObject.as
@@ -0,0 +1,27 @@
+/*
+ * openwms.org, the Open Warehouse Management System.
+ *
+ * This file is part of openwms.org.
+ *
+ * openwms.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * openwms.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software. If not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.openwms.common.domain.system.usermanagement {
+
+    [Bindable]
+    [RemoteClass(alias="org.openwms.common.domain.system.usermanagement.SecurityObject")]
+    public class SecurityObject extends SecurityObjectBase {
+    }
+}


Fiducial with widgets demo app class without TUI

error: pathspec 'fbApplicationNoTUI.as' did not match any file(s) known to git

--- fbApplicationNoTUI.as
+++ fbApplicationNoTUI.as
@@ -0,0 +1,463 @@
+package touchAll.demos.tronFiducialsDemo
+{
+	import flash.ui.*;
+	import flash.display.*;
+	//import flash.filters.*;
+	//import flash.events.*;
+	import flash.events.Event;
+	//import flash.events.TouchEvent;
+	import flash.events.MouseEvent;
+	import flash.events.KeyboardEvent;
+	//import flash.events.TransformGestureEvent;
+
+	import org.tuio.*;
+	import org.tuio.connectors.*;
+	import org.tuio.debug.*;
+	import org.tuio.fiducial.*;
+	import org.tuio.gestures.*;
+	import org.tuio.mouse.*;
+	import org.tuio.windows7.*;
+
+	import touchAll.piano.Piano;
+	import touchAll.keyboard.CustomKeyboard;
+	import touchAll.pong.cl.kirill.PongGame;
+
+	/**
+	 * @author Gonçalo Amador
+	 */
+	[SWF(width = "1280", height = "720", frameRate = "60", backgroundColor = "#ffffff")]
+	//[SWF(width = "1280", height = "720", frameRate = "60", backgroundColor = "#000000")]
+	public class ExampleFiducialsDemo extends MovieClip
+	{
+		/* global variables */
+		private var _stage:Stage;
+		private var _width:int = 1280;
+		private var _height:int = 720;
+		private var _color:uint = 0x000000;
+		private var _tm:TuioManager;
+		private var _gm:GestureManager;
+		private var _packets_count:uint = 0;
+		private var _log:String = "";
+		private var _mouseCursor:Sprite;
+		private var _background:Sprite = new Sprite;
+
+		private var _keyboard:CustomKeyboard;
+		private var _pongGame:PongGame;
+		private var _piano:Piano;
+		private var _textColor:uint = 0x8B8B8B;
+		private var _buttonColor:uint = 0x000000;
+		private var _buttonTextColor:uint = 0xFFFFFF;
+		private var _buttonOnColor:uint = 0xBB0000;
+		private var _buttonOffColor:uint = 0x330000;
+		private var _borderColor:uint = 0x000000;
+		private var _white_keys_color:uint = 0xFEFEFE;
+
+		private var _debug:Boolean = true;
+		private var _LCconnector:Boolean = false;
+		private var _UDPconnector:Boolean = true;
+		private var _TCPconnector:Boolean = false;
+		private var _host:String = "127.0.0.1";
+		private var _port:int = 3333;
+		private var _fiducialHandler:Boolean = true;
+		private var _tuioManager:Boolean = true;
+		private var _gestureManager:Boolean = true;
+		private var _mouseToTouch:Boolean = false;
+		private var _tc:TuioClient;
+
+		public function ExampleFiducialsDemo():void
+		{
+			if (stage) init();
+			else addEventListener(Event.ADDED_TO_STAGE, init);
+		}
+
+		private function init(e:Event = null):void
+		{
+			removeEventListener(Event.ADDED_TO_STAGE, init);
+
+			_stage = stage;
+
+			/* LOAD STAGE CONTENT */
+			backgroundLoader();
+			//backgroundEventListenersLoader();
+
+			/* stage set up */
+			stageLoader();
+			stageEventListenersLoader();
+
+			/* tuio set up */
+			tuioLoader();
+		}
+
+		/* BACKGROUND FUNCTIONS */
+		/**
+		 * load default stage background
+		 */
+		public function backgroundLoader():void {
+			/*
+			 * Set blend mode "ALPHA" and
+			 * fill background at the starting position (0,0), with rgb color 0xFFFFFF and alpha blending 1
+			 */
+			_background.blendMode = BlendMode.ALPHA;
+			_background.graphics.beginFill(0xFFFFFF,1);
+			_background.graphics.drawRect(0,0,_stage.stageWidth,_stage.stageHeight);
+			_background.graphics.endFill();
+
+			/* set activate doubleClick mouse checks */
+			trace("set activate doubleClick mouse checks.");
+			_background.doubleClickEnabled = true;
+
+			/* add the background to the stage */
+			trace("add the background to the stage.");
+			_stage.addChild(_background);
+		}
+
+
+		public function backgroundEventListenersLoader():void {
+			trace("backgroundEventListenersLoader.");
+		}
+
+		/**
+		 * stage set up
+		 */
+		public function stageLoader():void {
+			/* STAGE SET UP */
+			trace("STAGE SET UP.");
+			_stage.stageWidth = _width;
+			_stage.stageHeight = _height;
+
+			/* AIR stage settings */
+			trace("AIR stage settings.");
+			//_stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
+			_stage.scaleMode = StageScaleMode.NO_SCALE;
+			_stage.align = StageAlign.TOP_LEFT;
+
+			/* set activate doubleClick mouse checks */
+			trace("set activate doubleClick mouse checks.");
+			_stage.doubleClickEnabled = true;
+
+			/* load an circle to track mouse cursor */
+			trace("load an circle to track mouse cursor.");
+			if (_debug) {
+				addMouseCursor();
+			}
+		}
+
+		/**
+		 * stage event listeners set up
+		 */
+		public function stageEventListenersLoader():void {
+			/* STAGE EVENT LISTENERS */
+			/* add stage keyboard event listeners */
+			trace("add stage keyboard event listeners.");
+			if (_tuioManager) {
+				_stage.addEventListener(KeyboardEvent.KEY_DOWN, showTuioNetworkPacketsLog);
+			}
+
+			/* add stage mouse event listeners */
+			trace("add stage mouse event listeners.");
+			if (_debug) {
+				_stage.addEventListener(MouseEvent.MOUSE_MOVE, followMouse);
+				_stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
+				_stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
+			}
+
+			/* add stage Fiducial (object) event listeners */
+			trace("add stage fiducial event listeners.");
+			_stage.addEventListener(FiducialEvent.ADD, fiducialADD);
+			_stage.addEventListener(FiducialEvent.MOVE, fiducialUPDATE);
+			_stage.addEventListener(FiducialEvent.REMOVED, fiducialREMOVE);
+		}
+
+		/* FIDUCIAL FUNCTIONS */
+		/**
+		 * handle fiducial (Object) add events
+		 */
+		public function fiducialADD(e:FiducialEvent):void {
+			// debug mode console message if FiducialEvent.ADD event captured
+			trace("Fiducial #" + e.fiducialId + " fiducial added.");
+
+			if (e.fiducialId == 0)
+			{
+				/* alternative 1: load keyboard class */
+				_keyboard = new CustomKeyboard(e.x, e.y, 718, 200, e.x, e.y + 220, _buttonTextColor, _buttonColor, _borderColor);
+				//_keyboard.filters = [new GlowFilter(0x0055ff, .75, 100, 100, 2, 2, false, false)];
+
+				_stage.addChild(_keyboard);
+
+				/* alternative 2: load the content of *.swf file */
+				//var _objectLoader:Loader = new Loader;
+				//_objectLoader.load(new URLRequest("CustomKeyboard.swf"));
+				//_stage.addChild(_objectLoader);
+			}
+
+			if (e.fiducialId == 1)
+			{
+				_pongGame = new PongGame(_stage, _borderColor);
+				_pongGame.x = e.x;
+				_pongGame.y = e.y;
+				_stage.addChild(_pongGame);
+			}
+
+			if (e.fiducialId == 2)
+			{
+				_piano = new Piano(_textColor, _buttonTextColor, _buttonOnColor, _buttonOffColor, _white_keys_color);
+				//_piano = new Piano();
+				_piano.x = e.x;
+				_piano.y = e.y;
+				_piano.rotation = 90;
+				_piano.scaleX = 2;
+				_piano.scaleY = 2;
+				_stage.addChild(_piano);
+			}
+		}
+
+		/**
+		 * handle fiducial (Object) remove events
+		 */
+		public function fiducialREMOVE(e:FiducialEvent):void {
+			trace("Fiducial #" + e.fiducialId + " fiducial removed.");
+
+			if (e.fiducialId == 0)
+			{
+				/* alternative 1: remove keyboard class from stage */
+				_stage.removeChild(_keyboard);
+
+				/* alternative 2: remove loaded *.swf file from stage */
+				//_stage.removeChild(_objectLoader);
+			}
+
+			if (e.fiducialId == 1)
+			{
+				_pongGame.stopGame();
+				_stage.removeChild(_pongGame);
+			}
+
+			if (e.fiducialId == 2)
+			{
+				_stage.removeChild(_piano);
+			}
+		}
+
+		/**
+		 * handle fiducial (Object) move events
+		 */
+		public function fiducialUPDATE(e:FiducialEvent):void {
+			trace("Fiducial #" + e.fiducialId + " fiducial move.");
+
+			if (e.fiducialId == 0) {
+				_keyboard.update(e.x, e.y, e.x, e.y + 220);
+			}
+
+			if (e.fiducialId == 1) {
+				_pongGame.x = e.x;
+				_pongGame.y = e.y;
+			}
+
+			if (e.fiducialId == 2)
+			{
+				_piano.x = e.x;
+				_piano.y = e.y;
+			}
+		}
+
+		/**
+		 * tuio set up
+		 */
+		public function tuioLoader():void {
+			//var _tc:TuioClient;
+
+			/* tuio client setup (a LC/UDP/TCP socket that connects to the server '_host' using port '_port') creation */
+			if (_LCconnector) {
+				trace("tuioClient LC connector.")
+				_tc = new TuioClient(new LCConnector());
+			}
+
+			if (_TCPconnector) {
+				trace("tuioClient TCP connector.")
+				_tc = new TuioClient(new TCPConnector(_host, _port));
+			}
+
+			if (_UDPconnector) {
+				trace("tuioClient UDP connector.")
+				_tc = new TuioClient(new UDPConnector(_host, _port));
+			}
+
+			/* optional: activate tuio fiducial capture events */
+			if (_fiducialHandler) {
+				trace("fiducial Handler on.")
+				var fiducialDispatcher:TuioFiducialDispatcher = TuioFiducialDispatcher.init(_stage);
+				_tc.addListener(fiducialDispatcher);
+			}
+
+			/* optional: activate tuio debug mode to display touches */
+			if (_debug) {
+				trace("tuioDebug on.")
+				_tc.addListener(TuioDebug.init(_stage));
+			}
+
+			/* tuioManager setup (a container which processes the Tuio tracking data received by the given TuioClient) creation */
+			//if (_tuioManager) {
+			if (_tuioManager) {
+				trace("tuioManager on.")
+				_tm = TuioManager.init(_stage, _tc);
+				//_tm.touchTargetDiscoveryMode = TuioManager.TOUCH_TARGET_DISCOVERY_NONE
+
+				/* add tuioManager tuio event listeners */
+				_tm.addEventListener(TuioEvent.ADD, packetsCount);
+				_tm.addEventListener(TuioEvent.REMOVE, packetsCount);
+				_tm.addEventListener(TuioEvent.UPDATE, packetsCount);
+			}
+
+			/* optional: treat Gestures */
+			if (_gestureManager) {
+				trace("gestureManager on.")
+				_gm = GestureManager.init(_stage, _tc);
+				//_gm.touchTargetDiscoveryMode = GestureManager.TOUCH_TARGET_DISCOVERY_NONE;
+
+				GestureManager.addGesture(new DragGesture());
+				GestureManager.addGesture(new ZoomGesture());
+				GestureManager.addGesture(new RotateGesture());
+
+				//GestureManager.addGesture(new ScrollGesture());
+				GestureManager.addGesture(new PressTapGesture());
+				GestureManager.addGesture(new OneDownOneMoveGesture());
+			}
+
+			/* optional: treat MouseEvents also as TouchEvents */
+			if (_mouseToTouch) {
+				var mouseToTouch:MouseToTouchDispatcher = new MouseToTouchDispatcher(_stage);
+			}
+
+			/* optional: convert the native TouchEvents into tuio TouchEvents */
+			//var winTouch:Windows7TouchToTuioDispatcher = new Windows7TouchToTuioDispatcher(_stage,false,false);
+
+			/* optional: dispatch the events by using the TuioManager */
+			//var winTouch:Windows7TouchToTuioDispatcher = new Windows7TouchToTuioDispatcher(_stage,true,false);
+		}
+
+		/**
+		 * Show total tuio events captured log
+		 */
+		private function packetsCount(e:TuioEvent):void {
+			var date:Date = new Date();
+			_packets_count++;
+
+			_log += _packets_count + " Packet captured TuioEvent at " + date.fullYear;
+
+			if ((date.month + 1) < 10) {
+				_log += "-0" + (date.month + 1);
+			}
+			else {
+				_log += "-" + (date.month + 1);
+			}
+
+			if (date.date < 10) {
+				_log += "-0" + date.date;
+			}
+			else {
+				_log += "-" + date.date;
+			}
+
+			if (date.hours < 10) {
+				_log += " 0" + date.hours;
+			}
+			else {
+				_log += " " + date.hours;
+			}
+
+			if (date.minutes < 10) {
+				_log += ":0" + date.minutes;
+			}
+			else {
+				_log += ":" + date.minutes;
+			}
+
+			if (date.seconds < 10) {
+				_log += ":0" + date.seconds;
+			}
+			else {
+				_log += ":" + date.seconds;
+			}
+
+			if (date.milliseconds < 10) {
+				_log += ".00" + date.milliseconds;
+			} else if (date.milliseconds < 100) {
+				_log += ".0" + date.milliseconds;
+			}
+			else {
+				_log += "." + date.milliseconds;
+			}
+
+			_log += "\n";
+		}
+
+		/**
+		 * handle stage "F1" keyboard events
+		 */
+		private function showTuioNetworkPacketsLog(e:KeyboardEvent):void {
+			if (e.keyCode == Keyboard.F1) {
+				trace("touch hold.");
+				trace(_log);
+				trace("Packets captured " + _packets_count + "\n");
+			}
+		}
+
+		/* MOUSE CURSOR FUNCTIONS */
+		/**
+		 * display a circle where mouse cursor is
+		 */
+		private function addMouseCursor():void {
+			/* Create a Sprite instance called _mouseCursor */
+			_mouseCursor = new Sprite;
+
+			/*
+			 * Set blend mode "DARKEN" and
+			 * fill a circle at the starting position (0,0) of radius 5, with rgb color '_color' and alpha blending 1 or
+			 * draw a circle with line thickness 1.1, with rgb color '_color' and alpha blending 1.
+			 */
+			//_mouseCursor.blendMode = BlendMode.DARKEN;
+			//_mouseCursor.graphics.beginFill(0x770000, 1);
+			_mouseCursor.graphics.lineStyle(1.1, _color, 1, false, LineScaleMode.NONE);
+			_mouseCursor.graphics.drawCircle(0, 0, 20);
+			//_mouseCursor.graphics.endFill();
+
+			/* set circle center at mouse coursor position */
+			_mouseCursor.x = _mouseCursor.mouseX;
+			_mouseCursor.y = _mouseCursor.mouseY;
+
+			/* set circle visibility default value */
+			_mouseCursor.visible = false;
+
+			/* add the circle to the stage */
+			_stage.addChild(_mouseCursor);
+		}
+
+		/**
+		 * handle mouse movement events for the circle
+		 */
+		private function followMouse(e:MouseEvent):void {
+			if (_mouseCursor != null) {
+				_mouseCursor.x = _stage.mouseX;
+				_mouseCursor.y = _stage.mouseY;
+			}
+		}
+
+		/**
+		 * handle mouse down events for circle
+		 */
+		private function mouseDown(e:MouseEvent):void {
+			if (_mouseCursor != null) {
+				_mouseCursor.visible = true;
+			}
+		}
+
+		/**
+		 * handle mouse up events for circle
+		 */
+		private function mouseUp(e:MouseEvent):void {
+			if (_mouseCursor != null) {
+				_mouseCursor.visible = false;
+			}
+		}
+	}
+}


Created dedicated RaceTrack class. Some cleanup inside it.

error: pathspec 'src/engine/tetragon/view/render/racetrack/RaceTrack.as' did not match any file(s) known to git

--- src/engine/tetragon/view/render/racetrack/RaceTrack.as
+++ src/engine/tetragon/view/render/racetrack/RaceTrack.as
@@ -0,0 +1,1224 @@
+/*
+ *      _________  __      __
+ *    _/        / / /____ / /________ ____ ____  ___
+ *   _/        / / __/ -_) __/ __/ _ `/ _ `/ _ \/ _ \
+ *  _/________/  \__/\__/\__/_/  \_,_/\_, /\___/_//_/
+ *                                   /___/
+ *
+ * Tetragon : Game Engine for multi-platform ActionScript projects.
+ * http://www.tetragonengine.com/
+ * Copyright (c) The respective Copyright Holder (see LICENSE).
+ *
+ * Permission is hereby granted, to any person obtaining a copy of this software
+ * and associated documentation files (the "Software") under the rules defined in
+ * the license found at http://www.tetragonengine.com/license/ or the LICENSE
+ * file included within this distribution.
+ *
+ * The above copyright notice and this permission notice must be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT
+ * HOLDER AND ITS LICENSORS DISCLAIM ALL WARRANTIES AND CONDITIONS, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES AND CONDITIONS OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, AND ANY
+ * WARRANTIES AND CONDITIONS ARISING OUT OF COURSE OF DEALING OR USAGE OF TRADE.
+ * NO ADVICE OR INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED FROM THE COPYRIGHT
+ * HOLDER OR ELSEWHERE WILL CREATE ANY WARRANTY OR CONDITION NOT EXPRESSLY STATED
+ * IN THIS AGREEMENT.
+ */
+package tetragon.view.render.racetrack
+{
+	import tetragon.Main;
+	import tetragon.data.sprite.SpriteAtlas;
+	import tetragon.input.KeyMode;
+	import tetragon.util.display.centerChild;
+
+	import view.racing.RenderBuffer;
+	import view.racing.constants.COLORS;
+	import view.racing.constants.ColorSet;
+	import view.racing.constants.ROAD;
+	import view.racing.parallax.ParallaxLayer;
+	import view.racing.parallax.ParallaxScroller;
+	import view.racing.vo.Car;
+	import view.racing.vo.PCamera;
+	import view.racing.vo.PPoint;
+	import view.racing.vo.PScreen;
+	import view.racing.vo.PWorld;
+	import view.racing.vo.SSprite;
+	import view.racing.vo.Segment;
+	import view.racing.vo.Sprites;
+
+	import flash.display.Bitmap;
+	import flash.display.BitmapData;
+
+
+	/**
+	 * @author Hexagon
+	 */
+	public class RaceTrack
+	{
+		// -----------------------------------------------------------------------------------------
+		// Properties
+		// -----------------------------------------------------------------------------------------
+
+		private var _atlas:SpriteAtlas;
+		private var _atlasImage:BitmapData;
+		private var _renderBuffer:RenderBuffer;
+		private var _bufferBitmap:Bitmap;
+		private var _sprites:Sprites;
+		private var _bgScroller:ParallaxScroller;
+		private var _bgLayer1:ParallaxLayer;
+		private var _bgLayer2:ParallaxLayer;
+		private var _bgLayer3:ParallaxLayer;
+		private var _segments:Vector.<Segment>;
+		// array of road segments
+		private var _cars:Vector.<Car>;
+		// array of cars on the road
+		private var _bufferWidth:int = 1024;
+		private var _bufferHeight:int = 640;
+		private var _bufferWidthHalf:int;
+		private var _bufferHeightHalf:int;
+		private var _dt:Number;
+		// how long is each frame (in seconds)
+		private var _resolution:Number;
+		// scaling factor to provide resolution independence (computed)
+		private var _drawDistance:int = 300;
+		// number of segments to draw
+		private var _hazeDensity:int = 10;
+		// exponential fog density
+		private var _hazeColor:uint;
+		private var _cameraHeight:Number = 1000;
+		// z height of camera (500 - 5000)
+		private var _cameraDepth:Number;
+		// z distance camera is from screen (computed)
+		private var _fieldOfView:int = 100;
+		// angle (degrees) for field of view (80 - 140)
+		private var _bgSpeedMult:Number = 0.001;
+		// background sky layer scroll speed when going around curve (or up hill)
+		private var _skyOffset:Number = 0;
+		// current sky scroll offset
+		private var _hillOffset:Number = 0;
+		// current hill scroll offset
+		private var _treeOffset:Number = 0;
+		// current tree scroll offset
+		private var _playerX:Number = 0;
+		// player x offset from center of road (-1 to 1 to stay independent of roadWidth)
+		private var _playerZ:Number;
+		// player relative z distance from camera (computed)
+		private var _roadWidth:int = 2000;
+		// actually half the roads width, easier math if the road spans from -roadWidth to +roadWidth
+		private var _segmentLength:int = 200;
+		// length of a single segment
+		private var _rumbleLength:int = 3;
+		// number of segments per red/white rumble strip
+		private var _trackLength:int = 200;
+		// z length of entire track (computed)
+		private var _lanes:int = 3;
+		// number of lanes
+		private var _totalCars:Number = 200;
+		// total number of cars on the road
+		private var _accel:Number;
+		// acceleration rate - tuned until it 'felt' right
+		private var _breaking:Number;
+		// deceleration rate when braking
+		private var _decel:Number;
+		// 'natural' deceleration rate when neither accelerating, nor braking
+		private var _offRoadDecel:Number = 0.99;
+		// speed multiplier when off road (e.g. you lose 2% speed each update frame)
+		private var _offRoadLimit:Number;
+		// limit when off road deceleration no longer applies (e.g. you can always go at least this speed even when off road)
+		private var _centrifugal:Number = 0.3;
+		// centrifugal force multiplier when going around curves
+		private var _position:Number;
+		// current camera Z position (add playerZ to get player's absolute Z position)
+		private var _speed:Number;
+		// current speed
+		private var _maxSpeed:Number;
+		// top speed (ensure we can't move more than 1 segment in a single frame to make collision detection easier)
+		private var _currentLapTime:Number = 0;
+		// current lap time
+		private var _lastLapTime:Number = 0;
+		// last lap time
+		private var _fast_lap_time:Number;
+		private var _isAccelerate:Boolean;
+		private var _isBrake:Boolean;
+		private var _isSteerLeft:Boolean;
+		private var _isSteerRight:Boolean;
+
+
+		// -----------------------------------------------------------------------------------------
+		// Signals
+		// -----------------------------------------------------------------------------------------
+
+
+		// -----------------------------------------------------------------------------------------
+		// Public Methods
+		// -----------------------------------------------------------------------------------------
+
+		/**
+		 * @inheritDoc
+		 */
+		public function start():void
+		{
+			reset();
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		public function reset():void
+		{
+			_dt = 1 / Main.instance.gameLoop.frameRate;
+			_maxSpeed = _segmentLength / _dt;
+			_accel = _maxSpeed / 5;
+			_breaking = -_maxSpeed;
+			_decel = -_maxSpeed / 5;
+			_offRoadLimit = _maxSpeed / 4;
+			_cameraDepth = 1 / Math.tan((_fieldOfView / 2) * Math.PI / 180);
+			_playerZ = (_cameraHeight * _cameraDepth);
+			_resolution = 1.6;
+			// _bufferHeight / _bufferHeight;
+			_position = 0;
+			_speed = 0;
+			_bufferWidthHalf = _bufferWidth * 0.5;
+			_bufferHeightHalf = _bufferHeight * 0.5;
+			_cars = new Vector.<Car>();
+
+			_hazeColor = COLORS.HAZE;
+
+			resetRoad();
+			resetSprites();
+			resetCars();
+		}
+
+
+		/**
+		 * Ticks the racetrack non-render logic.
+		 */
+		public function tick():void
+		{
+			var i:int,
+				car:Car,
+				carW:Number,
+				sprite:SSprite,
+				spriteW:Number,
+				playerSegment:Segment = findSegment(_position + _playerZ),
+				playerW:Number = _sprites.PLAYER_STRAIGHT.width * _sprites.SCALE,
+				speedPercent:Number = _speed / _maxSpeed,
+				dx:Number = _dt * 2 * speedPercent,
+				startPosition:Number = _position;
+
+			updateCars(_dt, playerSegment, playerW);
+			_position = increase(_position, _dt * _speed, _trackLength);
+
+			/* Update left/right steering. */
+			if (_isSteerLeft) _playerX = _playerX - dx;
+			else if (_isSteerRight) _playerX = _playerX + dx;
+
+			_playerX = _playerX - (dx * speedPercent * playerSegment.curve * _centrifugal);
+
+			/* Update acceleration & decceleration. */
+			if (_isAccelerate) _speed = accelerate(_speed, _accel, _dt);
+			else if (_isBrake) _speed = accelerate(_speed, _breaking, _dt);
+			else _speed = accelerate(_speed, _decel, _dt);
+
+			/* Check if player drives onto off-road area. */
+			if ((_playerX < -1) || (_playerX > 1))
+			{
+				if (_speed > _offRoadLimit)
+				{
+					_speed = accelerate(_speed, _offRoadDecel, _dt);
+				}
+				/* Check player collision with opponents. */
+				for (i = 0; i < playerSegment.sprites.length; i++)
+				{
+					sprite = playerSegment.sprites[i];
+					spriteW = sprite.source.width * _sprites.SCALE;
+					if (overlap(_playerX, playerW, sprite.offset + spriteW / 2 * (sprite.offset > 0 ? 1 : -1), spriteW))
+					{
+						_speed = _maxSpeed / 5;
+						/* Stop in front of sprite (at front of segment). */
+						_position = increase(playerSegment.p1.world.z, -_playerZ, _trackLength);
+						break;
+					}
+				}
+			}
+
+			for (i = 0; i < playerSegment.cars.length; i++)
+			{
+				car = playerSegment.cars[i];
+				carW = car.sprite.source.width * _sprites.SCALE;
+				if (_speed > car.speed)
+				{
+					if (overlap(_playerX, playerW, car.offset, carW, 0.8))
+					{
+						_speed = car.speed * (car.speed / _speed);
+						_position = increase(car.z, -_playerZ, _trackLength);
+						break;
+					}
+				}
+			}
+
+			_playerX = limit(_playerX, -3, 3);		// Don't ever let it go too far out of bounds
+			_speed = limit(_speed, 0, _maxSpeed);	// or exceed maxSpeed.
+
+			/* Calculate scroll offsets for BG layers. */
+			_skyOffset = increase(_skyOffset, _bgSpeedMult * playerSegment.curve * (_position - startPosition) / _segmentLength, 1);
+			_hillOffset = increase(_hillOffset, _bgSpeedMult * playerSegment.curve * (_position - startPosition) / _segmentLength, 1);
+			_treeOffset = increase(_treeOffset, _bgSpeedMult * playerSegment.curve * (_position - startPosition) / _segmentLength, 1);
+
+			/* Update track time stats. */
+			if (_position > _playerZ)
+			{
+				if (_currentLapTime && (startPosition < _playerZ))
+				{
+					_lastLapTime = _currentLapTime;
+					_currentLapTime = 0;
+					if (_lastLapTime <= _fast_lap_time)
+					{
+					}
+					else
+					{
+					}
+				}
+				else
+				{
+					_currentLapTime += _dt;
+				}
+			}
+		}
+
+
+		/**
+		 * Renders the racetrack.
+		 */
+		public function render():void
+		{
+			var baseSegment:Segment = findSegment(_position),
+				basePercent:Number = percentRemaining(_position, _segmentLength),
+				playerSegment:Segment = findSegment(_position + _playerZ),
+				playerPercent:Number = percentRemaining(_position + _playerZ, _segmentLength),
+				playerY:int = interpolate(playerSegment.p1.world.y, playerSegment.p2.world.y, playerPercent),
+				s:Segment,
+				car:Car,
+				sprite:SSprite,
+				maxY:int = _bufferHeight,
+				x:Number = 0,
+				dx:Number = -(baseSegment.curve * basePercent),
+				i:int,
+				j:int,
+				spriteScale:Number,
+				spriteX:Number,
+				spriteY:Number;
+
+			_renderBuffer.clear();
+
+			/* Render background layers. */
+			_bgLayer1.offsetFactorX = _skyOffset;
+			_bgLayer1.offsetFactorY = _resolution * _bgSpeedMult * playerY;
+			_bgLayer2.offsetFactorX = _hillOffset;
+			_bgLayer3.offsetFactorX = _treeOffset;
+
+			_bgScroller.update();
+			_renderBuffer.blitImage(_bgScroller, 0, 0, _bgScroller.width, _bgScroller.height);
+
+			/* PHASE 1: render segments, front to back and clip far segments that have been
+			 * obscured by already rendered near segments if their projected coordinates are
+			 * lower than maxY. */
+			for (i = 0; i < _drawDistance; i++)
+			{
+				s = _segments[(baseSegment.index + i) % _segments.length];
+				s.looped = s.index < baseSegment.index;
+				/* Apply exponential haze alpha value. */
+				s.haze = 1 / (Math.pow(2.718281828459045, ((i / _drawDistance) * (i / _drawDistance) * _hazeDensity)));
+				s.clip = maxY;
+
+				project(s.p1, (_playerX * _roadWidth) - x, playerY + _cameraHeight, _position - (s.looped ? _trackLength : 0));
+				project(s.p2, (_playerX * _roadWidth) - x - dx, playerY + _cameraHeight, _position - (s.looped ? _trackLength : 0));
+
+				x = x + dx;
+				dx = dx + s.curve;
+
+				if ((s.p1.camera.z <= _cameraDepth)		// behind us
+				|| (s.p2.screen.y >= s.p1.screen.y)		// back face cull
+				|| (s.p2.screen.y >= maxY))				// clip by (already rendered) hill
+				{
+					continue;
+				}
+
+				renderSegment(s.p1.screen.x, s.p1.screen.y, s.p1.screen.w, s.p2.screen.x, s.p2.screen.y, s.p2.screen.w, s.color, s.haze);
+				maxY = s.p1.screen.y;
+			}
+
+			/* PHASE 2: Back to front render the sprites. */
+			for (i = (_drawDistance - 1); i > 0; i--)
+			{
+				s = _segments[(baseSegment.index + i) % _segments.length];
+
+				/* Render opponent cars. */
+				for (j = 0; j < s.cars.length; j++)
+				{
+					car = s.cars[j];
+					sprite = car.sprite;
+					spriteScale = interpolate(s.p1.screen.scale, s.p2.screen.scale, car.percent);
+					spriteX = interpolate(s.p1.screen.x, s.p2.screen.x, car.percent) + (spriteScale * car.offset * _roadWidth * _bufferWidthHalf);
+					spriteY = interpolate(s.p1.screen.y, s.p2.screen.y, car.percent);
+					renderSprite(car.sprite.source, spriteScale, spriteX, spriteY, -0.5, -1, s.clip, s.haze);
+				}
+
+				/* Render roadside objects. */
+				for (j = 0; j < s.sprites.length; j++)
+				{
+					sprite = s.sprites[j];
+					spriteScale = s.p1.screen.scale;
+					spriteX = s.p1.screen.x + (spriteScale * sprite.offset * _roadWidth * _bufferWidthHalf);
+					spriteY = s.p1.screen.y;
+					renderSprite(sprite.source, spriteScale, spriteX, spriteY, (sprite.offset < 0 ? -1 : 0), -1, s.clip, s.haze);
+				}
+
+				/* Render the player sprite. */
+				if (s == playerSegment)
+				{
+					/* Calculate player sprite bouncing depending on speed percentage. */
+					var bounce:Number = (1.5 * Math.random() * (_speed / _maxSpeed) * _resolution) * randomChoice([-1, 1]);
+					var steering:int = _speed * (_isSteerLeft ? -1 : _isSteerRight ? 1 : 0);
+					var updown:Number = playerSegment.p2.world.y - playerSegment.p1.world.y;
+					var spr:BitmapData;
+
+					if (steering < 0)
+					{
+						spr = (updown > 0) ? _sprites.PLAYER_UPHILL_LEFT : _sprites.PLAYER_LEFT;
+					}
+					else if (steering > 0)
+					{
+						spr = (updown > 0) ? _sprites.PLAYER_UPHILL_RIGHT : _sprites.PLAYER_RIGHT;
+					}
+					else
+					{
+						spr = (updown > 0) ? _sprites.PLAYER_UPHILL_STRAIGHT : _sprites.PLAYER_STRAIGHT;
+					}
+
+					renderSprite(spr, _cameraDepth / _playerZ, _bufferWidthHalf, (_bufferHeightHalf - (_cameraDepth / _playerZ * interpolate(playerSegment.p1.camera.y, playerSegment.p2.camera.y, playerPercent) * _bufferHeightHalf)) + bounce, -0.5, -1);
+				}
+			}
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		public function dispose():void
+		{
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// Accessors
+		// -----------------------------------------------------------------------------------------
+
+
+		/**
+		 * @private
+		 */
+		private function get lastY():Number
+		{
+			return (_segments.length == 0) ? 0 : _segments[_segments.length - 1].p2.world.y;
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// Callback Handlers
+		// -----------------------------------------------------------------------------------------
+
+		/**
+		 * @private
+		 */
+		private function onKeyDown(key:String):void
+		{
+			switch (key)
+			{
+				case "u":
+					_isAccelerate = true;
+					break;
+				case "d":
+					_isBrake = true;
+					break;
+				case "l":
+					_isSteerLeft = true;
+					break;
+				case "r":
+					_isSteerRight = true;
+					break;
+			}
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function onKeyUp(key:String):void
+		{
+			switch (key)
+			{
+				case "u":
+					_isAccelerate = false;
+					break;
+				case "d":
+					_isBrake = false;
+					break;
+				case "l":
+					_isSteerLeft = false;
+					break;
+				case "r":
+					_isSteerRight = false;
+					break;
+			}
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// Private Methods
+		// -----------------------------------------------------------------------------------------
+		/**
+		 * @inheritDoc
+		 */
+		override protected function setup():void
+		{
+			super.setup();
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function registerResources():void
+		{
+			registerResource("spriteAtlas");
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function createChildren():void
+		{
+			main.keyInputManager.assign("CURSORUP", KeyMode.DOWN, onKeyDown, "u");
+			main.keyInputManager.assign("CURSORDOWN", KeyMode.DOWN, onKeyDown, "d");
+			main.keyInputManager.assign("CURSORLEFT", KeyMode.DOWN, onKeyDown, "l");
+			main.keyInputManager.assign("CURSORRIGHT", KeyMode.DOWN, onKeyDown, "r");
+			main.keyInputManager.assign("CURSORUP", KeyMode.UP, onKeyUp, "u");
+			main.keyInputManager.assign("CURSORDOWN", KeyMode.UP, onKeyUp, "d");
+			main.keyInputManager.assign("CURSORLEFT", KeyMode.UP, onKeyUp, "l");
+			main.keyInputManager.assign("CURSORRIGHT", KeyMode.UP, onKeyUp, "r");
+
+			resourceManager.process("spriteAtlas");
+			_atlas = getResource("spriteAtlas");
+			_atlasImage = _atlas.image;
+
+			prepareSprites();
+
+			_renderBuffer = new RenderBuffer(_bufferWidth, _bufferHeight, false, 0x000055);
+			_bufferBitmap = new Bitmap(_renderBuffer);
+
+			_bgLayer1 = new ParallaxLayer(_sprites.BG_SKY, 2);
+			_bgLayer2 = new ParallaxLayer(_sprites.BG_HILLS, 3);
+			_bgLayer3 = new ParallaxLayer(_sprites.BG_TREES, 4);
+
+			// TODO add feature to apply fog to bg layer for better realism!
+
+			_bgScroller = new ParallaxScroller(_bufferWidth, _sprites.BG_SKY.height);
+			_bgScroller.layers = [_bgLayer1, _bgLayer2, _bgLayer3];
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function registerChildren():void
+		{
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function addChildren():void
+		{
+			addChild(_bufferBitmap);
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function addListeners():void
+		{
+			main.gameLoop.tickSignal.add(onTick);
+			main.gameLoop.renderSignal.add(onRender);
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function removeListeners():void
+		{
+			main.gameLoop.tickSignal.remove(onTick);
+			main.gameLoop.renderSignal.remove(onRender);
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function executeBeforeStart():void
+		{
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function updateDisplayText():void
+		{
+		}
+
+
+		/**
+		 * @inheritDoc
+		 */
+		override protected function layoutChildren():void
+		{
+			centerChild(_bufferBitmap);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function prepareSprites():void
+		{
+			_sprites = new Sprites();
+			_sprites.BG_SKY = _atlas.getSprite("bg_sky", 2.0);
+			_sprites.BG_HILLS = _atlas.getSprite("bg_hills", 2.0);
+			_sprites.BG_TREES = _atlas.getSprite("bg_trees", 2.0);
+			_sprites.BILLBOARD01 = _atlas.getSprite("billboard01", 2.5);
+			_sprites.BILLBOARD02 = _atlas.getSprite("billboard02", 2.5);
+			_sprites.BILLBOARD03 = _atlas.getSprite("billboard03", 2.5);
+			_sprites.BILLBOARD04 = _atlas.getSprite("billboard04", 2.5);
+			_sprites.BILLBOARD05 = _atlas.getSprite("billboard05", 2.5);
+			_sprites.BILLBOARD06 = _atlas.getSprite("billboard06", 2.5);
+			_sprites.BILLBOARD07 = _atlas.getSprite("billboard07", 2.5);
+			_sprites.BILLBOARD08 = _atlas.getSprite("billboard08", 2.5);
+			_sprites.BILLBOARD09 = _atlas.getSprite("billboard09", 2.5);
+			_sprites.BOULDER1 = _atlas.getSprite("veg_boulder1", 2.5);
+			_sprites.BOULDER2 = _atlas.getSprite("veg_boulder2", 2.5);
+			_sprites.BOULDER3 = _atlas.getSprite("veg_boulder3", 2.5);
+			_sprites.BUSH1 = _atlas.getSprite("veg_bush1", 2.5);
+			_sprites.BUSH2 = _atlas.getSprite("veg_bush2", 2.5);
+			_sprites.CACTUS = _atlas.getSprite("veg_cactus", 2.5);
+			_sprites.TREE1 = _atlas.getSprite("veg_tree1", 2.5);
+			_sprites.TREE2 = _atlas.getSprite("veg_tree2", 2.5);
+			_sprites.PALM_TREE = _atlas.getSprite("veg_palmtree", 2.5);
+			_sprites.DEAD_TREE1 = _atlas.getSprite("veg_deadtree1", 2.5);
+			_sprites.DEAD_TREE2 = _atlas.getSprite("veg_deadtree2", 2.5);
+			_sprites.STUMP = _atlas.getSprite("veg_stump", 2.5);
+			_sprites.COLUMN = _atlas.getSprite("bldg_column", 3.0);
+			_sprites.TOWER = _atlas.getSprite("bldg_tower", 10.0);
+			_sprites.BOATHOUSE = _atlas.getSprite("bldg_boathouse", 3.0);
+			_sprites.WINDMILL = _atlas.getSprite("bldg_windmill", 4.0);
+			_sprites.CAR01 = _atlas.getSprite("car01", 1.25);
+			_sprites.CAR02 = _atlas.getSprite("car02", 1.25);
+			_sprites.CAR03 = _atlas.getSprite("car03", 1.25);
+			_sprites.CAR04 = _atlas.getSprite("car04", 1.25);
+			_sprites.TRUCK = _atlas.getSprite("car05", 1.7);
+			_sprites.SEMI = _atlas.getSprite("car06", 2.0);
+			_sprites.PLAYER_STRAIGHT = _atlas.getSprite("player");
+			_sprites.PLAYER_LEFT = _atlas.getSprite("player_left");
+			_sprites.PLAYER_RIGHT = _atlas.getSprite("player_right");
+			_sprites.PLAYER_UPHILL_STRAIGHT = _atlas.getSprite("player_uphill");
+			_sprites.PLAYER_UPHILL_LEFT = _atlas.getSprite("player_uphill_left");
+			_sprites.PLAYER_UPHILL_RIGHT = _atlas.getSprite("player_uphill_right");
+
+			_sprites.REGION_SKY = _atlas.getRegion("bg_sky");
+			_sprites.REGION_HILLS = _atlas.getRegion("bg_hills");
+			_sprites.REGION_TREES = _atlas.getRegion("bg_trees");
+
+			_sprites.init();
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// ROAD GEOMETRY CONSTRUCTION
+		// -----------------------------------------------------------------------------------------
+		/**
+		 * @private
+		 */
+		private function resetRoad():void
+		{
+			_segments = new Vector.<Segment>();
+
+			addStraight(ROAD.LENGTH.SHORT / 2);
+			addHill(ROAD.LENGTH.SHORT, ROAD.HILL.LOW);
+			addLowRollingHills();
+			addSCurves();
+			addCurve(ROAD.LENGTH.MEDIUM, ROAD.CURVE.MEDIUM, ROAD.HILL.LOW);
+			addBumps();
+			addLowRollingHills();
+			addCurve(ROAD.LENGTH.LONG, ROAD.CURVE.MEDIUM, ROAD.HILL.MEDIUM);
+			addStraight();
+			addCurve(ROAD.LENGTH.LONG, -ROAD.CURVE.MEDIUM, ROAD.HILL.MEDIUM);
+			addHill(ROAD.LENGTH.LONG, ROAD.HILL.HIGH);
+			addCurve(ROAD.LENGTH.LONG, ROAD.CURVE.MEDIUM, -ROAD.HILL.LOW);
+			addHill(ROAD.LENGTH.LONG, -ROAD.HILL.MEDIUM);
+			addStraight();
+			addDownhillToEnd();
+
+			_segments[findSegment(_playerZ).index + 2].color = COLORS.START;
+			_segments[findSegment(_playerZ).index + 3].color = COLORS.START;
+
+			for (var n:uint = 0 ; n < _rumbleLength ; n++)
+			{
+				_segments[_segments.length - 1 - n].color = COLORS.FINISH;
+			}
+
+			_trackLength = _segments.length * _segmentLength;
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function resetSprites():void
+		{
+			var i:int;
+			var j:int;
+			var side:Number;
+			var sprite:BitmapData;
+			var offset:Number;
+			var density:int = 10;
+
+			/* Add row of billboards right after start line. */
+			addSprite(20, _sprites.BILLBOARD07, -1);
+			addSprite(40, _sprites.BILLBOARD06, -1);
+			addSprite(60, _sprites.BILLBOARD08, -1);
+			addSprite(80, _sprites.BILLBOARD09, -1);
+			addSprite(100, _sprites.BILLBOARD01, -1);
+			addSprite(120, _sprites.BILLBOARD02, -1);
+			addSprite(140, _sprites.BILLBOARD03, -1);
+			addSprite(160, _sprites.BILLBOARD04, -1);
+			addSprite(180, _sprites.BILLBOARD05, -1);
+			addSprite(240, _sprites.BILLBOARD07, -1.2);
+			addSprite(240, _sprites.BILLBOARD06, 1.2);
+
+			/* Add some billboards at end of track. */
+			addSprite(_segments.length - 25, _sprites.BILLBOARD07, -1.2);
+			addSprite(_segments.length - 25, _sprites.BILLBOARD06, 1.2);
+
+			/* Add palm trees at start of track. */
+			addSprites(_sprites.PALM_TREE, 10, 200, null, 4, 100, 0.5, 0.5);
+			addSprites(_sprites.PALM_TREE, 10, 200, null, 4, 100, 1, 2);
+
+			/* Add a long row of columns on right side and trees on left side. */
+			addSprites(_sprites.COLUMN, 250, 1000, null, 5, 0, 1.1);
+			addSprites(_sprites.TREE1, 250, 1000, [0, 5], 8, 0, -1, 2, "sub");
+			addSprites(_sprites.TREE2, 250, 1000, [0, 5], 8, 0, -1, 2, "sub");
+
+			// TODO
+			for (i = 200; i < _segments.length; i += 3)
+			{
+				addSprite(i, randomChoice(_sprites.VEGETATION), randomChoice([1, -1]) * (2 + Math.random() * 5));
+			}
+
+			for (i = 1600; i < _segments.length; i += 20)
+			{
+				addSprite(i, randomChoice(_sprites.BUILDINGS), randomChoice([1, -1]) * (2 + Math.random() * 5));
+			}
+
+			for (i = 1000; i < (_segments.length - 50); i += 100)
+			{
+				side = randomChoice([1, -1]);
+				addSprite(i + randomInt(0, 50), randomChoice(_sprites.BILLBOARDS), -side);
+				for (j = 0 ; j < 20 ; j++)
+				{
+					sprite = randomChoice(_sprites.VEGETATION);
+					offset = side * (1.5 + Math.random());
+					addSprite(i + randomInt(0, 50), sprite, offset);
+				}
+			}
+		}
+
+
+		/**
+		 * @param sprite The sprite to add.
+		 * @param start The start segment number.
+		 * @param end The end segment number.
+		 *
+		 * @private
+		 */
+		private function addSprites(sprite:BitmapData, start:int, end:int, segmentRandRange:Array, stepSize:int, stepInc:int, offset:Number, postOffset:Number = 0.0, offsetMode:String = "add"):void
+		{
+			for (var i:int = start; i < end; i += stepSize + int(i / stepInc))
+			{
+				if (postOffset == 0.0)
+				{
+					if (segmentRandRange) addSprite(i + randomInt(segmentRandRange[0], segmentRandRange[1]), sprite, offset);
+					else addSprite(i, sprite, offset);
+				}
+				else
+				{
+					var offs:Number = offset;
+					if (offsetMode == "add") offs = offset + Math.random() * postOffset;
+					else if (offsetMode == "sub") offs = offset - Math.random() * postOffset;
+					if (segmentRandRange) addSprite(i + randomInt(segmentRandRange[0], segmentRandRange[1]), sprite, offs);
+					else addSprite(i, sprite, offset + Math.random() * postOffset);
+				}
+			}
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addSprite(segNum:int, sprite:BitmapData, offset:Number):void
+		{
+			var s:SSprite = new SSprite(sprite, offset);
+			_segments[segNum].sprites.push(s);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function resetCars():void
+		{
+			var i:int,
+			offset:Number,
+			z:Number,
+			speed:Number,
+			car:Car,
+			segment:Segment,
+			sprite:BitmapData;
+
+			for (i = 0; i < _totalCars; i++)
+			{
+				offset = Math.random() * randomChoice([-0.8, 0.8]);
+				z = int(Math.random() * _segments.length) * _segmentLength;
+				sprite = randomChoice(_sprites.CARS);
+				speed = _maxSpeed / 4 + Math.random() * _maxSpeed / (sprite == _sprites.SEMI ? 4 : 2);
+				car = new Car(offset, z, new SSprite(sprite), speed);
+				segment = findSegment(car.z);
+				segment.cars.push(car);
+				_cars.push(car);
+			}
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addStraight(num:int = ROAD.LENGTH.MEDIUM):void
+		{
+			addRoad(num, num, num, 0, 0);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addCurve(num:int = ROAD.LENGTH.MEDIUM, curve:int = ROAD.CURVE.MEDIUM, height:int = ROAD.HILL.NONE):void
+		{
+			addRoad(num, num, num, curve, height);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addSCurves():void
+		{
+			addRoad(ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, -ROAD.CURVE.EASY);
+			addRoad(ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.CURVE.MEDIUM);
+			addRoad(ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.CURVE.EASY);
+			addRoad(ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, -ROAD.CURVE.EASY);
+			addRoad(ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, ROAD.LENGTH.MEDIUM, -ROAD.CURVE.MEDIUM);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addHill(num:int = ROAD.LENGTH.MEDIUM, height:int = ROAD.HILL.MEDIUM):void
+		{
+			addRoad(num, num, num, 0, height);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addLowRollingHills(num:int = ROAD.LENGTH.SHORT, height:int = ROAD.HILL.LOW):void
+		{
+			addRoad(num, num, num, 0, height / 2);
+			addRoad(num, num, num, 0, -height);
+			addRoad(num, num, num, ROAD.CURVE.EASY, height);
+			addRoad(num, num, num, 0, 0);
+			addRoad(num, num, num, -ROAD.CURVE.EASY, height / 2);
+			addRoad(num, num, num, 0, 0);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addBumps():void
+		{
+			addRoad(10, 10, 10, 0, 5);
+			addRoad(10, 10, 10, 0, -2);
+			addRoad(10, 10, 10, 0, -5);
+			addRoad(10, 10, 10, 0, 8);
+			addRoad(10, 10, 10, 0, 5);
+			addRoad(10, 10, 10, 0, -7);
+			addRoad(10, 10, 10, 0, 5);
+			addRoad(10, 10, 10, 0, -2);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addDownhillToEnd(num:int = 200):void
+		{
+			addRoad(num, num, num, -ROAD.CURVE.EASY, -lastY / _segmentLength);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addRoad(enter:int, hold:int, leave:int, curve:Number, y:Number = NaN):void
+		{
+			var startY:Number = lastY;
+			var endY:Number = startY + (int(y) * _segmentLength);
+			var total:uint = enter + hold + leave;
+			var i:uint;
+
+			for (i = 0; i < enter; i++)
+			{
+				addSegment(easeIn(0, curve, i / enter), easeInOut(startY, endY, i / total));
+			}
+			for (i = 0; i < hold; i++)
+			{
+				addSegment(curve, easeInOut(startY, endY, (enter + i) / total));
+			}
+			for (i = 0; i < leave; i++)
+			{
+				addSegment(easeInOut(curve, 0, i / leave), easeInOut(startY, endY, (enter + hold + i) / total));
+			}
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function addSegment(curve:Number, y:Number):void
+		{
+			var i:uint = _segments.length;
+			var segment:Segment = new Segment();
+			segment.index = i;
+			segment.p1 = new PPoint(new PWorld(lastY, i * _segmentLength), new PCamera(), new PScreen());
+			segment.p2 = new PPoint(new PWorld(y, (i + 1) * _segmentLength), new PCamera(), new PScreen());
+			segment.curve = curve;
+			segment.sprites = new Vector.<SSprite>();
+			segment.cars = new Vector.<Car>();
+			segment.color = int(i / _rumbleLength) % 2 ? COLORS.DARK : COLORS.LIGHT;
+			_segments.push(segment);
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function findSegment(z:Number):Segment
+		{
+			return _segments[int(z / _segmentLength) % _segments.length];
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function updateCars(dt:Number, playerSegment:Segment, playerW:Number):void
+		{
+			var n:int;
+			var car:Car;
+			var oldSegment:Segment;
+			var newSegment:Segment;
+
+			for (n = 0; n < _cars.length; n++)
+			{
+				car = _cars[n];
+				oldSegment = findSegment(car.z);
+				car.offset = car.offset + updateCarOffset(car, oldSegment, playerSegment, playerW);
+				car.z = increase(car.z, dt * car.speed, _trackLength);
+				car.percent = percentRemaining(car.z, _segmentLength);
+				// useful for interpolation during rendering phase
+				newSegment = findSegment(car.z);
+
+				if (oldSegment != newSegment)
+				{
+					var index:int = oldSegment.cars.indexOf(car);
+					oldSegment.cars.splice(index, 1);
+					newSegment.cars.push(car);
+				}
+			}
+		}
+
+
+		/**
+		 * @private
+		 */
+		private function updateCarOffset(car:Car, carSegment:Segment, playerSegment:Segment, playerW:Number):Number
+		{
+			var i:int;
+			var j:int;
+			var dir:Number;
+			var segment:Segment;
+			var otherCar:Car;
+			var otherCarW:Number;
+			var lookahead:int = 20;
+			var carW:Number = car.sprite.source.width * _sprites.SCALE;
+
+			/* Optimization: dont bother steering around other cars when 'out of sight'
+			 * of the player. */
+			if ((carSegment.index - playerSegment.index) > _drawDistance) return 0;
+
+			for (i = 1; i < lookahead; i++)
+			{
+				segment = _segments[(carSegment.index + i) % _segments.length];
+
+				/* Car drive-around player AI */
+				if ((segment === playerSegment) && (car.speed > _speed) && (overlap(_playerX, playerW, car.offset, carW, 1.2)))
+				{
+					if (_playerX > 0.5) dir = -1;
+					else if (_playerX < -0.5) dir = 1;
+					else dir = (car.offset > _playerX) ? 1 : -1;
+					// The closer the cars (smaller i) and the greater the speed ratio,
+					// the larger the offset.
+					return dir * 1 / i * (car.speed - _speed) / _maxSpeed;
+				}
+
+				/* Car drive-around other car AI */
+				for (j = 0; j < segment.cars.length; j++)
+				{
+					otherCar = segment.cars[j];
+					otherCarW = otherCar.sprite.source.width * _sprites.SCALE;
+					if ((car.speed > otherCar.speed) && overlap(car.offset, carW, otherCar.offset, otherCarW, 1.2))
+					{
+						if (otherCar.offset > 0.5) dir = -1;
+						else if (otherCar.offset < -0.5) dir = 1;
+						else dir = (car.offset > otherCar.offset) ? 1 : -1;
+						return dir * 1 / i * (car.speed - otherCar.speed) / _maxSpeed;
+					}
+				}
+			}
+
+			// if no cars ahead, but car has somehow ended up off road, then steer back on.
+			if (car.offset < -0.9) return 0.1;
+			else if (car.offset > 0.9) return -0.1;
+			else return 0;
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// Util Functions
+		// -----------------------------------------------------------------------------------------
+
+		private function increase(start:Number, increment:Number, max:Number):Number
+		{
+			var result:Number = start + increment;
+			while (result >= max) result -= max;
+			while (result < 0) result += max;
+			return result;
+		}
+
+
+		private function accelerate(v:Number, accel:Number, dt:Number):Number
+		{
+			return v + (accel * dt);
+		}
+
+
+		private function limit(value:Number, min:Number, max:Number):Number
+		{
+			return mathMax(min, mathMin(value, max));
+		}
+
+
+		private function project(p:PPoint, cameraX:Number, cameraY:Number, cameraZ:Number):void
+		{
+			p.camera.x = (p.world.x || 0) - cameraX;
+			p.camera.y = (p.world.y || 0) - cameraY;
+			p.camera.z = (p.world.z || 0) - cameraZ;
+			p.screen.scale = _cameraDepth / p.camera.z;
+			p.screen.x = mathRound(_bufferWidthHalf + (p.screen.scale * p.camera.x * _bufferWidthHalf));
+			p.screen.y = mathRound(_bufferHeightHalf - (p.screen.scale * p.camera.y * _bufferHeightHalf));
+			p.screen.w = mathRound((p.screen.scale * _roadWidth * _bufferWidthHalf));
+		}
+
+
+		private function getRumbleWidth(projectedRoadWidth:Number):Number
+		{
+			return projectedRoadWidth / mathMax(6, 2 * _lanes);
+		}
+
+
+		private function getLaneMarkerWidth(projectedRoadWidth:Number):Number
+		{
+			return projectedRoadWidth / mathMax(32, 8 * _lanes);
+		}
+
+
+		private function interpolate(a:Number, b:Number, percent:Number):Number
+		{
+			return a + (b - a) * percent;
+		}
+
+
+		private function randomInt(min:int, max:int):int
+		{
+			return mathRound(interpolate(min, max, Math.random()));
+		}
+
+
+		private function randomChoice(a:Array):*
+		{
+			return a[randomInt(0, a.length - 1)];
+		}
+
+
+		private function easeIn(a:Number, b:Number, percent:Number):Number
+		{
+			return a + (b - a) * Math.pow(percent, 2);
+		}
+
+
+		// private static function easeOut(a:Number, b:Number, percent:Number):Number
+		// {
+		// return a + (b - a) * (1 - Math.pow(1 - percent, 2));
+		// }
+		private function easeInOut(a:Number, b:Number, percent:Number):Number
+		{
+			return a + (b - a) * ((-Math.cos(percent * 3.141592653589793) / 2) + 0.5);
+		}
+
+
+		private function percentRemaining(n:Number, total:Number):Number
+		{
+			return (n % total) / total;
+		}
+
+
+		private function overlap(x1:Number, w1:Number, x2:Number, w2:Number, percent:Number = 1.0):Boolean
+		{
+			var half:Number = percent * 0.5;
+			/* return !((max1 < min2) || (min1 > max2)) */
+			return !(((x1 + (w1 * half)) < (x2 - (w2 * half))) || ((x1 - (w1 * half)) > (x2 + (w2 * half))));
+		}
+
+
+		private function mathMax(a:Number, b:Number):Number
+		{
+			return (a > b) ? a : b;
+		}
+
+
+		private function mathMin(a:Number, b:Number):Number
+		{
+			return (a < b) ? a : b;
+		}
+
+
+		private function mathRound(n:Number):int
+		{
+			return n + (n < 0 ? -0.5 : +0.5) >> 0;
+		}
+
+
+		// -----------------------------------------------------------------------------------------
+		// Render Functions
+		// -----------------------------------------------------------------------------------------
+		/**
+		 * Renders a segment.
+		 *
+		 * @param x1
+		 * @param y1
+		 * @param w1
+		 * @param x2
+		 * @param y2
+		 * @param w2
+		 * @param color
+		 * @param hazeAlpha
+		 */
+		private function renderSegment(x1:int, y1:int, w1:int, x2:int, y2:int, w2:int, color:ColorSet, hazeAlpha:Number):void
+		{
+			/* Calculate rumble widths for current segment. */
+			var r1:Number = getRumbleWidth(w1), r2:Number = getRumbleWidth(w2);
+
+			/* Draw offroad area segment. */
+			_renderBuffer.blitRect(0, y2, _bufferWidth, y1 - y2, color.grass, _hazeColor, hazeAlpha);
+
+			/* Draw the road segment. */
+			_renderBuffer.drawQuad(x1 - w1 - r1, y1, x1 - w1, y1, x2 - w2, y2, x2 - w2 - r2, y2, color.rumble, _hazeColor, hazeAlpha);
+			_renderBuffer.drawQuad(x1 + w1 + r1, y1, x1 + w1, y1, x2 + w2, y2, x2 + w2 + r2, y2, color.rumble, _hazeColor, hazeAlpha);
+			_renderBuffer.drawQuad(x1 - w1, y1, x1 + w1, y1, x2 + w2, y2, x2 - w2, y2, color.road, _hazeColor, hazeAlpha);
+
+			/* Draw lane strips. */
+			if (color.lane > 0)
+			{
+				var l1:Number = getLaneMarkerWidth(w1),
+				l2:Number = getLaneMarkerWidth(w2),
+				lw1:Number = w1 * 2 / _lanes,
+				lw2:Number = w2 * 2 / _lanes,
+				lx1:Number = x1 - w1 + lw1,
+				lx2:Number = x2 - w2 + lw2;
+
+				for (var lane:int = 1 ;lane < _lanes; lx1 += lw1, lx2 += lw2, lane++)
+				{
+					_renderBuffer.drawQuad(lx1 - l1 / 2, y1, lx1 + l1 / 2, y1, lx2 + l2 / 2, y2, lx2 - l2 / 2, y2, color.lane, _hazeColor, hazeAlpha);
+				}
+			}
+		}
+
+
+		/**
+		 * Renders a sprite onto the render buffer.
+		 *
+		 * @param sprite
+		 * @param scale
+		 * @param destX
+		 * @param destY
+		 * @param offsetX
+		 * @param offsetY
+		 * @param clipY
+		 * @param hazeAlpha
+		 */
+		private function renderSprite(sprite:BitmapData, scale:Number, destX:int, destY:int, offsetX:Number = 0.0, offsetY:Number = 0.0, clipY:Number = 0.0, hazeAlpha:Number = 1.0):void
+		{
+			/* Scale for projection AND relative to roadWidth. */
+			var destW:int = (sprite.width * scale * _bufferWidthHalf) * (_sprites.SCALE * _roadWidth);
+			var destH:int = (sprite.height * scale * _bufferWidthHalf) * (_sprites.SCALE * _roadWidth);
+
+			destX = destX + (destW * offsetX);
+			destY = destY + (destH * offsetY);
+
+			var clipH:int = clipY ? mathMax(0, destY + destH - clipY) : 0;
+
+			if (clipH < destH)
+			{
+				_renderBuffer.drawImage(sprite, destX, destY, destW, destH - clipH, destW / sprite.width, _hazeColor, hazeAlpha);
+			}
+		}
+	}
+}