<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/08/making-auto-repeat-button-controls-using-the-autorepeat-property-and-buttondown-event/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" viewSourceURL="srcview/index.html">
	
	<mx:Script>
		<![CDATA[
			import mx.core.UIComponent;

			private function moveLeft(target:UIComponent):void {
				target.x = Math.max(target.x - 10, 0);
			}
			
			private function moveRight(target:UIComponent):void {
				target.x = Math.min(target.x + 10, Application.application.width - target.width);
			}
		]]>
	</mx:Script>
	
	<mx:Box id="box" width="100" height="100" backgroundColor="red" />
	
	<mx:HBox>
		<mx:Button label="left" autoRepeat="true" buttonDown="moveLeft(box)" click="trace('..')" />
		<mx:Button label="right" autoRepeat="true" buttonDown="moveRight(box)" />
	</mx:HBox>
	
</mx:Application>
