attempting to better support preload="auto" in Flash

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -1,388 +1,415 @@
-package htmlelements
-{
-	import flash.display.Sprite;
-	import flash.events.*;
-	import flash.net.NetConnection;
-	import flash.net.NetStream;
-	import flash.media.Video;
-	import flash.media.SoundTransform;
-	import flash.utils.Timer;
-
-	import FlashMediaElement;
-	import HtmlMediaEvent;
-
-	public class VideoElement extends Sprite implements IMediaElement
-	{
-		private var _currentUrl:String = "";
-		private var _autoplay:Boolean = true;
-		private var _preload:String = "";
-
-		private var _connection:NetConnection;
-		private var _stream:NetStream;
-		private var _video:Video;
-		private var _element:FlashMediaElement;
-		private var _soundTransform;
-		private var _oldVolume:Number = 1;
-
-		// event values
-		private var _duration:Number = 0;
-		private var _framerate:Number;
-		private var _isPaused:Boolean = true;
-		private var _isEnded:Boolean = false;
-		private var _volume:Number = 1;
-		private var _isMuted:Boolean = false;
-
-		private var _bytesLoaded:Number = 0;
-		private var _bytesTotal:Number = 0;
-		private var _bufferedTime:Number = 0;
-		private var _bufferEmpty:Boolean = false;
-
-		private var _videoWidth:Number = -1;
-		private var _videoHeight:Number = -1;
-
-		private var _timer:Timer;
-
-		private var _isRTMP:Boolean = false;
-		private var _isConnected:Boolean = false;
-		private var _playWhenConnected:Boolean = false;
-		private var _hasStartedPlaying:Boolean = false;
-
-		public function get video():Video {
-			return _video;
-		}
-
-		public function get videoHeight():Number {
-			return _videoHeight;
-		}
-
-		public function get videoWidth():Number {
-			return _videoWidth;
-		}
-
-
-		public function duration():Number {
-			return _duration;
-		}
-
-		public function currentTime():Number {
-			if (_stream != null) {
-				return _stream.time;
-			} else {
-				return 0;
-			}
-		}
-
-		// (1) load()
-		// calls _connection.connect();
-		// waits for NetConnection.Connect.Success
-		// _stream gets created
-
-
-		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
-		{
-			_element = element;
-			_autoplay = autoplay;
-			_volume = startVolume;
-			_preload = preload;
-
-			_video = new Video();
-			addChild(_video);
-
-			_connection = new NetConnection();
-			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
-			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
-			//_connection.connect(null);
-
-			_timer = new Timer(timerRate);
-			_timer.addEventListener("timer", timerHandler);
-
-		}
-
-		private function timerHandler(e:TimerEvent) {
-
-			_bytesLoaded = _stream.bytesLoaded;
-			_bytesTotal = _stream.bytesTotal;
-
-			if (!_isPaused)
-				sendEvent(HtmlMediaEvent.TIMEUPDATE);
-
-			trace("bytes", _bytesLoaded, _bytesTotal);
-
-			if (_bytesLoaded < _bytesTotal)
-				sendEvent(HtmlMediaEvent.PROGRESS);
-		}
-
-		// internal events
-		private function netStatusHandler(event:NetStatusEvent):void {
-			trace("netStatus", event.info.code);
-
-			switch (event.info.code) {
-
-				case "NetStream.Buffer.Empty":
-					_bufferEmpty = true;
-					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-				case "NetStream.Buffer.Full":
-					_bytesLoaded = _stream.bytesLoaded;
-					_bytesTotal = _stream.bytesTotal;
-					_bufferEmpty = false;
-
-					sendEvent(HtmlMediaEvent.PROGRESS);
-					break;
-
-				case "NetConnection.Connect.Success":
-					connectStream();
-					break;
-				case "NetStream.Play.StreamNotFound":
-					trace("Unable to locate video");
-					break;
-
-				// STREAM
-				case "NetStream.Play.Start":
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.LOADEDDATA);
-					sendEvent(HtmlMediaEvent.CANPLAY);
-					sendEvent(HtmlMediaEvent.PLAY);
-					sendEvent(HtmlMediaEvent.PLAYING);
-					_timer.start();
-					break;
-
-				case "NetStream.Seek.Notify":
-					sendEvent(HtmlMediaEvent.SEEKED);
-					break;
-
-				case "NetStream.Pause.Notify":
-					_isPaused = true;
-					sendEvent(HtmlMediaEvent.PAUSE);
-					break;
-
-				case "NetStream.Play.Stop":
-					_isEnded = true;
-					_isPaused = false;
-					_timer.stop();
-					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
-					break;
-
-			}
-		}
-
-
-		private function securityErrorHandler(event:SecurityErrorEvent):void {
-			trace("securityErrorHandler: " + event);
-		}
-
-		private function asyncErrorHandler(event:AsyncErrorEvent):void {
-			// ignore AsyncErrorEvent events.
-		}
-
-
-		private function onMetaDataHandler(info:Object):void {
-			_duration = info.duration;
-			_framerate = info.framerate;
-			_videoWidth = info.width;
-			_videoHeight = info.height;
-
-			// set size?
-
-			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
-		}
-
-
-
-
-		// interface members
-		public function setSrc(url:String):void {
-			if (_isConnected && _stream) {
-				// stop and restart
-				_stream.pause();
-			}
-
-			_currentUrl = url;
-			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
-			_isConnected = false;
-			_hasStartedPlaying = false;
-		}
-
-		public function load():void {
-			// disconnect existing stream and connection
-			if (_isConnected && _stream) {
-				_stream.pause();
-				_stream.close();
-				_connection.close();
-			}
-			_isConnected = false;
-
-			// start new connection
-			if (_isRTMP) {
-				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
-			} else {
-				_connection.connect(null);
-			}
-
-			// in a few moments the "NetConnection.Connect.Success" event will fire
-			// and call createConnection which finishes the "load" sequence
-			sendEvent(HtmlMediaEvent.LOADSTART);
-		}
-
-
-		private function connectStream():void {
-			trace("connectStream");
-			_stream = new NetStream(_connection);
-
-			// explicitly set the sound since it could have come before the connection was made
-			_soundTransform = new SoundTransform(_volume);
-			_stream.soundTransform = _soundTransform;
-
-			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
-			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
-
-			var customClient:Object = new Object();
-			customClient.onMetaData = onMetaDataHandler;
-			_stream.client = customClient;
-
-			_video.attachNetStream(_stream);
-
-			// start downloading without playing )based on preload and play() hasn't been called)
-			// I wish flash had a load() command to make this less awkward
-			if (_preload != "none" && !_playWhenConnected) {
-				_stream.play(_currentUrl, 0, 0);
-
-				_stream.pause();
-				_isPaused = true;
-				sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
-			}
-
-			_isConnected = true;
-
-			if (_playWhenConnected && !_hasStartedPlaying) {
-				play();
-				_playWhenConnected = false;
-			}
-
-		}
-
-		public function play():void {
-
-			if (!_hasStartedPlaying && !_isConnected) {
-				_playWhenConnected = true;
-				load();
-				return;
-			}
-
-			if (_hasStartedPlaying) {
-				if (_isPaused) {
-					_stream.resume();
-					_timer.start();
-					_isPaused = false;
-					sendEvent(HtmlMediaEvent.PLAY);
-					sendEvent(HtmlMediaEvent.PLAYING);
-				}
-			} else {
-
-				if (_isRTMP) {
-					_stream.play(_currentUrl.split("/").pop());
-				} else {
-					_stream.play(_currentUrl);
-				}
-				_timer.start();
-				_isPaused = false;
-				_hasStartedPlaying = true;
-
-				// don't toss play/playing events here, because we haven't sent a
-				// canplay / loadeddata event yet. that'll be handled in the net
-				// event listener
-			}
-
-		}
-
-		public function pause():void {
-			if (_stream == null)
-				return;
-
-			_stream.pause();
-			_isPaused = true;
-
-			if (_bytesLoaded == _bytesTotal) {
-				_timer.stop();
-			}
-
-			_isPaused = true;
-			sendEvent(HtmlMediaEvent.PAUSE);
-		}
-
-		public function stop():void {
-			if (_stream == null)
-				return;
-
-			_stream.close();
-			_isPaused = false;
-			_timer.stop();
-			sendEvent(HtmlMediaEvent.STOP);
-		}
-
-		public function setCurrentTime(pos:Number):void {
-			if (_stream == null)
-				return;
-
-			sendEvent(HtmlMediaEvent.SEEKING);
-			_stream.seek(pos);
-			sendEvent(HtmlMediaEvent.TIMEUPDATE);
-		}
-
-		public function setVolume(volume:Number):void {
-			if (_stream != null) {
-				_soundTransform = new SoundTransform(volume);
-				_stream.soundTransform = _soundTransform;
-			}
-
-			_volume = volume;
-
-			_isMuted = (_volume == 0);
-
-			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
-		}
-
-
-		public function setMuted(muted:Boolean):void {
-
-			if (_isMuted == muted)
-				return;
-
-			if (muted) {
-				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
-				setVolume(0);
-			} else {
-				setVolume(_oldVolume);
-			}
-
-			_isMuted = muted;
-		}
-
-
-		private function sendEvent(eventName:String) {
-
-			// calculate this to mimic HTML5
-			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
-
-			// build JSON
-			var values:String =
-							"duration:" + _duration +
-							",framerate:" + _framerate +
-							",currentTime:" + (_stream != null ? _stream.time : 0) +
-							",muted:" + _isMuted +
-							",paused:" + _isPaused +
-							",ended:" + _isEnded +
-							",volume:" + _volume +
-							",src:\"" + _currentUrl + "\"" +
-							",bytesTotal:" + _bytesTotal +
-							",bufferedBytes:" + _bytesLoaded +
-							",bufferedTime:" + _bufferedTime +
-							",videoWidth:" + _videoWidth +
-							",videoHeight:" + _videoHeight +
-							"";
-
-			_element.sendEvent(eventName, values);
-		}
-	}
+package htmlelements
+{
+	import flash.display.Sprite;
+	import flash.events.*;
+	import flash.net.NetConnection;
+	import flash.net.NetStream;
+	import flash.media.Video;
+	import flash.media.SoundTransform;
+	import flash.utils.Timer;
+
+	import FlashMediaElement;
+	import HtmlMediaEvent;
+
+	public class VideoElement extends Sprite implements IMediaElement
+	{
+		private var _currentUrl:String = "";
+		private var _autoplay:Boolean = true;
+		private var _preload:String = "";
+		private var _isPreloading:Boolean = false;
+
+		private var _connection:NetConnection;
+		private var _stream:NetStream;
+		private var _video:Video;
+		private var _element:FlashMediaElement;
+		private var _soundTransform;
+		private var _oldVolume:Number = 1;
+
+		// event values
+		private var _duration:Number = 0;
+		private var _framerate:Number;
+		private var _isPaused:Boolean = true;
+		private var _isEnded:Boolean = false;
+		private var _volume:Number = 1;
+		private var _isMuted:Boolean = false;
+
+		private var _bytesLoaded:Number = 0;
+		private var _bytesTotal:Number = 0;
+		private var _bufferedTime:Number = 0;
+		private var _bufferEmpty:Boolean = false;
+
+		private var _videoWidth:Number = -1;
+		private var _videoHeight:Number = -1;
+
+		private var _timer:Timer;
+
+		private var _isRTMP:Boolean = false;
+		private var _isConnected:Boolean = false;
+		private var _playWhenConnected:Boolean = false;
+		private var _hasStartedPlaying:Boolean = false;
+
+		public function get video():Video {
+			return _video;
+		}
+
+		public function get videoHeight():Number {
+			return _videoHeight;
+		}
+
+		public function get videoWidth():Number {
+			return _videoWidth;
+		}
+
+
+		public function duration():Number {
+			return _duration;
+		}
+
+		public function currentTime():Number {
+			if (_stream != null) {
+				return _stream.time;
+			} else {
+				return 0;
+			}
+		}
+
+		// (1) load()
+		// calls _connection.connect();
+		// waits for NetConnection.Connect.Success
+		// _stream gets created
+
+
+		public function VideoElement(element:FlashMediaElement, autoplay:Boolean, preload:String, timerRate:Number, startVolume:Number)
+		{
+			_element = element;
+			_autoplay = autoplay;
+			_volume = startVolume;
+			_preload = preload;
+
+			_video = new Video();
+			addChild(_video);
+
+			_connection = new NetConnection();
+			_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
+			_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+			//_connection.connect(null);
+
+			_timer = new Timer(timerRate);
+			_timer.addEventListener("timer", timerHandler);
+
+		}
+
+		private function timerHandler(e:TimerEvent) {
+
+			_bytesLoaded = _stream.bytesLoaded;
+			_bytesTotal = _stream.bytesTotal;
+
+			if (!_isPaused)
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			trace("bytes", _bytesLoaded, _bytesTotal);
+
+			if (_bytesLoaded < _bytesTotal)
+				sendEvent(HtmlMediaEvent.PROGRESS);
+		}
+
+		// internal events
+		private function netStatusHandler(event:NetStatusEvent):void {
+			trace("netStatus", event.info.code);
+
+			switch (event.info.code) {
+
+				case "NetStream.Buffer.Empty":
+					_bufferEmpty = true;
+					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+				case "NetStream.Buffer.Full":
+					_bytesLoaded = _stream.bytesLoaded;
+					_bytesTotal = _stream.bytesTotal;
+					_bufferEmpty = false;
+
+					sendEvent(HtmlMediaEvent.PROGRESS);
+					break;
+
+				case "NetConnection.Connect.Success":
+					connectStream();
+					break;
+				case "NetStream.Play.StreamNotFound":
+					trace("Unable to locate video");
+					break;
+
+				// STREAM
+				case "NetStream.Play.Start":
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.LOADEDDATA);
+					sendEvent(HtmlMediaEvent.CANPLAY);
+
+					if (!_isPreloading) {
+
+						sendEvent(HtmlMediaEvent.PLAY);
+						sendEvent(HtmlMediaEvent.PLAYING);
+
+					}
+
+					_timer.start();
+
+					break;
+
+				case "NetStream.Seek.Notify":
+					sendEvent(HtmlMediaEvent.SEEKED);
+					break;
+
+				case "NetStream.Pause.Notify":
+					_isPaused = true;
+					sendEvent(HtmlMediaEvent.PAUSE);
+					break;
+
+				case "NetStream.Play.Stop":
+					_isEnded = true;
+					_isPaused = false;
+					_timer.stop();
+					_bufferEmpty ? sendEvent(HtmlMediaEvent.ENDED) : null;
+					break;
+
+			}
+		}
+
+
+		private function securityErrorHandler(event:SecurityErrorEvent):void {
+			trace("securityErrorHandler: " + event);
+		}
+
+		private function asyncErrorHandler(event:AsyncErrorEvent):void {
+			// ignore AsyncErrorEvent events.
+		}
+
+
+		private function onMetaDataHandler(info:Object):void {
+			_duration = info.duration;
+			_framerate = info.framerate;
+			_videoWidth = info.width;
+			_videoHeight = info.height;
+
+			// set size?
+
+			sendEvent(HtmlMediaEvent.LOADEDMETADATA);
+
+
+
+			if (_isPreloading) {
+
+				_stream.pause();
+				_isPaused = true;
+				_isPreloading = false;
+
+				sendEvent(HtmlMediaEvent.PROGRESS);
+				sendEvent(HtmlMediaEvent.TIMEUPDATE);
+
+			}
+		}
+
+
+
+
+		// interface members
+		public function setSrc(url:String):void {
+			if (_isConnected && _stream) {
+				// stop and restart
+				_stream.pause();
+			}
+
+			_currentUrl = url;
+			_isRTMP = !!_currentUrl.match(/^rtmp(s|t|e|te)?\:\/\//);
+			_isConnected = false;
+			_hasStartedPlaying = false;
+		}
+
+		public function load():void {
+			// disconnect existing stream and connection
+			if (_isConnected && _stream) {
+				_stream.pause();
+				_stream.close();
+				_connection.close();
+			}
+			_isConnected = false;
+			_isPreloading = false;
+
+			// start new connection
+			if (_isRTMP) {
+				_connection.connect(_currentUrl.replace(/\/[^\/]+$/,"/"));
+			} else {
+				_connection.connect(null);
+			}
+
+			// in a few moments the "NetConnection.Connect.Success" event will fire
+			// and call createConnection which finishes the "load" sequence
+			sendEvent(HtmlMediaEvent.LOADSTART);
+		}
+
+
+		private function connectStream():void {
+			trace("connectStream");
+			_stream = new NetStream(_connection);
+
+			// explicitly set the sound since it could have come before the connection was made
+			_soundTransform = new SoundTransform(_volume);
+			_stream.soundTransform = _soundTransform;
+
+			_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // same event as connection
+			_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
+
+			var customClient:Object = new Object();
+			customClient.onMetaData = onMetaDataHandler;
+			_stream.client = customClient;
+
+			_video.attachNetStream(_stream);
+
+			// start downloading without playing )based on preload and play() hasn't been called)
+			// I wish flash had a load() command to make this less awkward
+			if (_preload != "none" && !_playWhenConnected) {
+				_isPaused = true;
+				//stream.bufferTime = 20;
+				_stream.play(_currentUrl, 0, 0);
+				_stream.pause();
+
+				_isPreloading = true;
+
+				//_stream.pause();
+				//
+				//sendEvent(HtmlMediaEvent.PAUSE); // have to send this because the "playing" event gets sent via event handlers
+			}
+
+			_isConnected = true;
+
+			if (_playWhenConnected && !_hasStartedPlaying) {
+				play();
+				_playWhenConnected = false;
+			}
+
+		}
+
+		public function play():void {
+
+			if (!_hasStartedPlaying && !_isConnected) {
+				_playWhenConnected = true;
+				load();
+				return;
+			}
+
+			if (_hasStartedPlaying) {
+				if (_isPaused) {
+					_stream.resume();
+					_timer.start();
+					_isPaused = false;
+					sendEvent(HtmlMediaEvent.PLAY);
+					sendEvent(HtmlMediaEvent.PLAYING);
+				}
+			} else {
+
+				if (_isRTMP) {
+					_stream.play(_currentUrl.split("/").pop());
+				} else {
+					_stream.play(_currentUrl);
+				}
+				_timer.start();
+				_isPaused = false;
+				_hasStartedPlaying = true;
+
+				// don't toss play/playing events here, because we haven't sent a
+				// canplay / loadeddata event yet. that'll be handled in the net
+				// event listener
+			}
+
+		}
+
+		public function pause():void {
+			if (_stream == null)
+				return;
+
+			_stream.pause();
+			_isPaused = true;
+
+			if (_bytesLoaded == _bytesTotal) {
+				_timer.stop();
+			}
+
+			_isPaused = true;
+			sendEvent(HtmlMediaEvent.PAUSE);
+		}
+
+		public function stop():void {
+			if (_stream == null)
+				return;
+
+			_stream.close();
+			_isPaused = false;
+			_timer.stop();
+			sendEvent(HtmlMediaEvent.STOP);
+		}
+
+		public function setCurrentTime(pos:Number):void {
+			if (_stream == null)
+				return;
+
+			sendEvent(HtmlMediaEvent.SEEKING);
+			_stream.seek(pos);
+			sendEvent(HtmlMediaEvent.TIMEUPDATE);
+		}
+
+		public function setVolume(volume:Number):void {
+			if (_stream != null) {
+				_soundTransform = new SoundTransform(volume);
+				_stream.soundTransform = _soundTransform;
+			}
+
+			_volume = volume;
+
+			_isMuted = (_volume == 0);
+
+			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
+		}
+
+
+		public function setMuted(muted:Boolean):void {
+
+			if (_isMuted == muted)
+				return;
+
+			if (muted) {
+				_oldVolume = (_stream == null) ? _oldVolume : _stream.soundTransform.volume;
+				setVolume(0);
+			} else {
+				setVolume(_oldVolume);
+			}
+
+			_isMuted = muted;
+		}
+
+
+		private function sendEvent(eventName:String) {
+
+			// calculate this to mimic HTML5
+			_bufferedTime = _bytesLoaded / _bytesTotal * _duration;
+
+			// build JSON
+			var values:String =
+							"duration:" + _duration +
+							",framerate:" + _framerate +
+							",currentTime:" + (_stream != null ? _stream.time : 0) +
+							",muted:" + _isMuted +
+							",paused:" + _isPaused +
+							",ended:" + _isEnded +
+							",volume:" + _volume +
+							",src:\"" + _currentUrl + "\"" +
+							",bytesTotal:" + _bytesTotal +
+							",bufferedBytes:" + _bytesLoaded +
+							",bufferedTime:" + _bufferedTime +
+							",videoWidth:" + _videoWidth +
+							",videoHeight:" + _videoHeight +
+							"";
+
+			_element.sendEvent(eventName, values);
+		}
+	}
 }


- handled some buffering/stop issues in certain Flash scenarios

--- src/flash/htmlelements/VideoElement.as
+++ src/flash/htmlelements/VideoElement.as
@@ -34,6 +34,7 @@
 		private var _bytesLoaded:Number = 0;
 		private var _bytesTotal:Number = 0;
 		private var _bufferedTime:Number = 0;
+		private var _bufferEmpty:Boolean = false;

 		private var _videoWidth:Number = -1;
 		private var _videoHeight:Number = -1;
@@ -114,12 +115,14 @@
 			switch (event.info.code) {

 				case "NetStream.Buffer.Empty":
+					_bufferEmpty = true;
 					_isEnded ? sendEvent(HtmlMediaEvent.ENDED) : null;
 					break;

 				case "NetStream.Buffer.Full":
 					_bytesLoaded = _stream.bytesLoaded;
 					_bytesTotal = _stream.bytesTotal;
+					_bufferEmpty = false;

 					sendEvent(HtmlMediaEvent.PROGRESS);
 					break;


Transferred from the Adobe Open Source Subversion Repository

Revision: 1280
Author:   jimurphy@adobe.com
Date:     2008-04-18T00:47:49.350652Z

Log Message:
-----------
merge 3.0.x[1266:1266] -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/config/ConfigMap.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/CompositeEffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/MultiTopicProducer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/QualifiedResourceManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/Producer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/mxml/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/mxml/Operation.as</path>

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

--- frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as
+++ frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as
@@ -30,7 +30,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  Converts an ActionScript object into a Number, Boolean, or String.
+     *  @private
      */
     public static function simpleType(val:Object):Object
     {
@@ -92,6 +92,10 @@

     /**
      *  Converts a tree of XMLNodes into a tree of ActionScript Objects.
+     *
+     *  @param dataNode An XMLNode to be converted into a tree of ActionScript Objects.
+     *
+     *  @return A tree of ActionScript Objects.
      */
     public function decodeXML(dataNode:XMLNode):Object
     {
@@ -189,6 +193,11 @@
         return result;
     }

+    /**
+     * Returns the local name of an XMLNode.
+     *
+     * @return The local name of an XMLNode.
+     */
     public static function getLocalName(xmlNode:XMLNode):String
     {
         var name:String = xmlNode.nodeName;


Transferred from the Adobe Open Source Subversion Repository

Revision: 3628
Author:   smgilson@adobe.com
Date:     2008-10-14T18:30:19.526857Z

Log Message:
-----------
ASdoc edits

Checkin Test Passed: Yes
QA: No
Bug:
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxCheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxToggleButton.as</path>

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

--- frameworks/projects/spark/src/spark/components/CheckBox.as
+++ frameworks/projects/spark/src/spark/components/CheckBox.as
@@ -16,7 +16,14 @@
 import flash.events.MouseEvent;

 /**
- *  Documentation is not currently available.
+ *  The FxCheckBox component consists of an optional label and a small box
+ *  that can contain a check mark or not.
+ *  You can place the optional text label to the left, right, top, or bottom
+ *  of the CheckBox.
+ *
+ *
When a user clicks a FxCheckBox component or its associated text,
+ *  the FxCheckBox component sets its selected property
+ *  to true for checked, and to false for unchecked.

  */
 public class FxCheckBox extends FxToggleButton
 {
@@ -31,10 +38,10 @@
     /**
      *  Constructor.
      */
-	public function FxCheckBox()
-	{
-		super();
-	}
+    public function FxCheckBox()
+    {
+        super();
+    }
 }

 }


avoid creating new BitmapData objects when it's not necessary in TextureResource.setContentFromBitmapData()

--- src/aerys/minko/render/resource/texture/TextureResource.as
+++ src/aerys/minko/render/resource/texture/TextureResource.as
@@ -89,7 +89,8 @@
 			if (h > MAX_SIZE)
 				h = MAX_SIZE;

-			_bitmapData	= new BitmapData(w, h, bitmapData.transparent, 0);
+			if (_bitmapData == null || _bitmapData.width != w || _bitmapData.height != h)
+				_bitmapData	= new BitmapData(w, h, bitmapData.transparent, 0);

 			if (w != bitmapWidth || h != bitmapHeight)
 			{


Let's make this static.

Let's make this static.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@836 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/parlor/game/client/GameController.as
+++ src/as/com/threerings/parlor/game/client/GameController.as
@@ -63,6 +63,14 @@
     }

     /**
+     * Returns the persistent user id for the supplied player name.
+     */
+    public static function nameToId (name :Name) :int
+    {
+        return (_userIder == null) ? 0 : _userIder.getUserId(name);
+    }
+
+    /**
      * Initializes this game controller with the game configuration that
      * was established during the match making process. Derived classes
      * may want to override this method to initialize themselves with
@@ -167,14 +175,6 @@

         // end the game until we receive a new board
         setGameOver(true);
-    }
-
-    /**
-     * Returns the persistent user id for the supplied player name.
-     */
-    public function nameToId (name :Name) :int
-    {
-        return (_userIder == null) ? 0 : _userIder.getUserId(name);
     }

     /**


added explicit check for ILinkableObject class in isLinkable()

--- WeaveJS/src/Weave.as
+++ WeaveJS/src/Weave.as
@@ -380,7 +380,7 @@
 		 */
 		public static function isLinkable(objectOrClass:Object):Boolean
 		{
-			if (objectOrClass is ILinkableObject)
+			if (objectOrClass is ILinkableObject || objectOrClass === ILinkableObject)
 				return true;
 			// test class definition
 			return objectOrClass && objectOrClass.prototype is ILinkableObject;


added test code

added test code

Change-Id: Ieb631d1746f6157993ec8a1eb55e6ec9cfc1d169

--- WeaveCore/src/weave/utils/DebugUtils.as
+++ WeaveCore/src/weave/utils/DebugUtils.as
@@ -39,6 +39,64 @@
 	 */
 	public class DebugUtils
 	{
+		public static function _testVariableLengthEncoding(random:Boolean = true, count:uint = 10000, max:uint = int.MAX_VALUE):void
+		{
+			var i:uint;
+			var b:uint;
+			var value:uint;
+			var array:Array = new Array(count);
+			var bytes1:ByteArray = new ByteArray();
+			var bytes2:ByteArray = new ByteArray();
+			for (i = 0; i < array.length; i++)
+			{
+				value = random ? uint(Math.random() * max) : i;
+				array[i] = value;
+				bytes1.writeUnsignedInt(value);
+
+				do {
+					b = value & 0x7F;
+					value = (value >> 7) & 0x01FFFFFF;
+					if (value == 0)
+					{
+						bytes2.writeByte(b);
+						break;
+					}
+
+					bytes2.writeByte(b | 0x80);
+				} while (true);
+			}
+			bytes1.position = 0;
+			bytes2.position = 0;
+
+			weaveTrace(StringUtil.substitute('array.length {0}, bytes1.length {1}, bytes2.length {2}',array.length,bytes1.length, bytes2.length));
+
+			DebugTimer.begin();
+
+			i = 0;
+			while (bytes1.bytesAvailable)
+			{
+				value = bytes1.readUnsignedInt();
+				if (array[i++] != value)
+					throw "bytes1 fail";
+			}
+
+			DebugTimer.lap('bytes1');
+
+			i = 0;
+			while (bytes2.bytesAvailable)
+			{
+				value = (b = bytes2.readUnsignedByte()) & 0x7F;
+				for (var s:uint = 7; b & 0x80; s += 7)
+					value |= ((b = bytes2.readUnsignedByte()) & 0x7F) << s;
+
+				if (array[i++] != value)
+					throw "bytes2 fail";
+			}
+
+			DebugTimer.end('bytes2');
+		}
+
+
 		/****************************
 		 **  Object id and lookup  **
 		 ****************************/


added check for null

added check for null

--- WeaveJS/src/weavejs/data/ColumnUtils.as
+++ WeaveJS/src/weavejs/data/ColumnUtils.as
@@ -820,9 +820,12 @@
 			for (var iRef:int = 0; iRef < columnReferences.length; iRef++)
 			{
 				var ref:IColumnReference = columnReferences[iRef] as IColumnReference;
-				var objectName:String = names[newState.length] || destination.generateUniqueName(baseName);
-				var sessionState:Object = ReferencedColumn.generateReferencedColumnStateFromColumnReference(ref);
-				newState.push(DynamicState.create(objectName, className, sessionState));
+				if (ref)
+				{
+					var objectName:String = names[newState.length] || destination.generateUniqueName(baseName);
+					var sessionState:Object = ReferencedColumn.generateReferencedColumnStateFromColumnReference(ref);
+					newState.push(DynamicState.create(objectName, className, sessionState));
+				}
 			}
 			destination.setSessionState(newState, true);
 		}


Fixes connect and call arguments Use apply to avoid arguments to be sent as mixed array

--- src/NetConnectionPolyfill.as
+++ src/NetConnectionPolyfill.as
@@ -57,7 +57,7 @@
                 ExternalInterface.addCallback("nc_setClient", onSetClientCalled);

             } catch (e:Error) {
-                log("error", e.getStackTrace());
+                log("error", e.message);
             } finally {}
         }

@@ -87,7 +87,15 @@
         }

         private function onCallCalled(command: String, ... args):void {
-            this._nc.call(command, null, args);
+            try {
+                log('info', 'Calling '+command);
+                var __incomingArgs:* = args as Array;
+                var __newArgs:Array = [command, null].concat(__incomingArgs);
+                var __sanitizedArgs:Array = cleanObject(__newArgs);
+                this._nc.call.apply(this._nc, __sanitizedArgs);
+            } catch (e: Error) {
+                log('error', e.message);
+            }
         }

         private function onCloseCalled():void {
@@ -95,7 +103,11 @@
         }

         private function onConnectCalled(command:*, ...args):void {
-            this._nc.connect(command, args);
+            log('info', 'Connecting to '+command);
+            var __incomingArgs:* = args as Array;
+            var __newArgs:Array = [command].concat(__incomingArgs);
+            var __sanitizedArgs:Array = cleanObject(__newArgs);
+            this._nc.connect.apply(this._nc, __sanitizedArgs);
         }

         private function onSetClientCalled(methods: Array):void {
@@ -108,7 +120,7 @@
                     }
                 }
             } catch (e: Error) {
-                log('error', e.getStackTrace());
+                log('error', e.message);
             }
         }

@@ -139,9 +151,9 @@
             }
         }

-        private function log(level: String, message: String):void {
+        private function log(level: String, message: *):void {
             if (loaderInfo.parameters.debug != undefined && loaderInfo.parameters.debug == "true") {
-                this.callExternalInterface(_jsLogProxyName, level, message);
+                this.callExternalInterface(_jsLogProxyName, level, cleanObject(message));
             }
         }

@@ -154,7 +166,10 @@
             }
         }

-        private function cleanObject(o:*):* {
+        private function cleanObject(o:*):* {
+            if (o == null) {
+                return null;
+            }
             if (o is String) {
                 return o.split("\\").join("\\\\");
             } else if (o is Array) {


added check for disposed object

added check for disposed object

--- WeaveJS/src/Weave.as
+++ WeaveJS/src/Weave.as
@@ -275,7 +275,7 @@
 					break;
 				object = owner;
 			}
-			return object as ILinkableHashMap;
+			return wasDisposed(object) ? null : object as ILinkableHashMap;
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 19242
Author:   aharui@adobe.com
Date:     2010-12-09T22:27:31.442236Z

Log Message:
-----------
Disable MEASURED_SIZE_PRELIMINARY if icon not used.  All fix up propagation of estimatedSizes

QE notes: none
Doc notes: none
Bugs: SDK-28658
Reviewer: Evtim
Tests run: checkintests mustella full run
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.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" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/core/Application.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/SkinnableContainerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airspark/src/spark/components/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/airspark/src/spark/components/Window.as
+++ frameworks/projects/airspark/src/spark/components/Window.as
@@ -31,6 +31,7 @@
 import mx.controls.FlexNativeMenu;
 import mx.core.ContainerCreationPolicy;
 import mx.core.FlexGlobals;
+import mx.core.FlexVersion;
 import mx.core.IVisualElement;
 import mx.core.IWindow;
 import mx.core.mx_internal;
@@ -1931,6 +1932,22 @@
         }
     }

+    /**
+     *  @private
+     *  Applications set estimated sizes for their children
+     */
+    override public function setActualSize(w:Number, h:Number):void
+    {
+        if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_5)
+        {
+            setEstimatedSize(w, h, false);
+            invalidateEstimatedSizesOfChildren();
+            validateEstimatedSizesOfChildren();
+        }
+
+        super.setActualSize(w, h);
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: SkinnableContainer


FLEX-33273 Performances CSSCondition.matchesStyleClient() is slow and creates excessive garbage

git-svn-id: 7d913817b0a978d84de757191e4bce372605a781@1420855 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/styles/CSSCondition.as
+++ frameworks/projects/framework/src/mx/styles/CSSCondition.as
@@ -19,6 +19,8 @@

 package mx.styles
 {
+
+import mx.utils.StringUtil;

 /**
  *  Represents a condition for a CSSSelector which is used to match a subset of
@@ -161,36 +163,47 @@
      */
     public function matchesStyleClient(object:IAdvancedStyleClient):Boolean
     {
-        var match:Boolean = false;
-
         if (kind == CSSConditionKind.CLASS)
         {
-            if (object.styleName != null && object.styleName is String)
+            const styleName:String = object.styleName as String;
+            if (!styleName)
             {
-                // Look for a match in a potential list of styleNames
-                var styleNames:Array = object.styleName.split(/\s+/);
-                for (var i:uint = 0; i < styleNames.length; i++)
+                return false;
+            }
+
+            // Look for a match in a whitespace-delimited list of styleNames
+            var index:int = styleName.indexOf(value);
+            while (index != -1)
+            {
+                var next:int = index + value.length;
+
+                // At start or after whitespace?
+                if (index == 0 || StringUtil.isWhitespace(styleName.charAt(index - 1)))
                 {
-                    if (styleNames[i] == value)
+                    // At end or followed by whitespace?
+                    if (next == styleName.length || StringUtil.isWhitespace(styleName.charAt(next)))
                     {
-                        match = true;
-                        break;
+                        return true;
                     }
                 }
+
+                index = styleName.indexOf(value, next)
             }
+
+            return false;
         }
-        else if (kind == CSSConditionKind.ID)
+
+        if (kind == CSSConditionKind.ID)
         {
-            if (object.id == value)
-                match = true;
+            return (object.id == value);
         }
-        else if (kind == CSSConditionKind.PSEUDO)
+
+        if (kind == CSSConditionKind.PSEUDO)
         {
-            if (object.matchesCSSState(value))
-                match = true;
+            return object.matchesCSSState(value);
         }

-        return match;
+        return false;
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/framework/src/mx/styles/IStyleModule.as
+++ frameworks/projects/framework/src/mx/styles/IStyleModule.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2006-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  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
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

Revision: 16937
Author:   smgilson@adobe.com
Date:     2010-07-15T16:35:17.543693Z

Log Message:
-----------
Add ASDoc comment about using component in an item renderer

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Image.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>

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

--- frameworks/projects/spark/src/spark/components/ButtonBar.as
+++ frameworks/projects/spark/src/spark/components/ButtonBar.as
@@ -56,9 +56,9 @@
  *  The ButtonBar control automatically adds or removes the necessary children based on
  *  changes to the dataProvider property.

  *
- *
An item renderer lets you customize the display of a list-based component,
- *  such as a List or DataGrid control.
- *  For information about using this component in an item renderer, see
+ *
To use this component in a list-based component, such as a List or DataGrid,
+ *  create an item renderer.
+ *  For information about creating an item renderer, see
  *
  *  Custom Spark item renderers.

  *


Transferred from the Adobe Open Source Subversion Repository

Revision: 3509
Author:   jimurphy@adobe.com
Date:     2008-10-07T18:19:17.646255Z

Log Message:
-----------
Rename of flex -> mx.

For compatibility reasons it was decided that the new functionality remain integrated with the old framework, although we will continue to build two separate SWCs, one with primarily existing framework classes, and one with new Flex 4 classes. This change removes duplicate names from the Flex 4 framework to avoid class name overlapping with the old framework code.  The naming overlap consists of two major areas:  New Components, and New Effects

Modified Paths:
--------------
386 paths were modified

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -1,4 +1,4 @@
-package flex.core
+package mx.components
 {
 import flash.display.DisplayObject;
 import flash.display.Sprite;
@@ -8,20 +8,21 @@
 import flash.geom.Rectangle;
 import flash.utils.Dictionary;

-import flex.events.FlexEvent;
-import flex.events.ItemExistenceChangedEvent;
-import flex.graphics.Graphic;
-import flex.graphics.IGraphicElement;
-import flex.graphics.IGraphicElementHost;
-import flex.graphics.MaskType;
-import flex.graphics.TransformUtil;
-import flex.graphics.graphicsClasses.GraphicElement;
-import flex.intf.ILayoutItem;
-import flex.layout.BasicLayout;
-import flex.layout.LayoutItemFactory;
+import mx.events.FlexEvent;
+import mx.events.ItemExistenceChangedEvent;
+import mx.graphics.Graphic;
+import mx.graphics.IGraphicElement;
+import mx.graphics.IGraphicElementHost;
+import mx.graphics.MaskType;
+import mx.utils.MatrixUtil;
+import mx.graphics.graphicsClasses.GraphicElement;
+import mx.layout.ILayoutItem;
+import mx.layout.BasicLayout;
+import mx.layout.LayoutItemFactory;

 import mx.collections.ICollectionView;
 import mx.collections.IList;
+import mx.components.baseClasses.GroupBase;
 import mx.controls.Label;
 import mx.core.IDataRenderer;
 import mx.core.IDeferredInstance;


Transferred from the Adobe Open Source Subversion Repository

Revision: 19674
Author:   cframpto@adobe.com
Date:     2011-01-10T21:50:40.535000Z

Log Message:
-----------
Add sortChanging and sortChange events to DataGrid for interactive sorting.  For now, until PARB'ed, change sortByColumns() signature to
    public function sortByColumns(columnIndices:Vector.<int>, isInteractive:Boolean=false):Boolean
Fix some doc nits in the other grid events.

QE notes:
Doc notes:
Bugs: SDK-28617
Reviewer: Hans, Kevin
Tests run: cyclone
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridCaretEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridSelectionEvent.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/GridSortEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>

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

--- frameworks/projects/spark/src/spark/events/GridSortEvent.as
+++ frameworks/projects/spark/src/spark/events/GridSortEvent.as
@@ -0,0 +1,293 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package spark.events
+{
+
+import flash.events.Event;
+
+import spark.components.DataGrid;
+
+/**
+ *  The GridSortEvent class represents events that are dispatched when
+ *  the data provider of a Spark DataGrid control is sorted as the
+ *  result of the user clicking on the header of a column in the DataGrid.
+ *
+ *  @see spark.components.DataGrid
+ *  @see spark.components.gridClasses.GridColumn
+ *  @see spark.components.gridClasses.GridColumnHeaderGroup
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+public class GridSortEvent extends Event
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  The GridSortEvent.SORT_CHANGE constant defines
+     *  the value of the type property of the event object for a
+     *  sortChange event, which indicates that a sort filter has just been
+     *  applied to the grid's dataProvider collection.
+     *
+     *
Typically, if a column header mouse click triggered the sort, then the last index of
+     *  columnIndices is the column's index.
+     *  Note that interactive sorts are not necessarily triggered by a mouse click.

+     *
+     *
This event is dispatched when the user interacts with the control.
+     *  When you sort the data provider's collection programmatically,
+     *  the component does not dispatch the sortChange event.

+     *
+     *
The properties of the event object have the following values:

+     *

+     *
Property	Value

+     *
bubbles	false

+     *
cancelable	false

+     *
columnIndices	The vector of column indices of the
+     *       sorted columns.

+     *
currentTarget	The Object that defines the
+     *       event listener that handles the event. For example, if you use
+     *       myDataGrid.addEventListener() to register an event listener,
+     *       myDataGrid is the value of the currentTarget.

+     *
newSortFields	The array of ISortFields for this
+     *       sort.

+     *
oldSortFields	The array of ISortFields for the
+     *       last sort.

+     *
target	The Object that dispatched the event;
+     *       it is not always the Object listening for the event.
+     *       Use the currentTarget property to always access the
+     *       Object listening for the event.

+     *
type	GridSelectionEvent.SORT_CHANGE

+     *

+     *
+     *  @eventType sortChange
+     *
+     *  @see spark.components.DataGrid#dataProvider
+     *  @see spark.components.DataGrid#sortByColumns
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public static const SORT_CHANGE:String = "sortChange";
+
+    /**
+     *  The GridSortEvent.SORT_CHANGING constant defines
+     *  the value of the type property of the event object for a
+     *  sortChanging event, which indicates that a sort filter is about to be
+     *  applied to the grid's dataProvider collection.
+     *  Call preventDefault() on this event to prevent the sort from occuring
+     *  or you modify columnIndices and newSortFields if you want to
+     *  change the default behavior of the sort.
+     *
+     *
Typically, if a column header mouse click triggered the sort, then the last index of
+     *  columnIndices is the column's index.
+     *  Note that interactive sorts are not necessarily triggered by a mouse click.

+     *
+     *
This event is dispatched when the user interacts with the control.
+     *  When you sort the data provider's collection programmatically,
+     *  the component does not dispatch the sortChanging event.

+     *
+     *
The properties of the event object have the following values:

+     *

+     *
Property	Value

+     *
bubbles	false

+     *
cancelable	false

+     *
columnIndices	The vector of column indices of the
+     *       columns to be sorted.

+     *
currentTarget	The Object that defines the
+     *       event listener that handles the event. For example, if you use
+     *       myDataGrid.addEventListener() to register an event listener,
+     *       myDataGrid is the value of the currentTarget.

+     *
newSortFields	The array of ISortFields for this
+     *       sort.

+     *
oldSortFields	The array of ISortFields for the
+     *       last sort.

+     *
target	The Object that dispatched the event;
+     *       it is not always the Object listening for the event.
+     *       Use the currentTarget property to always access the
+     *       Object listening for the event.

+     *
type	GridSelectionEvent.SORT_CHANGING

+     *

+     *
+     *  @eventType sortChanging
+     *
+     *  @see spark.components.DataGrid#dataProvider
+     *  @see spark.components.DataGrid#sortByColumns
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public static const SORT_CHANGING:String = "sortChanging";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param type The event type; indicates the action that caused the event.
+     *
+     *  @param bubbles Specifies whether the event can bubble
+     *  up the display list hierarchy.
+     *
+     *  @param cancelable Specifies whether the behavior
+     *  associated with the event can be prevented.
+     *
+     *  @param columnIndices The vector of column indices of the sorted columns.
+     *
+     *  @param oldSortFields The array of ISortFields for the last sort.
+     *
+     *  @param newSortFields The array of ISortFields for this sort.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function GridSortEvent(type:String,
+                                  bubbles:Boolean,
+                                  cancelable:Boolean,
+                                  columnIndices:Vector.<int>,
+                                  oldSortFields:Array, /* ISortField */
+                                  newSortFields:Array) /* ISortField */
+     {
+        super(type, bubbles, cancelable);
+
+        this.columnIndices = columnIndices ? columnIndices.concat() : null;
+
+        // These are shallow copies.
+        _oldSortFields = oldSortFields ? oldSortFields.concat() : null;
+        this.newSortFields = newSortFields ? newSortFields.concat() : null;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  columnIndices
+    //----------------------------------
+
+    /**
+     *  The vector of column indices of the sorted columns.
+     *  If type is GridSelectionEvent.SORT_CHANGING this value
+     *  can be modified and it will be used to update the grid's columnHeaderGroup
+     *  visibleSortIndicatorIndices.
+     *
+     *  @see spark.components.DataGrid#columnHeaderGroup
+     *  @see spark.components.gridClasses.GridColumnHeaderGroup#visibleSortIndicatorIndices
+     *  @see spark.components.gridClasses.GridColumn#columnIndex
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var columnIndices:Vector.<int>;
+
+    //----------------------------------
+    //  newSortFields
+    //----------------------------------
+
+    /**
+     *  The array of ISortFields for this sort.
+     *  If type is GridSelectionEvent.SORT_CHANGING this value
+     *  can be modified and it will be used to sort the dataProvider of the grid.
+     *
+     *  @see spark.components.DataGrid#dataProvider
+     *  @see spark.components.gridClasses.GridColumn#sortCompareFunction
+     *  @see spark.components.gridClasses.GridColumn#sortDescending
+     *  @see spark.components.gridClasses.GridColumn#sortField
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public var newSortFields:Array;  /* of ISortField */
+
+    //----------------------------------
+    //  oldSortFields
+    //----------------------------------
+
+    private var _oldSortFields:Array;  /* of ISortField */
+
+    /**
+     *  The array of ISortFields for the last sort.  This can be null.
+     *  The elements in this Array should not be modified.
+     *
+     *  @see spark.components.DataGrid#dataProvider
+     *  @see spark.components.gridClasses.GridColumn#sortCompareFunction
+     *  @see spark.components.gridClasses.GridColumn#sortDescending
+     *  @see spark.components.gridClasses.GridColumn#sortField
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get oldSortFields():Array
+    {
+        return _oldSortFields;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: Object
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function toString():String
+    {
+        return formatToString(
+            "GridSortEvent", "type",
+            "bubbles", "cancelable", "eventPhase",
+            "columnIndices");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: Event
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function clone():Event
+    {
+        return new GridSortEvent(
+            type, bubbles, cancelable,
+            columnIndices, oldSortFields, newSortFields);
+    }
+}
+
+}


Issue #200: Decrease default widget min width/height.

--- src/com/esri/viewer/WidgetTemplate.as
+++ src/com/esri/viewer/WidgetTemplate.as
@@ -101,9 +101,9 @@

     private static const WIDGET_STOP_DRAG:String = "stopDrag";

-    private static const DEFAULT_MIN_WIDTH:Number = 200;
-
-    private static const DEFAULT_MIN_HEIGHT:Number = 100;
+    private static const DEFAULT_MIN_WIDTH:Number = 150;
+
+    private static const DEFAULT_MIN_HEIGHT:Number = 75;

     private var _widgetId:Number;


Remove checking for marking source as cloneable.

--- dolly-framework/src/main/actionscript/dolly/Cloner.as
+++ dolly-framework/src/main/actionscript/dolly/Cloner.as
@@ -6,7 +6,6 @@

 import org.as3commons.reflect.Accessor;
 import org.as3commons.reflect.Field;
-import org.as3commons.reflect.IMetadataContainer;
 import org.as3commons.reflect.Type;
 import org.as3commons.reflect.Variable;

@@ -33,32 +32,14 @@
 		var variable:Variable;
 		var accessor:Accessor;

-		const isClassCloneable:Boolean = isTypeCloneable(type);
-		if (isClassCloneable) {
-			for each(variable in type.variables) {
-				if (isVariableCloneable(variable)) {
-					result.push(variable);
-				}
+		for each(variable in type.variables) {
+			if (isVariableCloneable(variable)) {
+				result.push(variable);
 			}
-			for each(accessor in type.accessors) {
-				if (isAccessorCloneable(accessor)) {
-					result.push(accessor);
-				}
-			}
-		} else {
-			const metadataContainers:Array = type.getMetadataContainers(MetadataName.CLONEABLE);
-			for each(var metadataContainer:IMetadataContainer in metadataContainers) {
-				if (metadataContainer is Variable) {
-					variable = metadataContainer as Variable;
-					if (isVariableCloneable(variable, false)) {
-						result.push(variable);
-					}
-				} else if (metadataContainer is Accessor) {
-					accessor = metadataContainer as Accessor;
-					if (isAccessorCloneable(accessor, false)) {
-						result.push(accessor);
-					}
-				}
+		}
+		for each(accessor in type.accessors) {
+			if (isAccessorCloneable(accessor)) {
+				result.push(accessor);
 			}
 		}


rename PauseGame to ToggleGamePause

rename PauseGame to ToggleGamePause

--- Assets/GameLogic/Scripts/LevelManager.as
+++ Assets/GameLogic/Scripts/LevelManager.as
@@ -620,7 +620,7 @@
 	{
 		if(key == KEY_P)
 		{
-			PauseGame();
+			ToggleGamePause();
 		}
 	}

@@ -777,7 +777,7 @@
 	}

-	void PauseGame()
+	void ToggleGamePause()
 	{
 		scene.updateEnabled = !scene.updateEnabled;

@@ -927,7 +927,7 @@
 		// start in game pauses, unpauses
 		if( jsButton == myjoystick_.button(CONTROLLER_BUTTON_START) && (levelState_ == LS_INGAME || levelState_ == LS_PAUSED) )
 		{
-			PauseGame();
+			ToggleGamePause();
 		}

 		//  fire only in game


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/charts/src/mx/charts/AxisLabel.as
+++ frameworks/projects/charts/src/mx/charts/AxisLabel.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.charts
+{
+
+/**
+ *  An AxisLabel object represents a single label on the chart axis.
+ *  AxisLabel objects are generated by IAxis objects.
+ *  The AxisLabel object is also passed as the data
+ *  to custom AxisLabel objects that implement the IDataRenderer interface.
+ *
+ *  @see mx.charts.AxisRenderer
+ *  @see mx.charts.chartClasses.IAxis
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class AxisLabel
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param position The position, specified as a value between 0 and 1,
+	 *  of the label along the axis.
+	 *
+	 *  @param value The value the label represents.
+	 *
+	 *  @param text The text label that is actually rendered along the axis.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function AxisLabel(position:Number = 0, value:Object = null,
+							  text:String = null)
+	{
+		super();
+
+		this.position = position;
+		this.value = value;
+		this.text = text;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  position
+	//----------------------------------
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The position, specified as a value between 0 and 1,
+	 *  of the label along the axis.
+	 *  An AxisLabel with a position of 0 is placed at the minimum value
+	 *  of the axis, while an AxisLabel with a position of 1 is placed
+	 *  at the maximum value of the axis.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var position:Number;
+
+	//----------------------------------
+	//  text
+	//----------------------------------
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The text label that is actually rendered along the axis.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var text:String;
+
+	//----------------------------------
+	//  value
+	//----------------------------------
+
+	[Inspectable(environment="none")]
+
+	/**
+	 *  The value that the label represents.
+	 *  The particular type of the value property
+	 *  is specific to the axis that generated the label.
+	 *  For example, a LinearAxis might generate numeric values,
+	 *  while a DateTimeAxis might generate Date instance values.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public var value:Object;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 16500
Author:   dloverin@adobe.com
Date:     2010-06-09T12:33:11.723963Z

Log Message:
-----------
RSL bug fixes.

1.	Move mx.events.IndexChangedEvent from mx.swc back to framework.swc. Spark ButtonBarBase.as used the class.
2.	CrossDomainRSLItem – https://bugs.adobe.com/jira/browse/SDK-26635 - load all RSLs into the top-level application domain until we can implement the cooperative loading feature. This fix is needed to take advantage of the remove unused rsls feature but keep modules working. Here’s the scenario that broke:

* An application loads the spark RSL but not the OSMF RSL.
* the application loads a module that uses VideoPlayer. The module loads the OSMF RSL in its application domain but the definitions are not seen by the VideoPlayer class in the top-level app domain. The player throws a VerifyError on TimeEvent (TimeEvent is an OSMF class that VideoPlayer has an expression dependency on).
3.	Add Spark components to the HelloWorld test application so make sure spark does not gain a dependency on mx.swc.
4.	PanelAccImpl – clean up an unused import statement.

QE notes: None.
Doc notes: None.
Bugs: SDK-26635
Reviewer: Alex
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/CrossDomainRSLItem.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/events/IndexChangedEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/accessibility/PanelAccImpl.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/events/IndexChangedEvent.as" copyfrom-rev="16494" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/IndexChangedEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/basicTests/spark/views/HelloWorld.mxml</path>

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

--- frameworks/projects/framework/src/FrameworkClasses.as
+++ frameworks/projects/framework/src/FrameworkClasses.as
@@ -80,6 +80,7 @@
 	import mx.effects.easing.Exponential; Exponential;
 	import mx.events.CloseEvent; CloseEvent;
 	import mx.events.DropdownEvent; DropdownEvent;
+    import mx.events.IndexChangedEvent; IndexChangedEvent;
 	import mx.events.ItemClickEvent; ItemClickEvent;
 	import mx.events.ModuleEvent; ModuleEvent;
 	import mx.filters.BaseFilter; BaseFilter;
@@ -88,15 +89,15 @@
 	import mx.graphics.ImageSnapshot; ImageSnapshot;
 	import mx.graphics.codec.PNGEncoder; PNGEncoder;
 	import mx.graphics.codec.JPEGEncoder; JPEGEncoder;
-      import mx.graphics.shaderClasses.ColorBurnShader; ColorBurnShader;
-      import mx.graphics.shaderClasses.ColorDodgeShader; ColorDodgeShader;
-      import mx.graphics.shaderClasses.ColorShader; ColorShader;
-      import mx.graphics.shaderClasses.ExclusionShader; ExclusionShader;
-      import mx.graphics.shaderClasses.HueShader; HueShader;
-      import mx.graphics.shaderClasses.LuminosityShader; LuminosityShader;
-      import mx.graphics.shaderClasses.LuminosityMaskShader; LuminosityMaskShader;
-      import mx.graphics.shaderClasses.SaturationShader; SaturationShader;
-      import mx.graphics.shaderClasses.SoftLightShader; SoftLightShader;
+    import mx.graphics.shaderClasses.ColorBurnShader; ColorBurnShader;
+    import mx.graphics.shaderClasses.ColorDodgeShader; ColorDodgeShader;
+    import mx.graphics.shaderClasses.ColorShader; ColorShader;
+    import mx.graphics.shaderClasses.ExclusionShader; ExclusionShader;
+    import mx.graphics.shaderClasses.HueShader; HueShader;
+    import mx.graphics.shaderClasses.LuminosityShader; LuminosityShader;
+    import mx.graphics.shaderClasses.LuminosityMaskShader; LuminosityMaskShader;
+    import mx.graphics.shaderClasses.SaturationShader; SaturationShader;
+    import mx.graphics.shaderClasses.SoftLightShader; SoftLightShader;
 	import mx.logging.ILogger; ILogger;
 	import mx.logging.Log; Log;
 	import mx.logging.targets.TraceTarget; TraceTarget;
@@ -108,7 +109,7 @@
 	import mx.managers.marshalClasses.FocusManagerMarshalMixin; FocusManagerMarshalMixin;
 	import mx.managers.marshalClasses.PopUpManagerMarshalMixin; PopUpManagerMarshalMixin;
 	import mx.managers.marshalClasses.ToolTipManagerMarshalMixin; ToolTipManagerMarshalMixin;
-      import mx.managers.PopUpManager; PopUpManager;
+    import mx.managers.PopUpManager; PopUpManager;
 	import mx.managers.systemClasses.ActiveWindowManager; ActiveWindowManager;
 	import mx.managers.systemClasses.ChildManager; ChildManager;
 	import mx.managers.systemClasses.MarshallingSupport; MarshallingSupport;
@@ -116,8 +117,8 @@
 	import mx.modules.IModuleInfo; IModuleInfo;
 	import mx.modules.ModuleBase; ModuleBase;
 	import mx.modules.ModuleManager; ModuleManager;
-      import mx.preloaders.DownloadProgressBar; DownloadProgressBar;
-      import mx.preloaders.SparkDownloadProgressBar; SparkDownloadProgressBar;
+    import mx.preloaders.DownloadProgressBar; DownloadProgressBar;
+    import mx.preloaders.SparkDownloadProgressBar; SparkDownloadProgressBar;
 	import mx.printing.FlexPrintJob; FlexPrintJob;
 	import mx.resources.Locale; Locale;
 	import mx.rpc.IResponder; IResponder;
@@ -135,8 +136,8 @@
 	import mx.utils.DescribeTypeCache; DescribeTypeCache;
 	import mx.utils.DescribeTypeCacheRecord; DescribeTypeCacheRecord;
 	import mx.utils.DisplayUtil; DisplayUtil;
-        import mx.utils.HSBColor; HSBColor;
-        import mx.utils.LinkedList; LinkedList;
+    import mx.utils.HSBColor; HSBColor;
+    import mx.utils.LinkedList; LinkedList;
 	import mx.utils.LinkedListNode; LinkedListNode;
 	import mx.utils.OrderedObject; OrderedObject;
 	import mx.utils.XMLUtil; XMLUtil;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

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

--- frameworks/projects/framework/src/mx/utils/XMLUtil.as
+++ frameworks/projects/framework/src/mx/utils/XMLUtil.as
@@ -0,0 +1,114 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.utils
+{
+
+import flash.xml.XMLDocument;
+
+/**
+ *  The XMLUtil class is an all-static class
+ *  with methods for working with XML within Flex.
+ *  You do not create instances of XMLUtil;
+ *  instead you simply call static methods such as
+ *  the XMLUtil.qnamesEqual() method.
+ */
+public class XMLUtil
+{
+	include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  Creates XML out of the specified string, ignoring whitespace.
+     *  This method is used to create objects defined in
+	 *  <mx:XML> tags and WebService requests,
+	 *  although they, in turn, get the firstChild
+	 *  of the structure.
+	 *
+     *  @param str XML string.
+	 *
+     *  @return New XML object that ignored whitespace.
+     */
+    public static function createXMLDocument(str:String):XMLDocument
+    {
+	    var xml:XMLDocument = new XMLDocument();
+        xml.ignoreWhite = true;
+		xml.parseXML(str);
+		return xml;
+    }
+
+    /**
+	 *  Returns true if the two QName parameters have identical
+	 *  uri and localName properties.
+	 *
+	 *  @param qname1 First QName object.
+	 *
+	 *  @param qname2 Second QName object.
+	 *
+	 *  @return true if the two QName parameters have identical
+	 *  uri and localName properties.
+	 */
+	public static function qnamesEqual(qname1:QName, qname2:QName):Boolean
+    {
+        return qname1.uri == qname2.uri &&
+			   qname1.localName == qname2.localName;
+    }
+
+    /**
+	 *  Returns the concatenation of a Qname object's
+	 *  uri and localName properties,
+	 *  separated by a colon.
+	 *  If the object does not have a uri property,
+	 *  or the value of uri is the empty string,
+	 *  returns the localName property.
+	 *
+	 *  @param qname QName object.
+	 *
+	 *  @return Concatenation of a Qname object's
+	 *  uri and localName properties,
+	 *  separated by a colon.
+	 */
+    public static function qnameToString(qname:QName):String
+    {
+        return qname.uri && qname.uri != "" ?
+			   qname.uri + ":" + qname.localName :
+			   qname.localName;
+    }
+
+    /**
+    * Returns the XML value of an attribute matching the given QName
+    *
+    * @param xml the XML object being inspected
+    * @param attrQName the QName of the attribute to find
+    *
+    * @return XMLList of matching attributes or an empty list if none are found.
+    */
+    public static function getAttributeByQName(xml:XML, attrQName:QName):XMLList
+    {
+        var attributes:XMLList = xml.attribute(attrQName);
+        //xml.attribute(QName) will also return local no-namespace attributes
+        //even if we are looking for a specific full qualified name.
+        for each (var attribute:XML in attributes)
+        {
+            var thisQName:QName = attribute.name();
+            if (thisQName.uri == attrQName.uri)
+                return new XMLList(attribute);
+        }
+        return new XMLList();
+    }
+
+}
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19876
Author:   aharui@adobe.com
Date:     2011-01-21T22:26:17.861225Z

Log Message:
-----------
Sync up ViewStacks and ButtonBars when lots of views are added at the same time.

QE notes: none
Doc notes: none
Bugs: SDK-27755
Reviewer: Corey
Tests run: checkintests mustella cyclone
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/NavBar.as</path>

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

--- frameworks/projects/mx/src/mx/containers/ViewStack.as
+++ frameworks/projects/mx/src/mx/containers/ViewStack.as
@@ -259,10 +259,6 @@
     public function ViewStack()
     {
         super();
-
-        addEventListener(ChildExistenceChangedEvent.CHILD_ADD, childAddHandler);
-        addEventListener(ChildExistenceChangedEvent.CHILD_REMOVE,
-                         childRemoveHandler);
     }

     //--------------------------------------------------------------------------
@@ -333,6 +329,12 @@
      */
     private var dispatchChangeEventPending:Boolean = false;

+    /**
+     *  @private
+     *  If we're in the middle of adding a child
+     */
+    private var addingChildren:Boolean = false;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties
@@ -695,6 +697,10 @@
     {
         // Bail if the index isn't changing.
         if (value == selectedIndex)
+            return;
+
+        // ignore, probably coming from tabbar
+        if (addingChildren)
             return;

         // Propose the specified value as the new value for selectedIndex.
@@ -1328,9 +1334,8 @@
     /**
      *  @private
      */
-    private function childAddHandler(event:ChildExistenceChangedEvent):void
-    {
-        var child:DisplayObject = event.relatedObject;
+    private function childAddHandler(child:DisplayObject):void
+    {
         var index:int = getChildIndex(child);

         if (child is IUIComponent)
@@ -1350,11 +1355,15 @@
         // been proposed, then propose this child to be selected.
         if (numChildren == 1 && proposedSelectedIndex == -1)
         {
-            selectedIndex = 0;
+            _selectedIndex = 0;
+            dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+            needToInstantiateSelectedChild = true;
+            invalidateProperties();
         }
         else if (index <= selectedIndex && numChildren > 1 && proposedSelectedIndex == -1)
         {
-            selectedIndex++;
+            _selectedIndex++;
+            dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
         }

         if (child is IAutomationObject)
@@ -1369,11 +1378,8 @@
      *  next (or previous) child gets automatically selected; when the last
      *  remaining child is removed, the selectedIndex is set to -1.
      */
-    private function childRemoveHandler(event:ChildExistenceChangedEvent):void
-    {
-        var child:DisplayObject = event.relatedObject;
-        var index:int = getChildIndex(child);
-
+    private function childRemoveHandler(child:DisplayObject, index:int):void
+    {
         if (child is INavigatorContent)
         {
             child.removeEventListener("labelChanged", navigatorChildChangedHandler);
@@ -1405,7 +1411,8 @@
             }
             else
             {
-                selectedIndex--;
+                _selectedIndex--;
+                dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
             }
         }
         else if (index == currentSelectedIndex)
@@ -1424,8 +1431,11 @@
      */
     override public function addChildAt(item:DisplayObject, index:int):DisplayObject
     {
+        addingChildren = true;
         var obj:DisplayObject = super.addChildAt(item, index);
         internalDispatchEvent(CollectionEventKind.ADD, obj, index);
+        childAddHandler(item);
+        addingChildren = false;
         return obj;
     }

@@ -1437,6 +1447,7 @@
         var index:int = getChildIndex(item);
         var obj:DisplayObject = super.removeChild(item);
         internalDispatchEvent(CollectionEventKind.REMOVE, obj, index);
+        childRemoveHandler(item, index);
         return obj;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/mx/src/mx/controls/ColorPicker.as
+++ frameworks/projects/mx/src/mx/controls/ColorPicker.as
@@ -53,6 +53,11 @@
  *
  *  @eventType mx.events.ColorPickerEvent.CHANGE
  *  @helpid 4918
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="change", type="mx.events.ColorPickerEvent")]

@@ -61,6 +66,11 @@
  *
  *  @eventType mx.events.DropdownEvent.CLOSE
  *  @helpid 4921
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="close", type="mx.events.DropdownEvent")]

@@ -71,6 +81,11 @@
  *
  *  @eventType mx.events.ColorPickerEvent.ENTER
  *  @helpid 4919
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="enter", type="mx.events.ColorPickerEvent")]

@@ -80,6 +95,11 @@
  *
  *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OUT
  *  @helpid 4924
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="itemRollOut", type="mx.events.ColorPickerEvent")]

@@ -89,6 +109,11 @@
  *
  *  @eventType mx.events.ColorPickerEvent.ITEM_ROLL_OVER
  *  @helpid 4923
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="itemRollOver", type="mx.events.ColorPickerEvent")]

@@ -97,6 +122,11 @@
  *
  *  @eventType mx.events.DropdownEvent.OPEN
  *  @helpid 4920
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="open", type="mx.events.DropdownEvent")]

@@ -112,36 +142,66 @@
 /**
  *  Color of the SwatchPanel object's background.
  *  The default value is 0xE5E6E7.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="backgroundColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Color of the outer border on the SwatchPanel object.
  *  The default value is 0xA5A9AE.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="borderColor", type="uint", format="Color", inherit="no")]

 /**
  *  Length of a close transition, in milliseconds.
  *  The default value is 250.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="closeDuration", type="Number", format="Time", inherit="no")]

 /**
  *  Easing function to control component tweening.
  *  The default value is undefined.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="closeEasingFunction", type="Function", inherit="no")]

 /**
  *  Number of columns in the swatch grid.
  *  The default value is 20.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="columnCount", type="int", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Alphas used for the background fill of controls.
  *  The default value is [ 0.6, 0.4 ].
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="fillAlphas", type="Array", arrayType="Number", inherit="no")]

@@ -149,54 +209,99 @@
  *  Colors used to tint the background of the control.
  *  Pass the same color for both values for a flat-looking control.
  *  The default value is [ 0xFFFFFF, 0xCCCCCC ].
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="fillColors", type="Array", arrayType="uint", format="Color", inherit="no")]

 /**
  *  Alphas used for the highlight fill of controls.
  *  The default value is [ 0.3, 0.0 ].
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="highlightAlphas", type="Array", arrayType="Number", inherit="no")]

 /**
  *  Horizontal gap between swatches in the swatch grid.
  *  The default value is 0.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="horizontalGap", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Length of an open transition, in milliseconds.
  *  The default value is 250.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="openDuration", type="Number", format="Time", inherit="no")]

 /**
  *  Easing function to control component tweening.
  *  The default value is undefined.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="openEasingFunction", type="Function", inherit="no")]

 /**
  *  Bottom padding of SwatchPanel object below the swatch grid.
  *  The default value is 5.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="paddingBottom", type="Number", format="Length", inherit="no")]

 /**
  *  Left padding of SwatchPanel object to the side of the swatch grid.
  *  The default value is 5.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="paddingLeft", type="Number", format="Length", inherit="no")]

 /**
  *  Right padding of SwatchPanel object to the side of the swatch grid.
  *  The default value is 5.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="paddingRight", type="Number", format="Length", inherit="no")]

 /**
  *  Top padding of SwatchPanel object above the swatch grid.
  *  The default value is 4.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="paddingTop", type="Number", format="Length", inherit="no")]

@@ -204,42 +309,77 @@
  *  Height of the larger preview swatch that appears above the swatch grid on
  *  the upper left of the SwatchPanel object.
  *  The default value is 22.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="previewHeight", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Width of the larger preview swatch.
  *  The default value is 45.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="previewWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Color of the swatches' borders.
  *  The default value is 0x000000.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchBorderColor", type="uint", format="Color", inherit="no")]

 /**
  *  Size of the outlines of the swatches' borders.
  *  The default value is 1.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchBorderSize", type="Number", format="Length", inherit="no")]

 /**
  *  Color of the background rectangle behind the swatch grid.
  *  The default value is 0x000000.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchGridBackgroundColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Size of the single border around the grid of swatches.
  *  The default value is 0.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchGridBorderSize", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Height of each swatch.
  *  The default value is 12.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchHeight", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

@@ -247,6 +387,11 @@
  *  Color of the highlight that appears around the swatch when the user
  *  rolls over a swatch.
  *  The default value is 0xFFFFFF.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchHighlightColor", type="uint", format="Color", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

@@ -254,6 +399,11 @@
  *  Size of the highlight that appears around the swatch when the user
  *  rolls over a swatch.
  *  The default value is 1.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchHighlightSize", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

@@ -282,30 +432,55 @@
  *      verticalGap:0;
  *  }
  *

+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchPanelStyleName", type="String", inherit="no")]

 /**
  *  Width of each swatch.
  *  The default value is 12.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="swatchWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Name of the style sheet definition to configure the text input control.
  *  The default value is "swatchPanelTextField"
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="textFieldStyleName", type="String", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Width of the text box that appears above the swatch grid.
  *  The default value is 72.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="textFieldWidth", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

 /**
  *  Vertical gap between swatches in the grid.
  *  The default value is 0.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="verticalGap", type="Number", format="Length", inherit="no", deprecatedReplacement="swatchPanelStyleName", deprecatedSince="3.0")]

@@ -430,6 +605,11 @@
  *  @includeExample examples/ColorPickerExample.mxml
  *
  *  @helpid 4917
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class ColorPicker extends ComboBase
 {
@@ -455,6 +635,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function ColorPicker()
     {
@@ -623,6 +808,11 @@
      *  black(0x000000) color if found, else it is 0.
      *
      *  @helpid 4931
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     override public function set selectedIndex(value:int):void
     {
@@ -718,6 +908,11 @@
      *
      *  @default "color"
      *  @helpid 4927
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get colorField():String
     {
@@ -746,6 +941,11 @@
      *  the ColorPicker control.
      *
      *  @helpid 4922
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     mx_internal function get dropdown():SwatchPanel
     {
@@ -758,6 +958,11 @@

     /**
      *  Storage for the labelField property.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     private var _labelField:String = "label";

@@ -775,6 +980,11 @@
      *
      *  @default "label"
      *  @helpid 4928
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get labelField():String
     {
@@ -818,6 +1028,11 @@
      *  the item at index 0 of the data provider.
      *
      *  @helpid 4932
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get selectedColor():uint
     {
@@ -870,6 +1085,11 @@
      *  label or hexadecimal color value.
      *
      *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get showTextField():Boolean
     {
@@ -895,6 +1115,11 @@
      *  Set of styles to pass from the ColorPicker through to the preview swatch.
      *  @see mx.styles.StyleProxy
      *  @review
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     protected function get swatchStyleFilters():Object
     {
@@ -1065,6 +1290,11 @@
      *  that shows colors that users can select.
      *
      *  @helpid 4925
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function open():void
     {
@@ -1075,6 +1305,11 @@
      *  Hides the drop-down SwatchPanel object.
      *
      *  @helpid 4926
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function close(trigger:Event = null):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 15066
Author:   cframpto@adobe.com
Date:     2010-03-26T13:15:27.024240Z

Log Message:
-----------
Merge performance change 15065 from 4.x to trunk.  SDK-25810.

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

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

--- frameworks/projects/spark/src/mx/core/FTETextField.as
+++ frameworks/projects/spark/src/mx/core/FTETextField.as
@@ -2898,6 +2898,9 @@
 		var nextY:int = paragraphY;
 		var textLine:TextLine;

+        const thisLeftMargin:Number = leftMargin;
+        const thisRightMargin:Number = rightMargin;
+
         // TextField seems to do this.  You can see it with wordWrap and
         // indent > width or when rightMargin > width.  In the former case,
         // the first line is visually empty but contains a character which is
@@ -2915,7 +2918,7 @@
             // Adjust the compose width for indents and margins.
             if (n <= 1)
             {
-                var totalIndent:Number = blockIndent + leftMargin;
+                var totalIndent:Number = blockIndent + thisLeftMargin;
                 if (n == 0)
                     totalIndent += indent;

@@ -2928,7 +2931,7 @@
                     maxLineWidthBeforeIndent - totalIndent;

                 if (wordWrap)
-                    maxLineWidthBeforeIndent -= rightMargin;
+                    maxLineWidthBeforeIndent -= thisRightMargin;

                 // Stay within the bounds to avoid exception.  Since
                 // fitSomething is true it is okay if maxLineWidth is < 0.
@@ -3043,6 +3046,8 @@
 		var leftOffset:Number = PADDING_LEFT;
 		var centerOffset:Number = leftOffset + innerWidth / 2;
 		var rightOffset:Number = leftOffset + innerWidth;
+
+        const thisRightMargin:Number = rightMargin;

         // Reposition each line if necessary.
         // based on the horizontal alignment,
@@ -3054,7 +3059,7 @@

             _textWidth = Math.max(_textWidth, textLine.textWidth);

-            var width:Number = textLine.x + textLine.textWidth + rightMargin;
+            var width:Number = textLine.x + textLine.textWidth + thisRightMargin;

             // Only align if there is width to do so.
             if (leftAligned || (width >= innerWidth && direction == "ltr"))