上传前保存个版本

上传前保存个版本

--- Dont_Tap_The_White_Tile/dont_tap_the_white_tile.as
+++ Dont_Tap_The_White_Tile/dont_tap_the_white_tile.as
@@ -7,6 +7,30 @@
 var GAME_PLAYING = 1;
 var GAME_OVER = 2;
 var KEYSETTING = 3;
+
+var KEYMAP = {
+	34: "PAGE DOWN",
+	35: "END",
+	36: "HOME",
+	37: "←",
+	38: "↑",
+	39:	"→",
+	40: "↓",
+	65: "A",
+	68: "D",
+	83:	"S",
+	87: "W",
+	96: "小键盘 0",
+	97: "小键盘 1",
+	98: "小键盘 2",
+	99: "小键盘 3",
+	100: "小键盘 4",
+	101: "小键盘 5",
+	102: "小键盘 6",
+	103: "小键盘 7",
+	104: "小键盘 8",
+	105: "小键盘 9"
+};

 var gameManager;

@@ -84,13 +108,13 @@
 	});
 	view.tBoardShow = Tween.to(view.gameOverBoard, {alpha: 1}, 0.5);
 	view.tBoardHide = Tween.to(view.gameOverBoard, {alpha: 0}, 0.3);
-	view.boardBackgroud = $.createShape({
+	var boardBackgroud = $.createShape({
 		lifeTime: 0,
 		x: 0,
 		y: 0,
 		parent: view.gameOverBoard
 	});
-	var g = view.boardBackgroud.graphics;
+	var g = boardBackgroud.graphics;
 	g.beginFill(0xffffff);
 	g.lineStyle(1, 0x000000,1,true);
 	g.drawRoundRect(0,0,250,200,20,20);
@@ -120,6 +144,82 @@
 		},
 		parent: view.gameOverBoard
 	});
+
+	//改键区域
+	view.keymapCanvas = $.createCanvas({
+		lifeTime: 0,
+		parent: view.canvas
+	});
+	view.keymapBackground = $.createShape({
+		lifeTime: 0,
+		x: 0,
+		y: 0,
+		parent: view.keymapCanvas
+	});
+	var g = view.keymapBackground.graphics;
+	g.beginFill(0xffffff);
+	g.lineStyle(1, 0x000000,1,true);
+	g.drawRoundRect(0,0,128,250,20,20);
+	g.endFill();
+	$.createComment("改键区域",{
+		lifeTime: 0,
+		x: 8,
+		y: 8,
+		parent: view.keymapCanvas
+	});
+	view.kmButton = [];
+	var key = ($G._get("keySet"))[0];
+	var button = $.createButton({
+		x: 16,
+		y: 58,
+		width: 96,
+		lifeTime: 0,
+		text: "1: " + KEYMAP[key],
+		onclick: function(){
+			manager.keySets(0);
+		},
+		parent: view.keymapCanvas
+	});
+	view.kmButton.push(button);
+	key = ($G._get("keySet"))[1];
+	button = $.createButton({
+		x: 16,
+		y: 108,
+		width: 96,
+		lifeTime: 0,
+		text: "2: " + KEYMAP[key],
+		onclick: function(){
+			manager.keySets(1);
+		},
+		parent: view.keymapCanvas
+	});
+	view.kmButton.push(button);
+	key = ($G._get("keySet"))[2];
+	button = $.createButton({
+		x: 16,
+		y: 158,
+		width: 96,
+		lifeTime: 0,
+		text: "3: " + KEYMAP[key],
+		onclick: function(){
+			manager.keySets(2);
+		},
+		parent: view.keymapCanvas
+	});
+	view.kmButton.push(button);
+	key = ($G._get("keySet"))[3];
+	button = $.createButton({
+		x: 16,
+		y: 208,
+		width: 96,
+		lifeTime: 0,
+		text: "4: " + KEYMAP[key],
+		onclick: function(){
+			manager.keySets(3);
+		},
+		parent: view.keymapCanvas
+	});
+	view.kmButton.push(button);

 	//method
 	/**移动函数
@@ -154,7 +254,7 @@
 	};

 	view.gameOver = function(isWin, param){
-		trace("view.gameOver :[isWin: "+ isWin + ", param: "+param+"]");
+//		trace("view.gameOver :[isWin: "+ isWin + ", param: "+param+"]");
 		if(isWin){
 			this.scoreTitle.text = "本次时间: " + param.time;
 			this.bestscoreTitle.text = "最佳时间: "+param.bestTime;
@@ -165,7 +265,7 @@
 			this.bestscoreTitle.text = "最佳时间: "+param.bestTime;

 			(Tween.delay(this.tBoardShow ,1.2)).play();
-			trace("board show");
+//			trace("board show");
 		}
 	};

@@ -242,6 +342,9 @@
 		g.beginFill(0xff0000);
 		g.drawRect(1,1,this.blockWidth - 2, this.blockHeight - 2);
 		g.endFill();
+		//调整改键区位置
+		this.keymapCanvas.x = $.width - 158;
+		this.keymapCanvas.y = 100;
 	};

 	return view;
@@ -272,6 +375,10 @@
     manager.timer.stop();
     //计数器 50个结束游戏
     manager.blockCounter = 0;
+    //状态缓冲 用来改键后返回原来的状态
+    manager.flagCache;
+    //音效
+    manager.sound;

     //method
     //init
@@ -307,9 +414,10 @@

     manager.gameStart = function(){
     	trace("call gameStart");
-    	manager.timeStamp = Player.time;
-    	manager.timer.start();
-    	manager.keySet = $G._get("keySet");
+    	this.timeStamp = Player.time;
+    	this.timer.start();
+    	this.keySet = $G._get("keySet");
+    	this.sound = $G._("_gal_sound_over");
     	this.gameFlag = GAME_PLAYING;
     };

@@ -338,6 +446,7 @@

     manager.linePress = function(n){
     	//trace("call linePress");
+    	Player.play();
     	var line = this.keySet.indexOf(n);
     	if(this.grid[1][line] == BLOCK_BLACK){
     		this.moveOn(line);
@@ -348,13 +457,21 @@

     manager.moveOn = function(i){
     	//trace("call manager.moveOn("+i+")");
+    	if(this.sound){
+    		this.sound.play();
+    	}
+
     	this.blockCounter ++;
     	if(this.blockCounter >= 50){
     		this.gameOver(true);
     		return;
     	}
     	this.grid.shift();
-    	this.grid.push(this._getRandomRow());
+    	if(this.blockCounter >= 48){
+    		this.grid.push([-1,-1,-1,-1]);
+    	}else{
+    		this.grid.push(this._getRandomRow());
+		}

     	//点过的砖块变色
     	//this.grid[0][i] = BLOCK_CLICKED;
@@ -363,15 +480,51 @@

     };

+    //游戏过程中不允许改键
+    manager.keySets = function(index){
+    	if(this.gameFlag == GAME_PLAYING || this.gameFlag == KEYSETTING){
+    		return;
+    	}
+    	this.flagCache = this.gameFlag;
+    	this.gameFlag = KEYSETTING;
+    	this.gameView.kmButton[index].text = (index+1) + ": 按下设置";
+    	this.ksIndex = index;
+    };
+
+    //改变按键 检查冲突
+    manager.keyChange = function(key){
+trace("chang index: "+this.ksIndex+" to key: "+key);
+    	var ks = $G._get("keySet");
+    	var index = this.ksIndex;
+    	var k = ks[index];
+//trace("ks:"+ks+" k:"+k);
+    	if(ks.indexOf(key) != -1 || key == 37 || key == 38 || key == 39 || key == 40){
+    		this.gameView.kmButton[index].text = (index+1) + ": " + KEYMAP[k];
+    	}else{
+
+    		ks[index] = key;
+    		$G._set("keySet",ks);
+    		trace("#6 "+ this.ksIndex +":"+ this.gameView.kmButton[index]);
+
+    		this.gameView.kmButton[index].text = (index+1) + ": " + KEYMAP[key];
+    	}
+
+    	//恢复状态
+    	this.gameFlag = this.flagCache;
+    };
+
     manager._keyTrigger = function(key){
     	trace("you press key "+key);
-    	//trace("this.gameFlag: "+manager.gameFlag);
+    	trace("this.gameFlag: "+manager.gameFlag);
     	switch(manager.gameFlag){
     		case GAME_IDLE:
     			manager.gameStart();
-
     		case GAME_PLAYING:
     			manager.linePress(key);
+    			break;
+
+    		case KEYSETTING:
+    			manager.keyChange(key);
     			break;
     	}
     };
@@ -385,6 +538,10 @@
 	if($G._get("keySet") == undefined){
 		$G._set("keySet",[83,68,35,36]);
 	}
+
+	var _gal_sound = Player.createSound("btnover",function(){
+		$G._set("_gal_sound_over",_gal_sound);
+	});

 	var gameManager = newManager();
 	trace("#1");
@@ -395,6 +552,6 @@
 main();

 //todo
-//声音
-//按键设置
+//声音
+//按键设置 ok
 //鼠标点击


Issue #69: Include Finnish locale SWF when upgrading apps.

--- src/com/esri/builder/controllers/AppUpgradeController.as
+++ src/com/esri/builder/controllers/AppUpgradeController.as
@@ -88,7 +88,7 @@
         upgradeArbiter.addProcess(new BackupDirectoryProcess(viewerAppDirectory, backupDirectory));
         upgradeArbiter.addProcess(new RemoveRootFilesByExtensionProcess(backupDirectory, "swz"));
         upgradeArbiter.addProcess(new CopyRootFilesProcess(bundledViewerDirectory, backupDirectory, rootFileNames));
-        upgradeArbiter.addProcess(new CopyRootFilesProcess(bundledLocalesDirectory, backupLocalesDirectory, localeFileNames));
+        upgradeArbiter.addProcess(new CopyRootFilesProcess(bundledLocalesDirectory, backupLocalesDirectory, localeFileNames, false));
         upgradeArbiter.addProcess(new UpdateWebPageFilesProcess(bundledViewerDirectory, backupDirectory, new XMLFileReader(new FileStream())));
         upgradeArbiter.addProcess(new CopyWidgetsProcess(bundledViewerDirectory, backupDirectory));
         upgradeArbiter.addProcess(new CopyCustomWidgetsProcess(customViewerDirectory, backupDirectory));
@@ -140,6 +140,7 @@
                  "en_US.swf",
                  "es_ES.swf",
                  "et_EE.swf",
+                 "fi_FI.swf",
                  "fr_FR.swf",
                  "he_IL.swf",
                  "it_IT.swf",


I'd liked to get rid of heavy Flex classes in favor of those found in the flash package. These changes are just cosmetics.

--- src/org/igniterealtime/xiff/core/XMPPBOSHConnection.as
+++ src/org/igniterealtime/xiff/core/XMPPBOSHConnection.as
@@ -7,253 +7,350 @@
 	import flash.utils.Timer;
 	import flash.xml.XMLDocument;
 	import flash.xml.XMLNode;
-
+
 	import mx.logging.ILogger;
 	import mx.rpc.events.FaultEvent;
 	import mx.rpc.events.ResultEvent;
 	import mx.rpc.http.HTTPService;
-
-	import org.igniterealtime.xiff.events.ConnectionSuccessEvent;
-	import org.igniterealtime.xiff.events.DisconnectionEvent;
-	import org.igniterealtime.xiff.events.IncomingDataEvent;
-	import org.igniterealtime.xiff.events.LoginEvent;
-	import org.igniterealtime.xiff.events.OutgoingDataEvent;
+
+	import org.igniterealtime.xiff.events.*;
 	import org.igniterealtime.xiff.logging.LoggerFactory;
 	import org.igniterealtime.xiff.util.Callback;
-
+
 	/**
 	 * Bidirectional-streams Over Synchronous HTTP (BOSH)
 	 * @see http://xmpp.org/extensions/xep-0206.html
 	 */
 	public class XMPPBOSHConnection extends XMPPConnection
 	{
-		private static const logger:ILogger = LoggerFactory.getLogger("org.igniterealtime.xiff.core.XMPPBOSHConnection");
-
+		private static const BOSH_VERSION:String = "1.6";
+
+		private static const HTTPS_PORT:int = 7443;
+
 		private static const HTTP_PORT:int = 7070;
-		private static const HTTPS_PORT:int = 7443;
-		private static const BOSH_VERSION:String = "1.6";
-
+
 		private static const headers:Object = {
 			"post": [],
-			"get": ['Cache-Control', 'no-store', 'Cache-Control', 'no-cache', 'Pragma', 'no-cache']
+			"get": [ 'Cache-Control',
+					 'no-store',
+					 'Cache-Control',
+					 'no-cache',
+					 'Pragma', 'no-cache' ]
 		};
-
-		private const responseTimer:Timer = new Timer(0.0, 1);
-
+
+		private static const logger:ILogger = LoggerFactory.getLogger( "org.igniterealtime.xiff.core.XMPPBOSHConnection" );
+
+		private var _boshPath:String = "http-bind/";
+
+		private var _hold:uint = 1;
+
+		private var _maxConcurrentRequests:uint = 2;
+
+		private var _port:Number;
+
+		private var _secure:Boolean;
+
+		private var _wait:uint = 20;
+
+		private var boshPollingInterval:uint = 10000;
+
+		private var inactivity:uint;
+
+		private var isDisconnecting:Boolean = false;
+
+		private var lastPollTime:Date = null;
+
+		private var maxPause:uint;
+
+		private var pauseEnabled:Boolean = false;
+
+		private var pauseTimer:Timer;
+
+		private var pollingEnabled:Boolean = false;
+
 		private var requestCount:int = 0;
+
 		private var requestQueue:Array = [];
+
 		private var responseQueue:Array = [];
-		private var isDisconnecting:Boolean = false;
+
+		private const responseTimer:Timer = new Timer( 0.0, 1 );
+
+		private var rid:Number;
+
 		private var sid:String;
-		private var rid:Number;
-
-		private var pollingEnabled:Boolean = false;
-		private var lastPollTime:Date = null;
-
-		private var inactivity:uint;
-		private var boshPollingInterval:uint = 10000;
-
-		private var pauseEnabled:Boolean = false;
-		private var maxPause:uint;
-		private var pauseTimer:Timer;
-
+
 		private var streamRestarted:Boolean;
-
-		// These attributes can be configured from outside after creating the instance
-		private var _secure:Boolean;
-		private var _port:Number;
-		private var _maxConcurrentRequests:uint;
-		private var _hold:uint;
-		private var _wait:uint;
-		private var _boshPath:String;
-
+
 		/**
 		 *
 		 * @param	secure
 		 */
-		public function XMPPBOSHConnection(secure:Boolean = false):void
+		public function XMPPBOSHConnection( secure:Boolean = false ):void
 		{
 			super();
 			this.secure = secure;
-			this.hold = 1;
-			this.wait = 20;
-			this.maxConcurrentRequests = 2;
-			this.boshPollingInterval = 10000;
-			this.boshPath = "http-bind/";
-		}
-
-		public override function connect(streamType:String=null):Boolean
-		{
-			logger.debug("BOSH connect()");
-
+		}
+
+		override public function connect( streamType:String = null ):Boolean
+		{
+			logger.debug( "BOSH connect()" );
+
 			var attrs:Object = {
 				"xml:lang": "en",
-	            "xmlns": "http://jabber.org/protocol/httpbind",
-	            "xmlns:xmpp": "urn:xmpp:xbosh",
-	            "xmpp:version": "1.0",
-	            "hold": hold,
-	            "rid": nextRID,
-	            "secure": secure,
-	            "wait": wait,
-	            "ver": BOSH_VERSION,
-	            "to": domain
-	        }
-
-	        var result:XMLNode = new XMLNode(1, "body");
-	        result.attributes = attrs;
-	        sendRequests(result);
-
-	        return true;
-		}
-
-		public function set maxConcurrentRequests(value:uint):void
-		{
-			_maxConcurrentRequests = value;
-		}
-
-		public function get maxConcurrentRequests():uint
-		{
-			return _maxConcurrentRequests;
-		}
-
-		public function set hold(value:uint):void
-		{
-			_hold = value;
-		}
-
-		public function get hold():uint
-		{
-			return _hold;
-		}
-
-		public function set wait(value:uint):void
-		{
-			_wait = value;
-		}
-
-		public function get wait():uint
-		{
-			return _wait;
-		}
-
-		public function set secure(flag:Boolean):void
-		{
-			logger.debug("set secure: {0}", flag);
-			_secure = flag;
-			port = _secure ? HTTPS_PORT : HTTP_PORT;
-		}
-
-		public function get secure():Boolean
-		{
-			return _secure;
-		}
-
-		public override function set port(portnum:Number):void
-		{
-			logger.debug("set port: {0}", portnum);
-			_port = portnum;
-		}
-
-		public override function get port():Number
-		{
-			return _port;
-		}
-
-		public function set boshPath(value:String):void
-		{
-			_boshPath = value;
-		}
-
-		public function get boshPath():String
-		{
-			return _boshPath;
-		}
-
-		public function get httpServer():String
-		{
-			return (secure ? "https" : "http") + "://" + server + ":" + port + "/" + boshPath;
-		}
-
-		public override function disconnect():void
-		{
-			if(active)
+				"xmlns": "http://jabber.org/protocol/httpbind",
+				"xmlns:xmpp": "urn:xmpp:xbosh",
+				"xmpp:version": "1.0",
+				"hold": hold,
+				"rid": nextRID,
+				"secure": secure,
+				"wait": wait,
+				"ver": BOSH_VERSION,
+				"to": domain
+			};
+
+			var result:XMLNode = new XMLNode( 1, "body" );
+			result.attributes = attrs;
+			sendRequests( result );
+
+			return true;
+		}
+
+		override public function disconnect():void
+		{
+			if ( active )
 			{
 				var data:XMLNode = createRequest();
 				data.attributes.type = "terminate";
-				sendRequests(data);
+				sendRequests( data );
 				active = false;
 				loggedIn = false;
-				dispatchEvent(new DisconnectionEvent());
-			}
-		}
-
-		public function processConnectionResponse(responseBody:XMLNode):void
-		{
-			dispatchEvent(new ConnectionSuccessEvent());
-
+				dispatchEvent( new DisconnectionEvent());
+			}
+		}
+
+		/**
+		 * @return	true if pause request is sent
+		 */
+		public function pauseSession( seconds:uint ):Boolean
+		{
+			logger.debug( "Pausing session for {0} seconds", seconds );
+
+			var pauseDuration:uint = seconds * 1000;
+			if ( !pauseEnabled || pauseDuration > maxPause || pauseDuration <= boshPollingInterval )
+				return false;
+
+			pollingEnabled = false;
+
+			var data:XMLNode = createRequest();
+			data.attributes[ "pause" ] = seconds;
+			sendRequests( data );
+
+			pauseTimer = new Timer( pauseDuration - 2000, 1 );
+			pauseTimer.addEventListener( TimerEvent.TIMER, handlePauseTimeout );
+			pauseTimer.start();
+
+			return true;
+		}
+
+		public function processConnectionResponse( responseBody:XMLNode ):void
+		{
+			dispatchEvent( new ConnectionSuccessEvent());
+
 			var attributes:Object = responseBody.attributes;
-
+
 			sid = attributes.sid;
-	        wait = attributes.wait;
-
-	        if(attributes.polling)
-	        {
-	        	boshPollingInterval = attributes.polling * 1000;
-	        }
-	        if(attributes.inactivity)
-	        {
-	        	inactivity = attributes.inactivity * 1000;
-	        }
-	        if(attributes.maxpause)
-	        {
-	            maxPause = attributes.maxpause * 1000;
-	            pauseEnabled = true;
-	        }
-	        if(attributes.requests)
-	        {
-	            maxConcurrentRequests = attributes.requests;
-	        }
-
-	        logger.debug("Polling interval: {0}", boshPollingInterval);
-	        logger.debug("Inactivity timeout: {0}", inactivity);
-	        logger.debug("Max requests: {0}", maxConcurrentRequests);
-	        logger.debug("Max pause: {0}", maxPause);
-
-	        active = true;
-
-	        addEventListener(LoginEvent.LOGIN, handleLogin);
-	        responseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, processResponse);
-		}
-
-		private function processResponse(event:TimerEvent=null):void
+			wait = attributes.wait;
+
+			if ( attributes.polling )
+			{
+				boshPollingInterval = attributes.polling * 1000;
+			}
+			if ( attributes.inactivity )
+			{
+				inactivity = attributes.inactivity * 1000;
+			}
+			if ( attributes.maxpause )
+			{
+				maxPause = attributes.maxpause * 1000;
+				pauseEnabled = true;
+			}
+			if ( attributes.requests )
+			{
+				maxConcurrentRequests = attributes.requests;
+			}
+
+			logger.debug( "Polling interval: {0}", boshPollingInterval );
+			logger.debug( "Inactivity timeout: {0}", inactivity );
+			logger.debug( "Max requests: {0}", maxConcurrentRequests );
+			logger.debug( "Max pause: {0}", maxPause );
+
+			active = true;
+
+			addEventListener( LoginEvent.LOGIN, handleLogin );
+			responseTimer.addEventListener( TimerEvent.TIMER_COMPLETE, processResponse );
+		}
+
+		//do nothing, we use polling instead
+		override public function sendKeepAlive():void
+		{
+		}
+
+		override protected function restartStream():void
+		{
+			var data:XMLNode = createRequest();
+			data.attributes[ "xmpp:restart" ] = "true";
+			data.attributes[ "xmlns:xmpp" ] = "urn:xmpp:xbosh";
+			data.attributes[ "xml:lang" ] = "en";
+			data.attributes[ "to" ] = domain;
+			sendRequests( data );
+			streamRestarted = true;
+		}
+
+		override protected function sendXML( body:* ):void
+		{
+			sendQueuedRequests( body );
+		}
+
+		private function createRequest( bodyContent:Array = null ):XMLNode
+		{
+			var attrs:Object = {
+				"xmlns": "http://jabber.org/protocol/httpbind",
+				"rid": nextRID,
+				"sid": sid
+			};
+			var req:XMLNode = new XMLNode( 1, "body" );
+			if ( bodyContent )
+			{
+				for each ( var content:XMLNode in bodyContent )
+				{
+					req.appendChild( content );
+				}
+			}
+
+			req.attributes = attrs;
+
+			return req;
+		}
+
+		private function handleLogin( e:LoginEvent ):void
+		{
+			pollingEnabled = true;
+			pollServer();
+		}
+
+		private function handlePauseTimeout( event:TimerEvent ):void
+		{
+			logger.debug( "handlePauseTimeout" );
+			pollingEnabled = true;
+			pollServer();
+		}
+
+		private function httpError( req:XMLNode, isPollResponse:Boolean, event:FaultEvent ):void
+		{
+			disconnect();
+			dispatchError( "Unknown HTTP Error", event.fault.rootCause.text, "",
+						   -1 );
+		}
+
+		private function httpResponse( req:XMLNode, isPollResponse:Boolean, event:ResultEvent ):void
+		{
+			requestCount--;
+			var rawXML:String = event.result as String;
+
+			logger.info( "INCOMING {0}", rawXML );
+
+			var xmlData:XMLDocument = new XMLDocument();
+			xmlData.ignoreWhite = this.ignoreWhite;
+			xmlData.parseXML( rawXML );
+			var bodyNode:XMLNode = xmlData.firstChild;
+
+			var incomingEvent:IncomingDataEvent = new IncomingDataEvent();
+			incomingEvent.data = xmlData;
+			dispatchEvent( incomingEvent );
+
+			if ( streamRestarted && !bodyNode.hasChildNodes())
+			{
+				streamRestarted = false;
+				bindConnection();
+			}
+
+			if ( bodyNode.attributes[ "type" ] == "terminate" )
+			{
+				dispatchError( "BOSH Error", bodyNode.attributes[ "condition" ],
+							   "", -1 );
+				active = false;
+			}
+
+			if ( bodyNode.attributes[ "sid" ] && !loggedIn )
+			{
+				processConnectionResponse( bodyNode );
+
+				var featuresFound:Boolean = false;
+				for each ( var child:XMLNode in bodyNode.childNodes )
+				{
+					if ( child.nodeName == "stream:features" )
+						featuresFound = true;
+				}
+				if ( !featuresFound )
+				{
+					pollingEnabled = true;
+					pollServer();
+				}
+			}
+
+			for each ( var childNode:XMLNode in bodyNode.childNodes )
+			{
+				responseQueue.push( childNode );
+			}
+
+			resetResponseProcessor();
+
+			//if we have no outstanding requests, then we're free to send a poll at the next opportunity
+			if ( requestCount == 0 && !sendQueuedRequests())
+				pollServer();
+		}
+
+		private function pollServer():void
+		{
+			//We shouldn't poll if the connection is dead, if we had requests to send instead, or if there's already one in progress
+			if ( !isActive() || !pollingEnabled || sendQueuedRequests() || requestCount >
+				0 )
+				return;
+
+			//this should be safe since sendRequests checks to be sure it's not over the concurrent requests limit, and we just ensured that the queue is empty by calling sendQueuedRequests()
+			sendRequests( null, true );
+		}
+
+		private function processResponse( event:TimerEvent = null ):void
 		{
 			// Read the data and send it to the appropriate parser
 			var currentNode:XMLNode = responseQueue.shift();
 			var nodeName:String = currentNode.nodeName.toLowerCase();
-
-			switch( nodeName )
+
+			switch ( nodeName )
 			{
 				case "stream:features":
 					handleStreamFeatures( currentNode );
 					streamRestarted = false; //avoid triggering the old server workaround
 					break;
-
+
 				case "stream:error":
 					handleStreamError( currentNode );
 					break;
-
+
 				case "iq":
 					handleIQ( currentNode );
 					break;
-
+
 				case "message":
 					handleMessage( currentNode );
 					break;
-
+
 				case "presence":
 					handlePresence( currentNode );
 					break;
-
+
 				case "success":
 					handleAuthentication( currentNode );
 					break;
@@ -262,239 +359,167 @@
 					handleAuthentication( currentNode );
 					break;
 				default:
-					dispatchError( "undefined-condition", "Unknown Error", "modify", 500 );
-					break;
-			}
-
+					dispatchError( "undefined-condition", "Unknown Error", "modify",
+								   500 );
+					break;
+			}
+
 			resetResponseProcessor();
 		}
-
-	    protected override function restartStream():void
-	    {
-	    	var data:XMLNode = createRequest();
-			data.attributes["xmpp:restart"] = "true";
-			data.attributes["xmlns:xmpp"] = "urn:xmpp:xbosh";
-			data.attributes["xml:lang"] = "en";
-			data.attributes["to"] = domain;
-			sendRequests(data);
-	        streamRestarted = true;
-	    }
-
-	    /**
-	    * @return	true if pause request is sent
-	    */
-	    public function pauseSession(seconds:uint):Boolean
-	    {
-	    	logger.debug("Pausing session for {0} seconds", seconds);
-
-	    	var pauseDuration:uint = seconds * 1000;
-	    	if(!pauseEnabled || pauseDuration > maxPause || pauseDuration <= boshPollingInterval)
-	    		return false;
-
-	    	pollingEnabled = false;
-
-	    	var data:XMLNode = createRequest();
-			data.attributes["pause"] = seconds;
-			sendRequests(data);
-
-			pauseTimer = new Timer(pauseDuration - 2000, 1);
-			pauseTimer.addEventListener(TimerEvent.TIMER, handlePauseTimeout);
-			pauseTimer.start();
-
-			return true;
-	    }
-
-	    private function handlePauseTimeout(e:TimerEvent):void
-	    {
-	    	logger.debug("handlePauseTimeout");
-	    	pollingEnabled = true;
-	    	pollServer();
-	    }
-
+
 		private function resetResponseProcessor():void
 		{
-			if(responseQueue.length > 0)
+			if ( responseQueue.length > 0 )
 			{
 				responseTimer.reset();
 				responseTimer.start();
 			}
 		}

-		private function httpResponse(req:XMLNode, isPollResponse:Boolean, event:ResultEvent):void
-		{
-			requestCount--;
-			var rawXML:String = event.result as String;
-
-			logger.info("INCOMING {0}", rawXML);
-
-			var xmlData:XMLDocument = new XMLDocument();
-			xmlData.ignoreWhite = this.ignoreWhite;
-			xmlData.parseXML(rawXML);
-			var bodyNode:XMLNode = xmlData.firstChild;
-
-			var incomingEvent:IncomingDataEvent = new IncomingDataEvent();
-			incomingEvent.data = xmlData;
-			dispatchEvent(incomingEvent);
-
-			if (streamRestarted && !bodyNode.hasChildNodes())
-			{
-				streamRestarted = false;
-				bindConnection();
-			}
-
-			if(bodyNode.attributes["type"] == "terminate")
-			{
-				dispatchError("BOSH Error", bodyNode.attributes["condition"], "", -1);
-				active = false;
-			}
-
-			if(bodyNode.attributes["sid"] && !loggedIn)
-			{
-				processConnectionResponse(bodyNode);
-
-				var featuresFound:Boolean = false;
-				for each(var child:XMLNode in bodyNode.childNodes)
-				{
-					if(child.nodeName == "stream:features")
-						featuresFound = true;
-				}
-				if(!featuresFound)
-				{
-					pollingEnabled = true;
-	    			pollServer();
-				}
-			}
-
-			for each(var childNode:XMLNode in bodyNode.childNodes)
-			{
-				responseQueue.push(childNode);
-			}
-
-			resetResponseProcessor();
-
-			//if we have no outstanding requests, then we're free to send a poll at the next opportunity
-			if(requestCount == 0 && !sendQueuedRequests())
-				pollServer();
-		}
-
-		private function httpError(req:XMLNode, isPollResponse:Boolean, event:FaultEvent):void
-		{
-			disconnect();
-			dispatchError("Unknown HTTP Error", event.fault.rootCause.text, "", -1);
-		}
-
-		protected override function sendXML(body:*):void
-		{
-			sendQueuedRequests(body);
-		}
-
-		private function sendQueuedRequests(body:*=null):Boolean
-		{
-			if(body)
-				requestQueue.push(body);
-			else if(requestQueue.length == 0)
+		private function sendQueuedRequests( body:* = null ):Boolean
+		{
+			if ( body )
+			{
+				requestQueue.push( body );
+			}
+			else if ( requestQueue.length == 0 )
+			{
 				return false;
-
+			}
+
 			return sendRequests();
 		}
-
+
 		//returns true if any requests were sent
-		private function sendRequests(data:XMLNode = null, isPoll:Boolean = false):Boolean
-		{
-			if(requestCount >= maxConcurrentRequests)
+		private function sendRequests( data:XMLNode = null, isPoll:Boolean = false ):Boolean
+		{
+			if ( requestCount >= maxConcurrentRequests )
+			{
 				return false;
-
+			}
+
 			requestCount++;
-
-			if(!data)
-			{
-				if(isPoll)
+
+			if ( !data )
+			{
+				if ( isPoll )
 				{
 					data = createRequest();
 				}
 				else
 				{
 					var temp:Array = [];
-					for(var i:uint = 0; i < 10 && requestQueue.length > 0; ++i)
+					for ( var i:uint = 0; i < 10 && requestQueue.length > 0; ++i )
 					{
-						temp.push(requestQueue.shift());
+						temp.push( requestQueue.shift());
 					}
-					data = createRequest(temp);
+					data = createRequest( temp );
 				}
 			}

+			// TODO: Could this be replaced with URLLoader ?
 			//build the http request
-	        var request:HTTPService = new HTTPService();
-	        request.method = "post";
-	        request.headers = headers[request.method];
-	        request.url = httpServer;
-	        request.resultFormat = HTTPService.RESULT_FORMAT_TEXT;
-	        request.contentType = "text/xml";
-
-	        var responseCallback:Callback = new Callback(this, httpResponse, data, isPoll);
-	        var errorCallback:Callback = new Callback(this, httpError, data, isPoll);
-
-	        request.addEventListener(ResultEvent.RESULT, responseCallback.call, false);
-	        request.addEventListener(FaultEvent.FAULT, errorCallback.call, false);
-
-			request.send(data);
-
+			var request:HTTPService = new HTTPService();
+			request.method = "post";
+			request.headers = headers[ request.method ];
+			request.url = httpServer;
+			request.resultFormat = HTTPService.RESULT_FORMAT_TEXT;
+			request.contentType = "text/xml";
+
+			var responseCallback:Callback = new Callback( this, httpResponse, data,
+														  isPoll );
+			var errorCallback:Callback = new Callback( this, httpError, data, isPoll );
+
+			request.addEventListener( ResultEvent.RESULT, responseCallback.call,
+									  false );
+			request.addEventListener( FaultEvent.FAULT, errorCallback.call, false );
+
+			request.send( data );
+
+
 			var event:OutgoingDataEvent = new OutgoingDataEvent();
 			event.data = data;
-			dispatchEvent(event);
-
-			if(isPoll) {
+			dispatchEvent( event );
+
+			if ( isPoll )
+			{
 				lastPollTime = new Date();
-				logger.info("Polling");
-			}
-
-			logger.info("OUTGOING {0}", data);
-
+				logger.info( "Polling" );
+			}
+
+			logger.info( "OUTGOING {0}", data );
+
 			return true;
 		}

-    	private function pollServer():void
-    	{
-    		//We shouldn't poll if the connection is dead, if we had requests to send instead, or if there's already one in progress
-    		if(!isActive() || !pollingEnabled || sendQueuedRequests() || requestCount > 0)
-    			return;
-
-    		//this should be safe since sendRequests checks to be sure it's not over the concurrent requests limit, and we just ensured that the queue is empty by calling sendQueuedRequests()
-    		sendRequests(null, true);
-    	}
-
-    	private function get nextRID():Number
-    	{
-    		if(!rid)
-    			rid = Math.floor(Math.random() * 1000000);
-    		return ++rid;
-    	}
-
-    	private function createRequest(bodyContent:Array=null):XMLNode
-    	{
-    		var attrs:Object = {
-    			"xmlns": "http://jabber.org/protocol/httpbind",
-				"rid": nextRID,
-				"sid": sid
-    		}
-    		var req:XMLNode = new XMLNode(1, "body");
-    		if(bodyContent)
-    			for each(var content:XMLNode in bodyContent)
-    					req.appendChild(content);
-
-    		req.attributes = attrs;
-
-    		return req;
-    	}
-
-	    private function handleLogin(e:LoginEvent):void
-	    {
-	    	pollingEnabled = true;
-	    	pollServer();
-	    }
-
-		//do nothing, we use polling instead
-		public override function sendKeepAlive():void
-		{}
+		public function get boshPath():String
+		{
+			return _boshPath;
+		}
+		public function set boshPath( value:String ):void
+		{
+			_boshPath = value;
+		}
+
+		private function get nextRID():Number
+		{
+			if ( !rid )
+				rid = Math.floor( Math.random() * 1000000 );
+			return ++rid;
+		}
+
+		public function get wait():uint
+		{
+			return _wait;
+		}
+		public function set wait( value:uint ):void
+		{
+			_wait = value;
+		}
+
+		public function get secure():Boolean
+		{
+			return _secure;
+		}
+		public function set secure( flag:Boolean ):void
+		{
+			logger.debug( "set secure: {0}", flag );
+			_secure = flag;
+			port = _secure ? HTTPS_PORT : HTTP_PORT;
+		}
+
+		override public function get port():Number
+		{
+			return _port;
+		}
+		override public function set port( portnum:Number ):void
+		{
+			logger.debug( "set port: {0}", portnum );
+			_port = portnum;
+		}
+
+		public function get hold():uint
+		{
+			return _hold;
+		}
+		public function set hold( value:uint ):void
+		{
+			_hold = value;
+		}
+
+		public function get httpServer():String
+		{
+			return ( secure ? "https" : "http" ) + "://" + server + ":" + port +
+				"/" + boshPath;
+		}
+
+		public function get maxConcurrentRequests():uint
+		{
+			return _maxConcurrentRequests;
+		}
+		public function set maxConcurrentRequests( value:uint ):void
+		{
+			_maxConcurrentRequests = value;
+		}
 	}
 }


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@1284220 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/supportClasses/AnimateFilterInstance.as
+++ frameworks/projects/spark/src/spark/effects/supportClasses/AnimateFilterInstance.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

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

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

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

--- frameworks/projects/spark/src/spark/styles/metadata/AdvancedInheritingTextStyles.as
+++ frameworks/projects/spark/src/spark/styles/metadata/AdvancedInheritingTextStyles.as
@@ -1,29 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- *  Specifies a vertical or horizontal progression of line placement.
- *
- *
For the Spark theme, see
- *  flashx.textLayout.formats.ITextLayoutFormat.blockProgression.

- *
- *
For the Mobile theme, this is not supported.

- *
- *  @see flashx.textLayout.formats.ITextLayoutFormat#blockProgression
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
+
 [Style(name="blockProgression", type="String", enumeration="tb,rl", inherit="yes")]

 /**


DataGrid responds to changes in size.

DataGrid responds to changes in size.

--- frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as
+++ frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DataGridView.as
@@ -36,6 +36,7 @@
     import org.apache.flex.html.beads.models.ArraySelectionModel;
     import org.apache.flex.html.beads.models.DataGridPresentationModel;
     import org.apache.flex.html.supportClasses.DataGridColumn;
+	import org.apache.flex.html.supportClasses.Viewport;

 	/**
 	 *  The DataGridView class is the visual bead for the org.apache.flex.html.DataGrid.
@@ -95,6 +96,10 @@
 			_strand = value;
 			super.strand = value;

+			IEventDispatcher(_strand).addEventListener("sizeChanged", onSizeChanged);
+			IEventDispatcher(_strand).addEventListener("widthChanged", onSizeChanged);
+			IEventDispatcher(_strand).addEventListener("heightChanged", onSizeChanged);
+
 			// see if there is a presentation model already in place. if not, add one.
 			var modBead:IBead = _strand.getBeadByType(DataGridPresentationModel);
 			var presentationModel:DataGridPresentationModel;
@@ -123,6 +128,7 @@
 			buttonBar = new ButtonBar();
 			buttonBar.addBead(buttonBarModel);
 			buttonBar.addBead(bblayout);
+			buttonBar.addBead(new Viewport());
 			buttonBar.height = 25;
 			buttonBar.width = UIBase(_strand).width;
 			UIBase(_strand).addElement(buttonBar);
@@ -158,6 +164,12 @@
 			// TODO: allow a developer to specify their own DataGridLayout
 			// possibly by seeing if a bead already exists

+			onSizeChanged(null);
+			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+		}
+
+		private function onSizeChanged(event:Event):void
+		{
 			var bead:IBead = _strand.getBeadByType(IDataGridLayout);
 			var layout:IDataGridLayout;
 			if (bead == null) {
@@ -172,7 +184,6 @@
 			layout.header = buttonBar;
 			layout.columns = columns;
 			layout.layout();
-			IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as
+++ frameworks/projects/framework/src/mx/validators/NumberValidatorDomainType.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.validators
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/mx/src/mx/containers/accordionClasses/AccordionHeader.as
+++ frameworks/projects/mx/src/mx/containers/accordionClasses/AccordionHeader.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2003-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.containers.accordionClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

--- frameworks/projects/spark/src/spark/effects/interpolation/RGBInterpolator.as
+++ frameworks/projects/spark/src/spark/effects/interpolation/RGBInterpolator.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 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.effects.interpolation
 {
 /**


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

--- frameworks/projects/automation/src/mx/automation/events/AutomationRecordEvent.as
+++ frameworks/projects/automation/src/mx/automation/events/AutomationRecordEvent.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.automation.events
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 22778
Author:   aaltman@adobe.com
Date:     2011-09-28T18:45:04.194886Z

Log Message:
-----------
Adjusted visibility code to not try to do anything during a view transition.
Added call to commitStyles to captureBitmapData so bitmaps are captured with correct styles applied.
Added missing checks for alwaysShowProxyImage.
Removed proxy image in removedFromStageHandler.

QE notes: None
Doc notes: None
Bugs: SDK-31529 SDK-31668 SDK-31667
Reviewer: cframpto
Tests run: checkintests mustella-mobile
Is noteworthy for integration: No

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableStageText.as
@@ -56,6 +56,7 @@
 import mx.utils.MatrixUtil;

 import spark.components.Application;
+import spark.components.ViewNavigator;
 import spark.core.IEditableText;
 import spark.core.ISoftKeyboardHintClient;
 import spark.events.PopUpEvent;
@@ -506,7 +507,8 @@
      */
     private var stageTextVisibleChangePending:Boolean = false;
     private var stageTextVisible:Boolean;
-
+    private var viewChanging:Boolean = false;
+
     //--------------------------------------------------------------------------
     //
     //  Overridden properties
@@ -748,7 +750,7 @@
     //----------------------------------
     //  baselinePosition
     //----------------------------------
-
+
     /**
      *  @private
      */
@@ -1056,7 +1058,7 @@
     {
         return stageText ? stageText.selectionAnchorIndex : 0;
     }
-
+
     //----------------------------------
     //  text
     //----------------------------------
@@ -1287,14 +1289,14 @@
     //  Overridden methods
     //
     //--------------------------------------------------------------------------
-
+
     /**
      *  @private
      */
     override public function move(x:Number, y:Number):void
     {
         super.move(x, y);
-
+
         if (!localViewPort)
             localViewPort = new Rectangle();

@@ -1382,10 +1384,21 @@
     {
         super.commitProperties();

+        // DesignView may call validateNow before the path which normally
+        // creates the proxy bitmap. In that case, make sure the proxy bitmap
+        // gets created here.
+        var proxyCreated:Boolean = false;
+        if (alwaysShowProxyImage && !showTextImage)
+        {
+            createProxyImage();
+            proxyCreated = true;
+        }
+
         if (stageText != null)
             stageText.editable = _editable && effectiveEnabled;
-
-        commitVisible(false);
+
+        if (!proxyCreated)
+            commitVisible(false);

         if (invalidateViewPortFlag)
         {
@@ -1397,7 +1410,8 @@
             updateProxyImageForTopmostForm();
         }

-        updateProxyImage();
+        if (!proxyCreated)
+            updateProxyImage();
     }

     //--------------------------------------------------------------------------
@@ -1547,7 +1561,7 @@

         // Move the cursor to the end of the inserted text.
         stageText.selectRange(startIndex + text.length, startIndex + text.length);
-
+
         _text = stageText.text;

         // TODO: scrollToRange so the insertion point is visible
@@ -1656,7 +1670,7 @@
                 stageText.fontSize = fontSize * densityScale;
             else
                 stageText.fontSize = defaultStyles["fontSize"] * densityScale;
-
+
             var color:* = getStyle("color");

             if (color != undefined)
@@ -1691,6 +1705,10 @@

         if (stageText.viewPort.width == 0 || stageText.viewPort.height == 0)
             updateViewPort(); // The StageText viewport is stale.
+
+        // Make sure any pending style changes get saved before replacing
+        // the StageText with a bitmap
+        commitStyles();

         var bitmap:BitmapData = new BitmapData(stageText.viewPort.width,
             stageText.viewPort.height, true, 0x00FFFFFF);
@@ -1826,12 +1844,16 @@
      */
     private function updateProxyImageForForm(form:Object):void
     {
+        // If we are always showing proxy bitmaps, then there is nothing to do
+        // here.
+        if (alwaysShowProxyImage)
+            return;
+
         if (form && form.hasOwnProperty("focusManager"))
         {
             if (form.focusManager != focusManager)
                 createProxyImage();
-                // If alwaysShowProxyImage is set, don't dispose the image.
-            else if (!alwaysShowProxyImage)
+            else
                 disposeProxyImage();
         }
     }
@@ -1844,9 +1866,11 @@
      */
     private function updateProxyImageForTopmostForm(excludeForm:Object = null):void
     {
-        if (!awm)
+        // If there is no active window manager or we are always showing proxy
+        // bitmaps, then there is nothing to do here.
+        if (!awm || alwaysShowProxyImage)
             return;
-
+
         var form:Object = awm.form;

         if (!(form is DisplayObject) || isFormApplication(form as DisplayObject))
@@ -1871,7 +1895,7 @@
                 // parent is out of sync.  See SDK-31538.
                 var m:Matrix = MatrixUtil.getConcatenatedMatrix(parent, stage);
                 var globalTopLeft:Point = m.transformPoint(localViewPort.topLeft);
-
+
                 // Transform the bottom-right corner of the local rect
                 // instead of setting width/height to account for any
                 // transformations applied to ancestor objects.
@@ -1889,7 +1913,7 @@
                 {
                     if (stageText.viewPort.width != globalRect.width || stageText.viewPort.height != globalRect.height)
                         completeEventPending = true;
-
+
                     stageText.viewPort = globalRect;
                 }

@@ -1985,6 +2009,8 @@
                 ancestor.removeEventListener(FlexEvent.HIDE, ancestor_hideHandler);
                 ancestor.removeEventListener(PopUpEvent.CLOSE, ancestor_closeHandler);
                 ancestor.removeEventListener(PopUpEvent.OPEN, ancestor_openHandler);
+                ancestor.removeEventListener("viewChangeStart", ancestor_viewChangeStartHandler);
+                ancestor.removeEventListener("viewChangeComplete", ancestor_viewChangeCompleteHandler);
             }
         }

@@ -2004,6 +2030,16 @@
                     newAncestor.addEventListener(PopUpEvent.CLOSE, ancestor_closeHandler, false, 0, true);
                     newAncestor.addEventListener(PopUpEvent.OPEN, ancestor_openHandler, false, 0, true);
                 }
+
+                if (newAncestor is ViewNavigator)
+                {
+                    // If one of our ancestors is a ViewNavigator, we need to
+                    // make sure that the visibility of the StageText does not
+                    // change during a view transition.
+                    newAncestor.addEventListener("viewChangeStart", ancestor_viewChangeStartHandler);
+                    newAncestor.addEventListener("viewChangeComplete", ancestor_viewChangeCompleteHandler);
+                    viewChanging = (newAncestor as ViewNavigator).viewChanging;
+                }
             }
         }

@@ -2026,6 +2062,8 @@
             ancestor.removeEventListener(FlexEvent.HIDE, ancestor_hideHandler);
             ancestor.removeEventListener(PopUpEvent.CLOSE, ancestor_closeHandler);
             ancestor.removeEventListener(PopUpEvent.OPEN, ancestor_openHandler);
+            ancestor.removeEventListener("viewChangeStart", ancestor_viewChangeStartHandler);
+            ancestor.removeEventListener("viewChangeComplete", ancestor_viewChangeCompleteHandler);
         }
     }

@@ -2038,7 +2076,7 @@
             // change events would then copy that cleared text to the _text
             // storage variable, making the change permanent.
             stageText.editable = _editable && effectiveEnabled;
-
+
             // Restore the text and the selection.
             stageText.text = _text;
             stageText.selectRange(savedSelectionAnchorIndex, savedSelectionActiveIndex);
@@ -2157,6 +2195,19 @@
         invalidateProperties();
     }

+    private function ancestor_viewChangeStartHandler(event:Event):void
+    {
+        viewChanging = true;
+    }
+
+    private function ancestor_viewChangeCompleteHandler(event:Event):void
+    {
+        viewChanging = false;
+
+        if (stageTextVisibleChangePending)
+            enterFrameHandler(null);
+    }
+
     private function awm_activatedFormHandler(event:DynamicEvent):void
     {
         updateProxyImageForTopmostForm();
@@ -2193,11 +2244,11 @@
         {
             var oldText:String = _text;
             var newText:String = stageText.text;
-
+
             foundChange = newText != oldText;
             _text = stageText.text;
         }
-
+
         if (foundChange)
             dispatchEvent(new TextOperationEvent(event.type));
     }
@@ -2223,7 +2274,7 @@
     {
         if (focusedStageText == stageText)
             focusedStageText = null;
-
+
         // Focus events are documented as bubbling. However, all events coming
         // from StageText are set to not bubble. So we need to create an
         // appropriate bubbling event here.
@@ -2235,7 +2286,7 @@
     {
         if (event.keyCode == Keyboard.ENTER && !_multiline)
             dispatchEvent(new FlexEvent(FlexEvent.ENTER));
-
+
         // Keyboard events are documented as bubbling. However, all events
         // coming from StageText are set to not bubble. So we need to create an
         // appropriate bubbling event here.
@@ -2291,9 +2342,6 @@
                 invalidateViewPortFlag = false
             }

-            // Make sure any pending style changes get saved before replacing
-            // the StageText with a bitmap
-            commitStyles();
             createProxyImage();
         }
     }
@@ -2407,11 +2455,13 @@
     private function enterFrameHandler(event:Event):void
     {
         removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
-
-        if (stageTextVisibleChangePending)
+
+        // If a transition is running, delay pending changes to the visibility
+        // of the StageText until the transition is complete.
+        if (!viewChanging && stageTextVisibleChangePending)
         {
             stageText.visible = stageTextVisible;
-
+
             // The focused stageText may have been replaced by a bitmap during
             // an animation. When restoring its visibility, restore its focus as
             // well if the soft keyboard is open. (If the soft keyboard is not
@@ -2431,7 +2481,7 @@
                 textImage.bitmapData.dispose();
                 textImage = null;
             }
-
+
             stageTextVisibleChangePending = false;
         }
     }
@@ -2470,10 +2520,10 @@
         stageText.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, stageText_softKeyboardHandler);
         stageText.removeEventListener(KeyboardEvent.KEY_DOWN, stageText_keyDownHandler);
         stageText.removeEventListener(KeyboardEvent.KEY_UP, stageText_keyUpHandler);
-
+
         stageText.dispose();
         stageText = null;
-
+
         removeEventListener(Event.ENTER_FRAME, enterFrameHandler);

         // This component may be removed from the stage by a Fade effect. In
@@ -2481,6 +2531,15 @@
         // reset the effect running state and remove any bitmap representation
         // of the StageText.
         disposeProxyImage();
+        if (textImage != null)
+        {
+            // If a textImage exists, we need to get rid of it to keep it in
+            // sync with our proxy image state. disposeProxyImage does not do
+            // this. It only sets a flag and invalidates properties.
+            removeChild(textImage);
+            textImage.bitmapData.dispose();
+            textImage = null;
+        }
         numEffectsRunning = 0;
     }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.components.supportClasses
 {


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@1269424 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/effects/WipeDown.as
+++ frameworks/projects/mx/src/mx/effects/WipeDown.as
@@ -51,6 +51,11 @@
  *  @see mx.effects.effectClasses.WipeDownInstance
  *
  *  @includeExample examples/WipeDownExample.mxml
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class WipeDown extends MaskEffect
 {
@@ -66,6 +71,11 @@
 	 *  Constructor.
 	 *
 	 *  @param target The Object to animate with this effect.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function WipeDown(target:Object = null)
 	{