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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonBarLastButtonSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonBarLastButtonSkin.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 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: 4106
Author:   rfrishbe@adobe.com
Date:     2008-11-14T01:56:47.949068Z

Log Message:
-----------
Mostly rename changes.  IVisualItem -> IVisualElement.  IVisualContainer -> IVisualElementContainer.  Also changed the APIs so that it's addElement, removeElement, etc.. instead of addItem, removeItem, etc...  Moreover, all of these APIs have been added to IVisualElementContainer (not just the read-only ones).  Now there's a common interface for all containers (even Halo's Container class implements it).  There's no more need to do:

if (x is Group || x is FxContainer)

Just use the IVisualElementContainer interface.

Some classes, like FxScroller (and perhaps DataGroup/FxDataContainer), will only implement the "getter" part of the API.  For now, if you call the mutation methods, we will throw an exception.  Perhaps later we'll add a separate interface for the read-only portion and the mutator interface will extend that one.

There might be a few more places in the code that need to be updated to use the new names for the methods.  I know Mustella needs cleaning up so it doesn't use getItem and uses getElement instead.  I've left the old APIs in there exactly for this purpose, so we can gradually move over to the new names (esp. QA).

At some point soon, we will remove the old methods as well as type them more strictly to only accept IVisualElements, for example addElement(element:IVisualElement).  Part of this work is dependent on updating the Flash Component Kit so that it implements IVisualElement (and perhaps IVisualElementContainer for containers).

Ran checkintests and all gumbo mustella tests.

QE Notes: Please update your tests to use addElement, removeElement, etc... along with the new IVisualElementContainer interface.  The old APIs (addItem, removeItem, etc...) will be removed soon.
Doc Notes: None
Bugs: -
Reviewer: Hans (he patiently sat through all these files...)

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IVisualContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/RemoveActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutItemHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutItemUIC.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxFadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IUIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualItem.as" copyfrom-rev="4083" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/IVisualContainer.as" copyfrom-rev="4083" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElementContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/states/AddItems.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutElementHelper.as
@@ -11,11 +11,6 @@

 package mx.layout
 {
-
-import mx.layout.ILayoutItem;
-
-import mx.core.IConstraintClient;
-import mx.core.IVisualItem;

 /**
  *  Documentation is not currently available.


fixed typo (SWC->SWF) in comments in abcdump.as (r=puhleeze+)


mapped

mapped

--- src/com/kemsky/impl/filters/mapped.as
+++ src/com/kemsky/impl/filters/mapped.as
@@ -1,18 +1,11 @@
 package com.kemsky.impl.filters
 {
-    public function mapped(val1:*, map:*):Function
+    public function mapped(val1:*, map:Object):Function
     {
         return function (item:*):Boolean
         {
-            var key:* = toValue(item, val1);
-            if(map is Function)
-            {
-                return map(key);
-            }
-            else
-            {
-                return map.hasOwnProperty(key);
-            }
+            var v:* = toValue(item, val1);
+            return v is String ? map.hasOwnProperty(v): !(map[v] == null || map[v] === undefined);
         };
     }
 }


405 EventMetadata doc

405 EventMetadata doc

--- raw/src/org/yellcorp/tools/EventMetadata.as
+++ raw/src/org/yellcorp/tools/EventMetadata.as
@@ -22,6 +22,9 @@
     private static var declarationFormatter:Template =
         new Template('[Event(name="{stringValue}", type="{className}")]');

+    /**
+     * @private
+     */
     public function EventMetadata(eventClass:Class)
     {
         _eventClass = eventClass;
@@ -30,16 +33,25 @@
         _superClassName = type.factory.extendsClass.@type[0];
     }

+    /**
+     * @private
+     */
     public function get className():String
     {
         return _eventClassName;
     }

+    /**
+     * @private
+     */
     public function get superClassName():String
     {
         return _superClassName;
     }

+    /**
+     * @private
+     */
     public function get eventStrings():Object
     {
         var strings:Object = { };
@@ -54,6 +66,9 @@
         return strings;
     }

+    /**
+     * @private
+     */
     public function get parent():EventMetadata
     {
         var superClass:Class;
@@ -68,6 +83,17 @@
         return null;
     }

+    /**
+     * Generates an array of strings containing Event metadata declarations
+     * – one for each const static String found in the provided event
+     * class and its superclasses.
+     *
+     * @param eventClass  The Class to use as the basis for Event metadata
+     *                    declarations.
+     * @param stopAtNative  If true, will not include declarations for
+     *                      Events native to Flash Player.
+     * @return  An Array of Strings, each one an Event metadata declaration.
+     */
     public static function generate(eventClass:Class, stopAtNative:Boolean = true):Array
     {
         var decls:Array = [];


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

--- frameworks/projects/automation/src/mx/automation/codec/DatePropertyCodec.as
+++ frameworks/projects/automation/src/mx/automation/codec/DatePropertyCodec.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.codec
+{
+
+	import mx.automation.qtp.IQTPPropertyDescriptor;
+	import mx.automation.IAutomationManager;
+	import mx.automation.IAutomationObject;
+
+	/**
+	 * Translates between internal Flex date and automation-friendly version
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class DatePropertyCodec extends DefaultPropertyCodec
+	{
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constrcutor
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function DatePropertyCodec()
+		{
+			super();
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function encode(automationManager:IAutomationManager,
+										obj:Object,
+										propertyDescriptor:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):Object
+		{
+			var val:Object = getMemberFromObject(automationManager, obj, propertyDescriptor);
+			var encodedDate:String = "";
+
+			if (val != null)
+			{
+				if (val is Date)
+				{
+					encodedDate = (val as Date).toLocaleDateString();
+				}
+			}
+
+			return encodedDate;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function decode(automationManager:IAutomationManager,
+										obj:Object,
+										value:Object,
+										propertyDescriptor:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):void
+		{
+			obj[propertyDescriptor.name] =  new Date(Date.parse(String(value)));
+		}
+	}
+
+}


Removed overly aggressive XSS check

Removed overly aggressive XSS check

--- src/flash/FlashMediaElement.as
+++ src/flash/FlashMediaElement.as
@@ -1,1031 +1,1031 @@
-package
-{
-	import flash.display.*;
-	import flash.events.*;
-	import flash.media.*;
-	import flash.net.*;
-	import flash.text.*;
-	import flash.system.*;
-
-	import flash.media.Video;
-	import flash.net.NetConnection;
-	import flash.net.NetStream;
-
-	import flash.geom.ColorTransform;
-
-	import flash.filters.DropShadowFilter;
-	import flash.utils.Timer;
-	import flash.external.ExternalInterface;
-	import flash.geom.Rectangle;
-
-	import htmlelements.IMediaElement;
-	import htmlelements.VideoElement;
-	import htmlelements.AudioElement;
-	import htmlelements.YouTubeElement;
-
-	public class FlashMediaElement extends MovieClip {
-
-		private var _mediaUrl:String;
-		private var _autoplay:Boolean;
-		private var _preload:String;
-		private var _debug:Boolean;
-		private var _isVideo:Boolean;
-		private var _video:DisplayObject;
-		private var _timerRate:Number;
-		private var _stageWidth:Number;
-		private var _stageHeight:Number;
-		private var _enableSmoothing:Boolean;
-		private var _allowedPluginDomain:String;
-		private var _isFullScreen:Boolean = false;
-		private var _startVolume:Number;
-		private var _controlStyle:String;
-		private var _autoHide:Boolean = true;
-		private var _streamer:String = "";
-		private var _enablePseudoStreaming:Boolean;
-		private var _pseudoStreamingStartQueryParam:String;
-
-		// native video size (from meta data)
-		private var _nativeVideoWidth:Number = 0;
-		private var _nativeVideoHeight:Number = 0;
-
-		// visual elements
-		private var _output:TextField;
-		private var _fullscreenButton:SimpleButton;
-
-		// media
-		private var _mediaElement:IMediaElement;
-
-		// connection to fullscreen
-		private var _connection:LocalConnection;
-		private var _connectionName:String;
-
-		//private var fullscreen_btn:SimpleButton;
-
-		// CONTROLS
-		private var _alwaysShowControls:Boolean;
-		private var _controlBar:MovieClip;
-		private var _controlBarBg:MovieClip;
-		private var _scrubBar:MovieClip;
-		private var _scrubTrack:MovieClip;
-		private var _scrubOverlay:MovieClip;
-		private var _scrubLoaded:MovieClip;
-		private var _hoverTime:MovieClip;
-		private var _hoverTimeText:TextField;
-		private var _playButton:SimpleButton;
-		private var _pauseButton:SimpleButton;
-		private var _duration:TextField;
-		private var _currentTime:TextField;
-		private var _fullscreenIcon:SimpleButton;
-		private var _volumeMuted:SimpleButton;
-		private var _volumeUnMuted:SimpleButton;
-		private var _scrubTrackColor:String;
-		private var _scrubBarColor:String;
-		private var _scrubLoadedColor:String;
-
-		// IDLE Timer for mouse for showing/hiding controls
-		private var _inactiveTime:int;
-        private var _timer:Timer;
-        private var _idleTime:int;
-        private var _isMouseActive:Boolean
-		private var _isOverStage:Boolean = false;
-
-		// security checkes
-		private var securityIssue:Boolean = false; // When SWF parameters contain illegal characters
-		private var directAccess:Boolean = false; // When SWF visited directly with no parameters (or when security issue detected)
-
-
-		public function FlashMediaElement() {
-
-			// show allow this player to be called from a different domain than the HTML page hosting the player
-			Security.allowDomain("*");
-
-			// check for security issues (borrowed from jPLayer)
-			checkFlashVars(loaderInfo.parameters);
-
-
-			// add debug output
-			_output = new TextField();
-			_output.textColor = 0xeeeeee;
-			_output.width = stage.stageWidth - 100;
-			_output.height = stage.stageHeight;
-			_output.multiline = true;
-			_output.wordWrap = true;
-			_output.border = false;
-			_output.filters = [new DropShadowFilter(1, 0x000000, 45, 1, 2, 2, 1)];
-
-			_output.text = "Initializing...\n";
-			addChild(_output);
-			_output.visible = securityIssue;
-
-			if (securityIssue) {
-				_output.text = "WARNING: Security issue detected. Player stopped.";
-				return;
-			}
-
-			// get parameters
-			var params:Object = LoaderInfo(this.root.loaderInfo).parameters;
-			_mediaUrl = (params['file'] != undefined) ? String(params['file']) : "";
-			_autoplay = (params['autoplay'] != undefined) ? (String(params['autoplay']) == "true") : false;
-			_debug = (params['debug'] != undefined) ? (String(params['debug']) == "true") : false;
-			_isVideo = (params['isvideo'] != undefined) ? ((String(params['isvideo']) == "false") ? false : true  ) : true;
-			_timerRate = (params['timerrate'] != undefined) ? (parseInt(params['timerrate'], 10)) : 250;
-			_alwaysShowControls = (params['controls'] != undefined) ? (String(params['controls']) == "true") : false;
-			_enableSmoothing = (params['smoothing'] != undefined) ? (String(params['smoothing']) == "true") : false;
-			_startVolume = (params['startvolume'] != undefined) ? (parseFloat(params['startvolume'])) : 0.8;
-			_preload = (params['preload'] != undefined) ? params['preload'] : "none";
-			_controlStyle = (params['controlstyle'] != undefined) ? (String(params['controlstyle'])) : ""; // blank or "floating"
-			_autoHide = (params['autohide'] != undefined) ? (String(params['autohide'])) : true;
-			_scrubTrackColor = (params['scrubtrackcolor'] != undefined) ? (String(params['scrubtrackcolor'])) : "0x333333";
-			_scrubBarColor = (params['scrubbarcolor'] != undefined) ? (String(params['scrubbarcolor'])) : "0xefefef";
-			_scrubLoadedColor = (params['scrubloadedcolor'] != undefined) ? (String(params['scrubloadedcolor'])) : "0x3CACC8";
-			_enablePseudoStreaming = (params['pseudostreaming'] != undefined) ? (String(params['pseudostreaming']) == "true") : false;
-			_pseudoStreamingStartQueryParam = (params['pseudostreamstart'] != undefined) ? (String(params['pseudostreamstart'])) : "start";
-			_streamer = (params['flashstreamer'] != undefined) ? (String(params['flashstreamer'])) : "";
-
-			_output.visible = _debug;
-
-			if (isNaN(_timerRate))
-				_timerRate = 250;
-
-			// setup stage and player sizes/scales
-			stage.align = StageAlign.TOP_LEFT;
-			stage.scaleMode = StageScaleMode.NO_SCALE;
-			_stageWidth = stage.stageWidth;
-			_stageHeight = stage.stageHeight;
-
-			//_autoplay = true;
-			//_mediaUrl  = "http://mediafiles.dts.edu/chapel/mp4/20100609.mp4";
-			//_alwaysShowControls = true;
-			//_mediaUrl  = "../media/Parades-PastLives.mp3";
-			//_mediaUrl  = "../media/echo-hereweare.mp4";
-
-			//_mediaUrl = "http://video.ted.com/talks/podcast/AlGore_2006_480.mp4";
-			//_mediaUrl = "rtmp://stream2.france24.yacast.net/france24_live/en/f24_liveen";
-
-			//_mediaUrl = "http://www.youtube.com/watch?feature=player_embedded&v=yyWWXSwtPP0"; // hosea
-			//_mediaUrl = "http://www.youtube.com/watch?feature=player_embedded&v=m5VDDJlsD6I"; // railer with notes
-
-			//_alwaysShowControls = true;
-
-			//_debug=true;
-
-
-
-
-			// position and hide
-			_fullscreenButton = getChildByName("fullscreen_btn") as SimpleButton;
-			//_fullscreenButton.visible = false;
-			_fullscreenButton.alpha = 0;
-			_fullscreenButton.addEventListener(MouseEvent.CLICK, fullscreenClick, false);
-			_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width;
-			_fullscreenButton.y = stage.stageHeight - _fullscreenButton.height;
-
-
-			// create media element
-			if (_isVideo) {
-
-				if (_mediaUrl.indexOf("youtube.com") > -1 || _mediaUrl.indexOf("youtu.be") > -1) {
-
-					//Security.allowDomain("http://www.youtube.com");
-
-					_mediaElement = new YouTubeElement(this, _autoplay, _preload, _timerRate, _startVolume);
-					_video = (_mediaElement as YouTubeElement).player;
-
-					// these are set and then used once the player is loaded
-					(_mediaElement as YouTubeElement).initWidth = _stageWidth;
-					(_mediaElement as YouTubeElement).initHeight = _stageHeight;
-
-				} else {
-
-					_mediaElement = new VideoElement(this, _autoplay, _preload, _timerRate, _startVolume, _streamer);
-					_video = (_mediaElement as VideoElement).video;
-					_video.width = _stageWidth;
-					_video.height = _stageHeight;
-					(_video as Video).smoothing = _enableSmoothing;
-					(_mediaElement as VideoElement).setReference(this);
-					(_mediaElement as VideoElement).setPseudoStreaming(_enablePseudoStreaming);
-					(_mediaElement as VideoElement).setPseudoStreamingStartParam(_pseudoStreamingStartQueryParam);
-					//_video.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
-					addChild(_video);
-				}
-			} else {
-
-				//var player2:AudioDecoder = new com.automatastudios.audio.audiodecoder.AudioDecoder();
-				_mediaElement = new AudioElement(this, _autoplay, _preload, _timerRate, _startVolume);
-			}
-
-
-			// controls!
-			_controlBar = getChildByName("controls_mc") as MovieClip;
-			_controlBarBg = _controlBar.getChildByName("controls_bg_mc") as MovieClip;
-			_scrubTrack = _controlBar.getChildByName("scrubTrack") as MovieClip;
-			_scrubBar = _controlBar.getChildByName("scrubBar") as MovieClip;
-			_scrubOverlay = _controlBar.getChildByName("scrubOverlay") as MovieClip;
-			_scrubLoaded = _controlBar.getChildByName("scrubLoaded") as MovieClip;
-
-			_scrubOverlay.buttonMode = true;
-			_scrubOverlay.useHandCursor = true
-
-			applyColor(_scrubTrack, _scrubTrackColor);
-			applyColor(_scrubBar, _scrubBarColor);
-			applyColor(_scrubLoaded, _scrubLoadedColor);
-
-			_fullscreenIcon = _controlBar.getChildByName("fullscreenIcon") as SimpleButton;
-
-			// New fullscreenIcon for new fullscreen floating controls
-			//if(_alwaysShowControls && _controlStyle.toUpperCase()=="FLOATING") {
-				_fullscreenIcon.addEventListener(MouseEvent.CLICK, fullScreenIconClick, false);
-			//}
-
-			_volumeMuted = _controlBar.getChildByName("muted_mc") as SimpleButton;
-			_volumeUnMuted = _controlBar.getChildByName("unmuted_mc") as SimpleButton;
-
-			_volumeMuted.addEventListener(MouseEvent.CLICK, toggleVolume, false);
-			_volumeUnMuted.addEventListener(MouseEvent.CLICK, toggleVolume, false);
-
-			_playButton = _controlBar.getChildByName("play_btn") as SimpleButton;
-			_playButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) {
-				_mediaElement.play();
-			});
-			_pauseButton = _controlBar.getChildByName("pause_btn") as SimpleButton;
-			_pauseButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) {
-				_mediaElement.pause();
-			});
-			_pauseButton.visible = false;
-			_duration = _controlBar.getChildByName("duration_txt") as TextField;
-			_currentTime = _controlBar.getChildByName("currentTime_txt") as TextField;
-			_hoverTime = _controlBar.getChildByName("hoverTime") as MovieClip;
-			_hoverTimeText = _hoverTime.getChildByName("hoverTime_txt") as TextField;
-			_hoverTime.visible=false;
-			_hoverTime.y=(_hoverTime.height/2)+1;
-			_hoverTime.x=0;
-
-
-
-			// Add new timeline scrubber events
-			_scrubOverlay.addEventListener(MouseEvent.MOUSE_MOVE, scrubMove);
-			_scrubOverlay.addEventListener(MouseEvent.CLICK, scrubClick);
-			_scrubOverlay.addEventListener(MouseEvent.MOUSE_OVER, scrubOver);
-			_scrubOverlay.addEventListener(MouseEvent.MOUSE_OUT, scrubOut);
-
-			if (_autoHide) { // && _alwaysShowControls) {
-				// Add mouse activity for show/hide of controls
-				stage.addEventListener(Event.MOUSE_LEAVE, mouseActivityLeave);
-				stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseActivityMove);
-				_inactiveTime = 2500;
-				_timer = new Timer(_inactiveTime)
-				_timer.addEventListener(TimerEvent.TIMER, idleTimer);
-				_timer.start();
-				// set
-			}
-
-			if(_alwaysShowControls) {
-				if(_startVolume<=0) {
-					trace("INITIAL VOLUME: "+_startVolume+" MUTED");
-					_volumeMuted.visible=true;
-					_volumeUnMuted.visible=false;
-				} else {
-					trace("INITIAL VOLUME: "+_startVolume+" UNMUTED");
-					_volumeMuted.visible=false;
-					_volumeUnMuted.visible=true;
-				}
-			}
-
-			_controlBar.visible = _alwaysShowControls;
-
-			setControlDepth();
-
-			_output.appendText("stage: " + stage.stageWidth + "x" + stage.stageHeight + "\n");
-			_output.appendText("file: " + _mediaUrl + "\n");
-			_output.appendText("autoplay: " + _autoplay.toString() + "\n");
-			_output.appendText("preload: " + _preload.toString() + "\n");
-			_output.appendText("isvideo: " + _isVideo.toString() + "\n");
-			_output.appendText("smoothing: " + _enableSmoothing.toString() + "\n");
-			_output.appendText("timerrate: " + _timerRate.toString() + "\n");
-			_output.appendText("displayState: " +(stage.hasOwnProperty("displayState")).toString() + "\n");
-
-			// attach javascript
-			_output.appendText("ExternalInterface.available: " + ExternalInterface.available.toString() + "\n");
-			_output.appendText("ExternalInterface.objectID: " + ((ExternalInterface.objectID != null)? ExternalInterface.objectID.toString() : "null") + "\n");
-
-			if (_mediaUrl != "") {
-				_mediaElement.setSrc(_mediaUrl);
-			}
-
-			positionControls();
-
-			// Fire this once just to set the width on some dynamically sized scrub bar items;
-			_scrubBar.scaleX=0;
-			_scrubLoaded.scaleX=0;
-
-
-			if (ExternalInterface.available) { //  && !_alwaysShowControls
-
-				_output.appendText("Adding callbacks...\n");
-				try {
-					if (ExternalInterface.objectID != null && ExternalInterface.objectID.toString() != "") {
-
-						// add HTML media methods
-						ExternalInterface.addCallback("playMedia", playMedia);
-						ExternalInterface.addCallback("loadMedia", loadMedia);
-						ExternalInterface.addCallback("pauseMedia", pauseMedia);
-						ExternalInterface.addCallback("stopMedia", stopMedia);
-
-						ExternalInterface.addCallback("setSrc", setSrc);
-						ExternalInterface.addCallback("setCurrentTime", setCurrentTime);
-						ExternalInterface.addCallback("setVolume", setVolume);
-						ExternalInterface.addCallback("setMuted", setMuted);
-
-						ExternalInterface.addCallback("setFullscreen", setFullscreen);
-						ExternalInterface.addCallback("setVideoSize", setVideoSize);
-
-						ExternalInterface.addCallback("positionFullscreenButton", positionFullscreenButton);
-						ExternalInterface.addCallback("hideFullscreenButton", hideFullscreenButton);
-
-						// fire init method
-						ExternalInterface.call("mejs.MediaPluginBridge.initPlugin", ExternalInterface.objectID);
-					}
-
-					_output.appendText("Success...\n");
-
-				} catch (error:SecurityError) {
-					_output.appendText("A SecurityError occurred: " + error.message + "\n");
-				} catch (error:Error) {
-					_output.appendText("An Error occurred: " + error.message + "\n");
-				}
-
-			}
-
-			if (_preload != "none") {
-				_mediaElement.load();
-
-				if (_autoplay) {
-					_mediaElement.play();
-				}
-			} else if (_autoplay) {
-				_mediaElement.load();
-				_mediaElement.play();
-			}
-
-			// listen for resize
-			stage.addEventListener(Event.RESIZE, resizeHandler);
-
-			// send click events up to javascript
-			stage.addEventListener(MouseEvent.CLICK, stageClicked);
-
-			// resize
-			stage.addEventListener(FullScreenEvent.FULL_SCREEN, stageFullScreenChanged);
-		}
-
-		public function setControlDepth():void {
-			// put these on top
-			addChild(_output);
-			addChild(_controlBar);
-			addChild(_fullscreenButton);
-
-		}
-
-		// borrowed from jPLayer
-		// https://github.com/happyworm/jPlayer/blob/e8ca190f7f972a6a421cb95f09e138720e40ed6d/actionscript/Jplayer.as#L228
-		private function checkFlashVars(p:Object):void {
-			var i:Number = 0;
-			for each (var s:String in p) {
-				if (isIllegalChar(s)) {
-					securityIssue = true; // Illegal char found
-				}
-				i++;
-			}
-			if(i === 0 || securityIssue) {
-				directAccess = true;
-			}
-		}
-
-		private function isIllegalChar(s:String):Boolean {
-			var illegals:String = "' \" ( ) { } * + / \\ < > = document";
-			if(Boolean(s)) { // Otherwise exception if parameter null.
-				for each (var illegal:String in illegals.split(' ')) {
-					if(s.indexOf(illegal) >= 0) {
-						return true; // Illegal char found
-					}
-				}
-			}
-			return false;
-		}
-
-
-		// START: Controls and events
-		function mouseActivityMove(event:MouseEvent):void {
-
-			// if mouse is in the video area
-			if (_autoHide && (mouseX>=0 && mouseX<=stage.stageWidth) && (mouseY>=0 && mouseY<=stage.stageHeight)) {
-
-				// This could be move to a nice fade at some point...
-				_controlBar.visible = (_alwaysShowControls || _isFullScreen);
-				_isMouseActive = true;
-				_idleTime = 0;
-				_timer.reset();
-				_timer.start()
-			}
-		}
-
-		function mouseActivityLeave(event:Event):void {
-			if (_autoHide) {
-				_isOverStage = false;
-				// This could be move to a nice fade at some point...
-				_controlBar.visible = false;
-				_isMouseActive = false;
-				_idleTime = 0;
-				_timer.reset();
-				_timer.stop();
-			}
-		}
-
-		function idleTimer(event:TimerEvent):void    {
-
-			if (_autoHide) {
-				// This could be move to a nice fade at some point...
-				_controlBar.visible = false;
-				_isMouseActive = false;
-				_idleTime += _inactiveTime;
-				_idleTime = 0;
-				_timer.reset();
-				_timer.stop();
-			}
-		}
-
-
-		function scrubMove(event:MouseEvent):void {
-
-			//if (_alwaysShowControls) {
-				if (_hoverTime.visible) {
-					var seekBarPosition:Number =  ((event.localX / _scrubTrack.width) *_mediaElement.duration())*_scrubTrack.scaleX;
-					var hoverPos:Number = (seekBarPosition / _mediaElement.duration()) *_scrubTrack.scaleX;
-
-					if (_isFullScreen) {
-						_hoverTime.x=event.target.parent.mouseX;
-					} else {
-						_hoverTime.x=mouseX;
-					}
-					_hoverTime.y = _scrubBar.y - (_hoverTime.height/2);
-					_hoverTimeText.text = secondsToTimeCode(seekBarPosition);
-				}
-			//}
-			//trace(event);
-		}
-
-		function scrubOver(event:MouseEvent):void {
-			_hoverTime.y = _scrubBar.y-(_hoverTime.height/2)+1;
-			_hoverTime.visible = true;
-			trace(event);
-		}
-
-		function scrubOut(event:MouseEvent):void {
-			_hoverTime.y = _scrubBar.y+(_hoverTime.height/2)+1;
-			_hoverTime.visible = false;
-			//_hoverTime.x=0;
-			//trace(event);
-		}
-
-		function scrubClick(event:MouseEvent):void {
-			//trace(event);
-			var seekBarPosition:Number =  ((event.localX / _scrubTrack.width) *_mediaElement.duration())*_scrubTrack.scaleX;
-
-			var tmp:Number = (_mediaElement.currentTime()/_mediaElement.duration())*_scrubTrack.width;
-			var canSeekToPosition:Boolean = _scrubLoaded.scaleX > (seekBarPosition / _mediaElement.duration()) *_scrubTrack.scaleX;
-			//var canSeekToPosition:Boolean = true;
-
-			/*
-			amountLoaded = ns.bytesLoaded / ns.bytesTotal;
-			loader.loadbar._width = amountLoaded * 208.9;
-			loader.scrub._x = ns.time / duration * 208.9;
-			*/
-
-			trace("seekBarPosition:"+seekBarPosition, "CanSeekToPosition: "+canSeekToPosition);
-
-			if (seekBarPosition>0 && seekBarPosition<_mediaElement.duration() && canSeekToPosition) {
-					_mediaElement.setCurrentTime(seekBarPosition);
-			}
-		}
-
-		function toggleVolume(event:MouseEvent):void {
-			trace(event.currentTarget.name);
-			switch(event.currentTarget.name) {
-				case "muted_mc":
-					setMuted(false);
-					break;
-				case "unmuted_mc":
-					setMuted(true);
-					break;
-			}
-		}
-
-		function toggleVolumeIcons(volume:Number) {
-			if(volume<=0) {
-				_volumeMuted.visible = true;
-				_volumeUnMuted.visible = false;
-			} else {
-				_volumeMuted.visible = false;
-				_volumeUnMuted.visible = true;
-			}
-		}
-
-		public function positionControls(forced:Boolean=false) {
-
-
-			if ( _controlStyle.toUpperCase() == "FLOATING" && _isFullScreen) {
-
-				trace("CONTROLS: floating");
-				_hoverTime.y=(_hoverTime.height/2)+1;
-				_hoverTime.x=0;
-				_controlBarBg.width = 300;
-				_controlBarBg.height = 93;
-				//_controlBarBg.x = (stage.stageWidth/2) - (_controlBarBg.width/2);
-				//_controlBarBg.y  = stage.stageHeight - 300;
-
-				_pauseButton.scaleX = _playButton.scaleX=3.5;
-				_pauseButton.scaleY= _playButton.scaleY=3.5;
-				// center the play button and make it big and at the top
-				_pauseButton.x = _playButton.x = (_controlBarBg.width/2)-(_playButton.width/2)+7;
-				_pauseButton.y = _playButton.y = _controlBarBg.height-_playButton.height-(14)
-
-				_controlBar.x = (stage.stageWidth/2) -150;
-				_controlBar.y = stage.stageHeight - _controlBar.height-100;
-
-
-				// reposition the time and duration items
-
-				_duration.x = _controlBarBg.width - _duration.width - 10;
-				_duration.y = _controlBarBg.height - _duration.height -7;
-				//_currentTime.x = _controlBarBg.width - _duration.width - 10 - _currentTime.width - 10;
-				_currentTime.x = 5
-				_currentTime.y= _controlBarBg.height - _currentTime.height-7;
-
-				_fullscreenIcon.x = _controlBarBg.width - _fullscreenIcon.width - 7;
-				_fullscreenIcon.y = 7;
-
-				_volumeMuted.x = _volumeUnMuted.x = 7;
-				_volumeMuted.y = _volumeUnMuted.y = 7;
-
-				_scrubLoaded.x = _scrubBar.x = _scrubOverlay.x = _scrubTrack.x =_currentTime.x+_currentTime.width+7;
-				_scrubLoaded.y = _scrubBar.y = _scrubOverlay.y = _scrubTrack.y=_controlBarBg.height-_scrubTrack.height-10;
-
-				_scrubBar.width =  _scrubOverlay.width = _scrubTrack.width = (_duration.x-_duration.width-14);
-
-
-			} else {
-				trace("CONTROLS: normal, original");
-
-				/*
-				// Original style bottom display
-				_hoverTime.y=(_hoverTime.height/2)+1;
-				_hoverTime.x=0;
-				_controlBarBg.width = stage.stageWidth;
-				_controlBar.y = stage.stageHeight - _controlBar.height;
-				_duration.x = stage.stageWidth - _duration.width - 10;
-				//_currentTime.x = stage.stageWidth - _duration.width - 10 - _currentTime.width - 10;
-				_currentTime.x = _playButton.x+_playButton.width;
-				_scrubTrack.width = (_duration.x-_duration.width-10)-_duration.width+10;
-				_scrubOverlay.width = _scrubTrack.width;
-				_scrubBar.width = _scrubTrack.width;
-				*/
-
-				// FLOATING MODE BOTTOM DISPLAY - similar to normal
-				trace("THAT WAY!");
-				_hoverTime.y=(_hoverTime.height/2)+1;
-				_hoverTime.x=0;
-				_controlBarBg.width = stage.stageWidth;
-				_controlBarBg.height = 30;
-				_controlBarBg.y=0;
-				_controlBarBg.x=0;
-				// _controlBarBg.x = 0;
-				// _controlBarBg.y  = stage.stageHeight - _controlBar.height;
-
-				_pauseButton.scaleX = _playButton.scaleX=1;
-				_pauseButton.scaleY = _playButton.scaleY=1;
-
-				_pauseButton.x = _playButton.x = 7;
-				_pauseButton.y = _playButton.y = _controlBarBg.height-_playButton.height-2;
-
-
-				//_currentTime.x = stage.stageWidth - _duration.width - 10 - _currentTime.width - 10;
-				_currentTime.x = _playButton.x+_playButton.width;
-
-				_fullscreenIcon.x = _controlBarBg.width - _fullscreenIcon.width - 7;
-				_fullscreenIcon.y = 8;
-
-				_volumeMuted.x = _volumeUnMuted.x = _fullscreenIcon.x - _volumeMuted.width - 10;
-				_volumeMuted.y = _volumeUnMuted.y = 10;
-
-				_duration.x = _volumeMuted.x - _volumeMuted.width - _duration.width + 5;
-				_duration.y = _currentTime.y = _controlBarBg.height - _currentTime.height - 7;
-
-				_scrubLoaded.x = _scrubBar.x = _scrubOverlay.x = _scrubTrack.x = _currentTime.x + _currentTime.width + 10;
-				_scrubLoaded.y = _scrubBar.y = _scrubOverlay.y = _scrubTrack.y = _controlBarBg.height - _scrubTrack.height - 9;
-
-				_scrubBar.width =  _scrubOverlay.width = _scrubTrack.width =  (_duration.x-_duration.width-10)-_duration.width+5;
-				_controlBar.x = 0;
-				_controlBar.y = stage.stageHeight - _controlBar.height;
-
-			}
-
-		}
-
-		// END: Controls
-
-
-		function stageClicked(e:MouseEvent):void {
-			//_output.appendText("click: " + e.stageX.toString() +","+e.stageY.toString() + "\n");
-			if (e.target == stage) {
-				sendEvent("click", "");
-			}
-		}
-
-		function resizeHandler(e:Event):void {
-			//_video.scaleX = stage.stageWidth / _stageWidth;
-			//_video.scaleY = stage.stageHeight / _stageHeight;
-			//positionControls();
-
-			repositionVideo();
-		}
-
-		// START: Fullscreen
-		function enterFullscreen() {
-
-			_output.appendText("enterFullscreen()\n");
-
-			var screenRectangle:Rectangle = new Rectangle(0, 0, flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
-			stage.fullScreenSourceRect = screenRectangle;
-
-			stage.displayState = StageDisplayState.FULL_SCREEN;
-
-			repositionVideo(true);
-			positionControls();
-			updateControls(HtmlMediaEvent.FULLSCREENCHANGE);
-
-			_controlBar.visible = true;
-
-			_isFullScreen = true;
-		}
-
-		function exitFullscreen() {
-
-			stage.displayState = StageDisplayState.NORMAL;
-
-
-			_controlBar.visible = false;
-
-			_isFullScreen = false;
-		}
-
-		function setFullscreen(gofullscreen:Boolean) {
-
-			_output.appendText("setFullscreen: " + gofullscreen.toString() + "\n");
-
-			try {
-				//_fullscreenButton.visible = false;
-
-				if (gofullscreen) {
-					enterFullscreen();
-
-				} else {
-					exitFullscreen();
-				}
-
-			} catch (error:Error) {
-
-				// show the button when the security error doesn't let it work
-				//_fullscreenButton.visible = true;
-				_fullscreenButton.alpha = 1;
-
-				_isFullScreen = false;
-
-				_output.appendText("error setting fullscreen: " + error.message.toString() + "\n");
-			}
-		}
-
-		// control bar button/icon
-		function fullScreenIconClick(e:MouseEvent) {
-			try {
-				_controlBar.visible = true;
-				setFullscreen(!_isFullScreen);
-				repositionVideo(_isFullScreen);
-			} catch (error:Error) {
-			}
-		}
-
-		// special floating fullscreen icon
-		function fullscreenClick(e:MouseEvent) {
-			//_fullscreenButton.visible = false;
-			_fullscreenButton.alpha = 0
-
-			try {
-				_controlBar.visible = true;
-				setFullscreen(true);
-				repositionVideo(true);
-				positionControls();
-			} catch (error:Error) {
-			}
-		}
-
-
-		function stageFullScreenChanged(e:FullScreenEvent) {
-			_output.appendText("fullscreen event: " + e.fullScreen.toString() + "\n");
-
-			//_fullscreenButton.visible = false;
-			_fullscreenButton.alpha = 0;
-			_isFullScreen = e.fullScreen;
-
-			sendEvent(HtmlMediaEvent.FULLSCREENCHANGE, "isFullScreen:" + e.fullScreen );
-
-			if (!e.fullScreen) {
-				_controlBar.visible = _alwaysShowControls;
-			}
-		}
-		// END: Fullscreen
-
-		// START: external interface
-		function playMedia() {
-			_output.appendText("play\n");
-			_mediaElement.play();
-		}
-
-		function loadMedia() {
-			_output.appendText("load\n");
-			_mediaElement.load();
-		}
-
-		function pauseMedia() {
-			_output.appendText("pause\n");
-			_mediaElement.pause();
-		}
-
-		function setSrc(url:String) {
-			_output.appendText("setSrc: " + url + "\n");
-			_mediaElement.setSrc(url);
-		}
-
-		function stopMedia() {
-			_output.appendText("stop\n");
-			_mediaElement.stop();
-		}
-
-		function setCurrentTime(time:Number) {
-			_output.appendText("seek: " + time.toString() + "\n");
-			_mediaElement.setCurrentTime(time);
-		}
-
-		function setVolume(volume:Number) {
-			_output.appendText("volume: " + volume.toString() + "\n");
-			_mediaElement.setVolume(volume);
-			toggleVolumeIcons(volume);
-		}
-
-		function setMuted(muted:Boolean) {
-			_output.appendText("muted: " + muted.toString() + "\n");
-			_mediaElement.setMuted(muted);
-			toggleVolumeIcons(_mediaElement.getVolume());
-		}
-
-		function setVideoSize(width:Number, height:Number) {
-			_output.appendText("setVideoSize: " + width.toString() + "," + height.toString() + "\n");
-
-			_stageWidth = width;
-			_stageHeight = height;
-
-			if (_video != null) {
-				repositionVideo();
-				positionControls();
-				//_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width - 10;
-				_output.appendText("result: " + _video.width.toString() + "," + _video.height.toString() + "\n");
-			}
-
-
-		}
-
-		function positionFullscreenButton(x:Number, y:Number, visibleAndAbove:Boolean ) {
-
-			_output.appendText("position FS: " + x.toString() + "x" + y.toString() + "\n");
-
-			// bottom corner
-			/*
-			_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width
-			_fullscreenButton.y = stage.stageHeight - _fullscreenButton.height;
-			*/
-
-			// position just above
-			if (visibleAndAbove) {
-				_fullscreenButton.x = x+1;
-				_fullscreenButton.y = y - _fullscreenButton.height+1;
-			} else {
-				_fullscreenButton.x = x;
-				_fullscreenButton.y = y;
-			}
-
-			// check for oversizing
-			if ((_fullscreenButton.x + _fullscreenButton.width) > stage.stageWidth)
-				_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width;
-
-			// show it!
-			if (visibleAndAbove) {
-				_fullscreenButton.alpha = 1;
-			}
-		}
-
-		function hideFullscreenButton() {
-
-			//_fullscreenButton.visible = false;
-			_fullscreenButton.alpha = 0;
-		}
-
-		// END: external interface
-
-
-		function repositionVideo(fullscreen:Boolean = false):void {
-
-			_output.appendText("positioning video\n");
-
-			if (_mediaElement is VideoElement) {
-
-				if (isNaN(_nativeVideoWidth) || isNaN(_nativeVideoHeight) || _nativeVideoWidth <= 0 || _nativeVideoHeight <= 0) {
-					_output.appendText("ERR: I dont' have the native dimension\n");
-					return;
-				}
-
-				// calculate ratios
-				var stageRatio, nativeRatio;
-
-				_video.x = 0;
-				_video.y = 0;
-
-				if(fullscreen == true) {
-					stageRatio = flash.system.Capabilities.screenResolutionX/flash.system.Capabilities.screenResolutionY;
-					nativeRatio = _nativeVideoWidth/_nativeVideoHeight;
-
-					// adjust size and position
-					if (nativeRatio > stageRatio) {
-						_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, _nativeVideoHeight * flash.system.Capabilities.screenResolutionX / _nativeVideoWidth);
-						_video.y = flash.system.Capabilities.screenResolutionY/2 - _video.height/2;
-					} else if (stageRatio > nativeRatio) {
-						_mediaElement.setSize(_nativeVideoWidth * flash.system.Capabilities.screenResolutionY / _nativeVideoHeight, flash.system.Capabilities.screenResolutionY);
-						_video.x = flash.system.Capabilities.screenResolutionX/2 - _video.width/2;
-					} else if (stageRatio == nativeRatio) {
-						_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
-					}
-
-				} else {
-					stageRatio = _stageWidth/_stageHeight;
-					nativeRatio = _nativeVideoWidth/_nativeVideoHeight;
-
-
-					// adjust size and position
-					if (nativeRatio > stageRatio) {
-						_mediaElement.setSize(_stageWidth, _nativeVideoHeight * _stageWidth / _nativeVideoWidth);
-						_video.y = _stageHeight/2 - _video.height/2;
-					} else if (stageRatio > nativeRatio) {
-						_mediaElement.setSize( _nativeVideoWidth * _stageHeight / _nativeVideoHeight, _stageHeight);
-						_video.x = _stageWidth/2 - _video.width/2;
-					} else if (stageRatio == nativeRatio) {
-						_mediaElement.setSize(_stageWidth, _stageHeight);
-					}
-
-				}
-
-			} else if (_mediaElement is YouTubeElement) {
-				if(fullscreen == true) {
-					_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
-
-				} else {
-					_mediaElement.setSize(_stageWidth, _stageHeight);
-
-				}
-
-			}
-
-			positionControls();
-		}
-
-		// SEND events to JavaScript
-		public function sendEvent(eventName:String, eventValues:String) {
-
-			// special video event
-			if (eventName == HtmlMediaEvent.LOADEDMETADATA && _isVideo) {
-
-				_output.appendText("METADATA RECEIVED: ");
-
-				try {
-					if (_mediaElement is VideoElement) {
-						_nativeVideoWidth = (_mediaElement as VideoElement).videoWidth;
-						_nativeVideoHeight = (_mediaElement as VideoElement).videoHeight;
-					}
-				} catch (e:Error) {
-					_output.appendText(e.toString() + "\n");
-				}
-
-				_output.appendText(_nativeVideoWidth.toString() + "x" + _nativeVideoHeight.toString() + "\n");
-
-
-				 if(stage.displayState == "fullScreen" ) {
-					setVideoSize(_nativeVideoWidth, _nativeVideoHeight);
-					repositionVideo(true);
-				 } else {
-					repositionVideo();
-				 }
-			}
-
-			updateControls(eventName);
-
-			//trace((_mediaElement.duration()*1).toString() + " / " + (_mediaElement.currentTime()*1).toString());
-			//trace("CurrentProgress:"+_mediaElement.currentProgress());
-
-			if (ExternalInterface.objectID != null && ExternalInterface.objectID.toString() != "") {
-
-				//_output.appendText("event:" + eventName + " : " + eventValues);
-				//trace("event", eventName, eventValues);
-
-				if (eventValues == null)
-					eventValues == "";
-
-				if (_isVideo) {
-					eventValues += (eventValues != "" ? "," : "") + "isFullScreen:" + _isFullScreen;
-				}
-
-				eventValues = "{" + eventValues + "}";
-
-				/*
-				OLD DIRECT METHOD
-				ExternalInterface.call(
-					"function(id, name) { mejs.MediaPluginBridge.fireEvent(id,name," + eventValues + "); }",
-					ExternalInterface.objectID,
-					eventName);
-				*/
-
-				// use set timeout for performance reasons
-				//if (!_alwaysShowControls) {
-					ExternalInterface.call("setTimeout", "mejs.MediaPluginBridge.fireEvent('" + ExternalInterface.objectID + "','" + eventName + "'," + eventValues + ")",0);
-				//}
-			}
-		}
-
-
-		function updateControls(eventName:String):void {
-
-			//trace("updating controls");
-
-			try {
-				// update controls
-				switch (eventName) {
-					case "pause":
-					case "paused":
-					case "ended":
-						_playButton.visible = true;
-						_pauseButton.visible = false;
-						break;
-					case "play":
-					case "playing":
-						_playButton.visible = false;
-						_pauseButton.visible = true;
-						break;
-				}
-
-				if (eventName == HtmlMediaEvent.TIMEUPDATE ||
-					eventName == HtmlMediaEvent.PROGRESS ||
-					eventName == HtmlMediaEvent.FULLSCREENCHANGE) {
-
-					//_duration.text = (_mediaElement.duration()*1).toString();
-					_duration.text =  secondsToTimeCode(_mediaElement.duration());
-					//_currentTime.text = (_mediaElement.currentTime()*1).toString();
-					_currentTime.text =  secondsToTimeCode(_mediaElement.currentTime());
-
-					var pct:Number =  (_mediaElement.currentTime() / _mediaElement.duration()) *_scrubTrack.scaleX;
-
-					_scrubBar.scaleX = pct;
-					_scrubLoaded.scaleX = (_mediaElement.currentProgress()*_scrubTrack.scaleX)/100;
-				}
-			} catch (error:Error) {
-				trace("error: " + error.toString());
-
-			}
-
-		}
-
-		// START: utility
-		function secondsToTimeCode(seconds:Number):String {
-			var timeCode:String = "";
-			seconds = Math.round(seconds);
-			var minutes:Number = Math.floor(seconds / 60);
-			timeCode = (minutes >= 10) ? minutes.toString() : "0" + minutes.toString();
-			seconds = Math.floor(seconds % 60);
-			timeCode += ":" + ((seconds >= 10) ? seconds.toString() : "0" + seconds.toString());
-			return timeCode; //minutes.toString() + ":" + seconds.toString();
-		}
-
-		function applyColor(item:Object, color:String):void {
-
-			var myColor:ColorTransform = item.transform.colorTransform;
-			myColor.color = Number(color);
-			item.transform.colorTransform = myColor;
-		}
-		// END: utility
-
-	}
-}
+package
+{
+	import flash.display.*;
+	import flash.events.*;
+	import flash.media.*;
+	import flash.net.*;
+	import flash.text.*;
+	import flash.system.*;
+
+	import flash.media.Video;
+	import flash.net.NetConnection;
+	import flash.net.NetStream;
+
+	import flash.geom.ColorTransform;
+
+	import flash.filters.DropShadowFilter;
+	import flash.utils.Timer;
+	import flash.external.ExternalInterface;
+	import flash.geom.Rectangle;
+
+	import htmlelements.IMediaElement;
+	import htmlelements.VideoElement;
+	import htmlelements.AudioElement;
+	import htmlelements.YouTubeElement;
+
+	public class FlashMediaElement extends MovieClip {
+
+		private var _mediaUrl:String;
+		private var _autoplay:Boolean;
+		private var _preload:String;
+		private var _debug:Boolean;
+		private var _isVideo:Boolean;
+		private var _video:DisplayObject;
+		private var _timerRate:Number;
+		private var _stageWidth:Number;
+		private var _stageHeight:Number;
+		private var _enableSmoothing:Boolean;
+		private var _allowedPluginDomain:String;
+		private var _isFullScreen:Boolean = false;
+		private var _startVolume:Number;
+		private var _controlStyle:String;
+		private var _autoHide:Boolean = true;
+		private var _streamer:String = "";
+		private var _enablePseudoStreaming:Boolean;
+		private var _pseudoStreamingStartQueryParam:String;
+
+		// native video size (from meta data)
+		private var _nativeVideoWidth:Number = 0;
+		private var _nativeVideoHeight:Number = 0;
+
+		// visual elements
+		private var _output:TextField;
+		private var _fullscreenButton:SimpleButton;
+
+		// media
+		private var _mediaElement:IMediaElement;
+
+		// connection to fullscreen
+		private var _connection:LocalConnection;
+		private var _connectionName:String;
+
+		//private var fullscreen_btn:SimpleButton;
+
+		// CONTROLS
+		private var _alwaysShowControls:Boolean;
+		private var _controlBar:MovieClip;
+		private var _controlBarBg:MovieClip;
+		private var _scrubBar:MovieClip;
+		private var _scrubTrack:MovieClip;
+		private var _scrubOverlay:MovieClip;
+		private var _scrubLoaded:MovieClip;
+		private var _hoverTime:MovieClip;
+		private var _hoverTimeText:TextField;
+		private var _playButton:SimpleButton;
+		private var _pauseButton:SimpleButton;
+		private var _duration:TextField;
+		private var _currentTime:TextField;
+		private var _fullscreenIcon:SimpleButton;
+		private var _volumeMuted:SimpleButton;
+		private var _volumeUnMuted:SimpleButton;
+		private var _scrubTrackColor:String;
+		private var _scrubBarColor:String;
+		private var _scrubLoadedColor:String;
+
+		// IDLE Timer for mouse for showing/hiding controls
+		private var _inactiveTime:int;
+        private var _timer:Timer;
+        private var _idleTime:int;
+        private var _isMouseActive:Boolean
+		private var _isOverStage:Boolean = false;
+
+		// security checkes
+		private var securityIssue:Boolean = false; // When SWF parameters contain illegal characters
+		private var directAccess:Boolean = false; // When SWF visited directly with no parameters (or when security issue detected)
+
+
+		public function FlashMediaElement() {
+
+			// show allow this player to be called from a different domain than the HTML page hosting the player
+			Security.allowDomain("*");
+
+			// check for security issues (borrowed from jPLayer)
+			checkFlashVars(loaderInfo.parameters);
+
+
+			// add debug output
+			_output = new TextField();
+			_output.textColor = 0xeeeeee;
+			_output.width = stage.stageWidth - 100;
+			_output.height = stage.stageHeight;
+			_output.multiline = true;
+			_output.wordWrap = true;
+			_output.border = false;
+			_output.filters = [new DropShadowFilter(1, 0x000000, 45, 1, 2, 2, 1)];
+
+			_output.text = "Initializing...\n";
+			addChild(_output);
+			_output.visible = securityIssue;
+
+			if (securityIssue) {
+				_output.text = "WARNING: Security issue detected. Player stopped.";
+				return;
+			}
+
+			// get parameters
+			var params:Object = LoaderInfo(this.root.loaderInfo).parameters;
+			_mediaUrl = (params['file'] != undefined) ? String(params['file']) : "";
+			_autoplay = (params['autoplay'] != undefined) ? (String(params['autoplay']) == "true") : false;
+			_debug = (params['debug'] != undefined) ? (String(params['debug']) == "true") : false;
+			_isVideo = (params['isvideo'] != undefined) ? ((String(params['isvideo']) == "false") ? false : true  ) : true;
+			_timerRate = (params['timerrate'] != undefined) ? (parseInt(params['timerrate'], 10)) : 250;
+			_alwaysShowControls = (params['controls'] != undefined) ? (String(params['controls']) == "true") : false;
+			_enableSmoothing = (params['smoothing'] != undefined) ? (String(params['smoothing']) == "true") : false;
+			_startVolume = (params['startvolume'] != undefined) ? (parseFloat(params['startvolume'])) : 0.8;
+			_preload = (params['preload'] != undefined) ? params['preload'] : "none";
+			_controlStyle = (params['controlstyle'] != undefined) ? (String(params['controlstyle'])) : ""; // blank or "floating"
+			_autoHide = (params['autohide'] != undefined) ? (String(params['autohide'])) : true;
+			_scrubTrackColor = (params['scrubtrackcolor'] != undefined) ? (String(params['scrubtrackcolor'])) : "0x333333";
+			_scrubBarColor = (params['scrubbarcolor'] != undefined) ? (String(params['scrubbarcolor'])) : "0xefefef";
+			_scrubLoadedColor = (params['scrubloadedcolor'] != undefined) ? (String(params['scrubloadedcolor'])) : "0x3CACC8";
+			_enablePseudoStreaming = (params['pseudostreaming'] != undefined) ? (String(params['pseudostreaming']) == "true") : false;
+			_pseudoStreamingStartQueryParam = (params['pseudostreamstart'] != undefined) ? (String(params['pseudostreamstart'])) : "start";
+			_streamer = (params['flashstreamer'] != undefined) ? (String(params['flashstreamer'])) : "";
+
+			_output.visible = _debug;
+
+			if (isNaN(_timerRate))
+				_timerRate = 250;
+
+			// setup stage and player sizes/scales
+			stage.align = StageAlign.TOP_LEFT;
+			stage.scaleMode = StageScaleMode.NO_SCALE;
+			_stageWidth = stage.stageWidth;
+			_stageHeight = stage.stageHeight;
+
+			//_autoplay = true;
+			//_mediaUrl  = "http://mediafiles.dts.edu/chapel/mp4/20100609.mp4";
+			//_alwaysShowControls = true;
+			//_mediaUrl  = "../media/Parades-PastLives.mp3";
+			//_mediaUrl  = "../media/echo-hereweare.mp4";
+
+			//_mediaUrl = "http://video.ted.com/talks/podcast/AlGore_2006_480.mp4";
+			//_mediaUrl = "rtmp://stream2.france24.yacast.net/france24_live/en/f24_liveen";
+
+			//_mediaUrl = "http://www.youtube.com/watch?feature=player_embedded&v=yyWWXSwtPP0"; // hosea
+			//_mediaUrl = "http://www.youtube.com/watch?feature=player_embedded&v=m5VDDJlsD6I"; // railer with notes
+
+			//_alwaysShowControls = true;
+
+			//_debug=true;
+
+
+
+
+			// position and hide
+			_fullscreenButton = getChildByName("fullscreen_btn") as SimpleButton;
+			//_fullscreenButton.visible = false;
+			_fullscreenButton.alpha = 0;
+			_fullscreenButton.addEventListener(MouseEvent.CLICK, fullscreenClick, false);
+			_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width;
+			_fullscreenButton.y = stage.stageHeight - _fullscreenButton.height;
+
+
+			// create media element
+			if (_isVideo) {
+
+				if (_mediaUrl.indexOf("youtube.com") > -1 || _mediaUrl.indexOf("youtu.be") > -1) {
+
+					//Security.allowDomain("http://www.youtube.com");
+
+					_mediaElement = new YouTubeElement(this, _autoplay, _preload, _timerRate, _startVolume);
+					_video = (_mediaElement as YouTubeElement).player;
+
+					// these are set and then used once the player is loaded
+					(_mediaElement as YouTubeElement).initWidth = _stageWidth;
+					(_mediaElement as YouTubeElement).initHeight = _stageHeight;
+
+				} else {
+
+					_mediaElement = new VideoElement(this, _autoplay, _preload, _timerRate, _startVolume, _streamer);
+					_video = (_mediaElement as VideoElement).video;
+					_video.width = _stageWidth;
+					_video.height = _stageHeight;
+					(_video as Video).smoothing = _enableSmoothing;
+					(_mediaElement as VideoElement).setReference(this);
+					(_mediaElement as VideoElement).setPseudoStreaming(_enablePseudoStreaming);
+					(_mediaElement as VideoElement).setPseudoStreamingStartParam(_pseudoStreamingStartQueryParam);
+					//_video.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
+					addChild(_video);
+				}
+			} else {
+
+				//var player2:AudioDecoder = new com.automatastudios.audio.audiodecoder.AudioDecoder();
+				_mediaElement = new AudioElement(this, _autoplay, _preload, _timerRate, _startVolume);
+			}
+
+
+			// controls!
+			_controlBar = getChildByName("controls_mc") as MovieClip;
+			_controlBarBg = _controlBar.getChildByName("controls_bg_mc") as MovieClip;
+			_scrubTrack = _controlBar.getChildByName("scrubTrack") as MovieClip;
+			_scrubBar = _controlBar.getChildByName("scrubBar") as MovieClip;
+			_scrubOverlay = _controlBar.getChildByName("scrubOverlay") as MovieClip;
+			_scrubLoaded = _controlBar.getChildByName("scrubLoaded") as MovieClip;
+
+			_scrubOverlay.buttonMode = true;
+			_scrubOverlay.useHandCursor = true
+
+			applyColor(_scrubTrack, _scrubTrackColor);
+			applyColor(_scrubBar, _scrubBarColor);
+			applyColor(_scrubLoaded, _scrubLoadedColor);
+
+			_fullscreenIcon = _controlBar.getChildByName("fullscreenIcon") as SimpleButton;
+
+			// New fullscreenIcon for new fullscreen floating controls
+			//if(_alwaysShowControls && _controlStyle.toUpperCase()=="FLOATING") {
+				_fullscreenIcon.addEventListener(MouseEvent.CLICK, fullScreenIconClick, false);
+			//}
+
+			_volumeMuted = _controlBar.getChildByName("muted_mc") as SimpleButton;
+			_volumeUnMuted = _controlBar.getChildByName("unmuted_mc") as SimpleButton;
+
+			_volumeMuted.addEventListener(MouseEvent.CLICK, toggleVolume, false);
+			_volumeUnMuted.addEventListener(MouseEvent.CLICK, toggleVolume, false);
+
+			_playButton = _controlBar.getChildByName("play_btn") as SimpleButton;
+			_playButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) {
+				_mediaElement.play();
+			});
+			_pauseButton = _controlBar.getChildByName("pause_btn") as SimpleButton;
+			_pauseButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) {
+				_mediaElement.pause();
+			});
+			_pauseButton.visible = false;
+			_duration = _controlBar.getChildByName("duration_txt") as TextField;
+			_currentTime = _controlBar.getChildByName("currentTime_txt") as TextField;
+			_hoverTime = _controlBar.getChildByName("hoverTime") as MovieClip;
+			_hoverTimeText = _hoverTime.getChildByName("hoverTime_txt") as TextField;
+			_hoverTime.visible=false;
+			_hoverTime.y=(_hoverTime.height/2)+1;
+			_hoverTime.x=0;
+
+
+
+			// Add new timeline scrubber events
+			_scrubOverlay.addEventListener(MouseEvent.MOUSE_MOVE, scrubMove);
+			_scrubOverlay.addEventListener(MouseEvent.CLICK, scrubClick);
+			_scrubOverlay.addEventListener(MouseEvent.MOUSE_OVER, scrubOver);
+			_scrubOverlay.addEventListener(MouseEvent.MOUSE_OUT, scrubOut);
+
+			if (_autoHide) { // && _alwaysShowControls) {
+				// Add mouse activity for show/hide of controls
+				stage.addEventListener(Event.MOUSE_LEAVE, mouseActivityLeave);
+				stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseActivityMove);
+				_inactiveTime = 2500;
+				_timer = new Timer(_inactiveTime)
+				_timer.addEventListener(TimerEvent.TIMER, idleTimer);
+				_timer.start();
+				// set
+			}
+
+			if(_alwaysShowControls) {
+				if(_startVolume<=0) {
+					trace("INITIAL VOLUME: "+_startVolume+" MUTED");
+					_volumeMuted.visible=true;
+					_volumeUnMuted.visible=false;
+				} else {
+					trace("INITIAL VOLUME: "+_startVolume+" UNMUTED");
+					_volumeMuted.visible=false;
+					_volumeUnMuted.visible=true;
+				}
+			}
+
+			_controlBar.visible = _alwaysShowControls;
+
+			setControlDepth();
+
+			_output.appendText("stage: " + stage.stageWidth + "x" + stage.stageHeight + "\n");
+			_output.appendText("file: " + _mediaUrl + "\n");
+			_output.appendText("autoplay: " + _autoplay.toString() + "\n");
+			_output.appendText("preload: " + _preload.toString() + "\n");
+			_output.appendText("isvideo: " + _isVideo.toString() + "\n");
+			_output.appendText("smoothing: " + _enableSmoothing.toString() + "\n");
+			_output.appendText("timerrate: " + _timerRate.toString() + "\n");
+			_output.appendText("displayState: " +(stage.hasOwnProperty("displayState")).toString() + "\n");
+
+			// attach javascript
+			_output.appendText("ExternalInterface.available: " + ExternalInterface.available.toString() + "\n");
+			_output.appendText("ExternalInterface.objectID: " + ((ExternalInterface.objectID != null)? ExternalInterface.objectID.toString() : "null") + "\n");
+
+			if (_mediaUrl != "") {
+				_mediaElement.setSrc(_mediaUrl);
+			}
+
+			positionControls();
+
+			// Fire this once just to set the width on some dynamically sized scrub bar items;
+			_scrubBar.scaleX=0;
+			_scrubLoaded.scaleX=0;
+
+
+			if (ExternalInterface.available) { //  && !_alwaysShowControls
+
+				_output.appendText("Adding callbacks...\n");
+				try {
+					if (ExternalInterface.objectID != null && ExternalInterface.objectID.toString() != "") {
+
+						// add HTML media methods
+						ExternalInterface.addCallback("playMedia", playMedia);
+						ExternalInterface.addCallback("loadMedia", loadMedia);
+						ExternalInterface.addCallback("pauseMedia", pauseMedia);
+						ExternalInterface.addCallback("stopMedia", stopMedia);
+
+						ExternalInterface.addCallback("setSrc", setSrc);
+						ExternalInterface.addCallback("setCurrentTime", setCurrentTime);
+						ExternalInterface.addCallback("setVolume", setVolume);
+						ExternalInterface.addCallback("setMuted", setMuted);
+
+						ExternalInterface.addCallback("setFullscreen", setFullscreen);
+						ExternalInterface.addCallback("setVideoSize", setVideoSize);
+
+						ExternalInterface.addCallback("positionFullscreenButton", positionFullscreenButton);
+						ExternalInterface.addCallback("hideFullscreenButton", hideFullscreenButton);
+
+						// fire init method
+						ExternalInterface.call("mejs.MediaPluginBridge.initPlugin", ExternalInterface.objectID);
+					}
+
+					_output.appendText("Success...\n");
+
+				} catch (error:SecurityError) {
+					_output.appendText("A SecurityError occurred: " + error.message + "\n");
+				} catch (error:Error) {
+					_output.appendText("An Error occurred: " + error.message + "\n");
+				}
+
+			}
+
+			if (_preload != "none") {
+				_mediaElement.load();
+
+				if (_autoplay) {
+					_mediaElement.play();
+				}
+			} else if (_autoplay) {
+				_mediaElement.load();
+				_mediaElement.play();
+			}
+
+			// listen for resize
+			stage.addEventListener(Event.RESIZE, resizeHandler);
+
+			// send click events up to javascript
+			stage.addEventListener(MouseEvent.CLICK, stageClicked);
+
+			// resize
+			stage.addEventListener(FullScreenEvent.FULL_SCREEN, stageFullScreenChanged);
+		}
+
+		public function setControlDepth():void {
+			// put these on top
+			addChild(_output);
+			addChild(_controlBar);
+			addChild(_fullscreenButton);
+
+		}
+
+		// borrowed from jPLayer
+		// https://github.com/happyworm/jPlayer/blob/e8ca190f7f972a6a421cb95f09e138720e40ed6d/actionscript/Jplayer.as#L228
+		private function checkFlashVars(p:Object):void {
+			var i:Number = 0;
+			for each (var s:String in p) {
+				if (isIllegalChar(s)) {
+					securityIssue = true; // Illegal char found
+				}
+				i++;
+			}
+			if(i === 0 || securityIssue) {
+				directAccess = true;
+			}
+		}
+
+		private function isIllegalChar(s:String):Boolean {
+			var illegals:String = "' \" ( ) { } * + \\ < >";
+			if(Boolean(s)) { // Otherwise exception if parameter null.
+				for each (var illegal:String in illegals.split(' ')) {
+					if(s.indexOf(illegal) >= 0) {
+						return true; // Illegal char found
+					}
+				}
+			}
+			return false;
+		}
+
+
+		// START: Controls and events
+		function mouseActivityMove(event:MouseEvent):void {
+
+			// if mouse is in the video area
+			if (_autoHide && (mouseX>=0 && mouseX<=stage.stageWidth) && (mouseY>=0 && mouseY<=stage.stageHeight)) {
+
+				// This could be move to a nice fade at some point...
+				_controlBar.visible = (_alwaysShowControls || _isFullScreen);
+				_isMouseActive = true;
+				_idleTime = 0;
+				_timer.reset();
+				_timer.start()
+			}
+		}
+
+		function mouseActivityLeave(event:Event):void {
+			if (_autoHide) {
+				_isOverStage = false;
+				// This could be move to a nice fade at some point...
+				_controlBar.visible = false;
+				_isMouseActive = false;
+				_idleTime = 0;
+				_timer.reset();
+				_timer.stop();
+			}
+		}
+
+		function idleTimer(event:TimerEvent):void    {
+
+			if (_autoHide) {
+				// This could be move to a nice fade at some point...
+				_controlBar.visible = false;
+				_isMouseActive = false;
+				_idleTime += _inactiveTime;
+				_idleTime = 0;
+				_timer.reset();
+				_timer.stop();
+			}
+		}
+
+
+		function scrubMove(event:MouseEvent):void {
+
+			//if (_alwaysShowControls) {
+				if (_hoverTime.visible) {
+					var seekBarPosition:Number =  ((event.localX / _scrubTrack.width) *_mediaElement.duration())*_scrubTrack.scaleX;
+					var hoverPos:Number = (seekBarPosition / _mediaElement.duration()) *_scrubTrack.scaleX;
+
+					if (_isFullScreen) {
+						_hoverTime.x=event.target.parent.mouseX;
+					} else {
+						_hoverTime.x=mouseX;
+					}
+					_hoverTime.y = _scrubBar.y - (_hoverTime.height/2);
+					_hoverTimeText.text = secondsToTimeCode(seekBarPosition);
+				}
+			//}
+			//trace(event);
+		}
+
+		function scrubOver(event:MouseEvent):void {
+			_hoverTime.y = _scrubBar.y-(_hoverTime.height/2)+1;
+			_hoverTime.visible = true;
+			trace(event);
+		}
+
+		function scrubOut(event:MouseEvent):void {
+			_hoverTime.y = _scrubBar.y+(_hoverTime.height/2)+1;
+			_hoverTime.visible = false;
+			//_hoverTime.x=0;
+			//trace(event);
+		}
+
+		function scrubClick(event:MouseEvent):void {
+			//trace(event);
+			var seekBarPosition:Number =  ((event.localX / _scrubTrack.width) *_mediaElement.duration())*_scrubTrack.scaleX;
+
+			var tmp:Number = (_mediaElement.currentTime()/_mediaElement.duration())*_scrubTrack.width;
+			var canSeekToPosition:Boolean = _scrubLoaded.scaleX > (seekBarPosition / _mediaElement.duration()) *_scrubTrack.scaleX;
+			//var canSeekToPosition:Boolean = true;
+
+			/*
+			amountLoaded = ns.bytesLoaded / ns.bytesTotal;
+			loader.loadbar._width = amountLoaded * 208.9;
+			loader.scrub._x = ns.time / duration * 208.9;
+			*/
+
+			trace("seekBarPosition:"+seekBarPosition, "CanSeekToPosition: "+canSeekToPosition);
+
+			if (seekBarPosition>0 && seekBarPosition<_mediaElement.duration() && canSeekToPosition) {
+					_mediaElement.setCurrentTime(seekBarPosition);
+			}
+		}
+
+		function toggleVolume(event:MouseEvent):void {
+			trace(event.currentTarget.name);
+			switch(event.currentTarget.name) {
+				case "muted_mc":
+					setMuted(false);
+					break;
+				case "unmuted_mc":
+					setMuted(true);
+					break;
+			}
+		}
+
+		function toggleVolumeIcons(volume:Number) {
+			if(volume<=0) {
+				_volumeMuted.visible = true;
+				_volumeUnMuted.visible = false;
+			} else {
+				_volumeMuted.visible = false;
+				_volumeUnMuted.visible = true;
+			}
+		}
+
+		public function positionControls(forced:Boolean=false) {
+
+
+			if ( _controlStyle.toUpperCase() == "FLOATING" && _isFullScreen) {
+
+				trace("CONTROLS: floating");
+				_hoverTime.y=(_hoverTime.height/2)+1;
+				_hoverTime.x=0;
+				_controlBarBg.width = 300;
+				_controlBarBg.height = 93;
+				//_controlBarBg.x = (stage.stageWidth/2) - (_controlBarBg.width/2);
+				//_controlBarBg.y  = stage.stageHeight - 300;
+
+				_pauseButton.scaleX = _playButton.scaleX=3.5;
+				_pauseButton.scaleY= _playButton.scaleY=3.5;
+				// center the play button and make it big and at the top
+				_pauseButton.x = _playButton.x = (_controlBarBg.width/2)-(_playButton.width/2)+7;
+				_pauseButton.y = _playButton.y = _controlBarBg.height-_playButton.height-(14)
+
+				_controlBar.x = (stage.stageWidth/2) -150;
+				_controlBar.y = stage.stageHeight - _controlBar.height-100;
+
+
+				// reposition the time and duration items
+
+				_duration.x = _controlBarBg.width - _duration.width - 10;
+				_duration.y = _controlBarBg.height - _duration.height -7;
+				//_currentTime.x = _controlBarBg.width - _duration.width - 10 - _currentTime.width - 10;
+				_currentTime.x = 5
+				_currentTime.y= _controlBarBg.height - _currentTime.height-7;
+
+				_fullscreenIcon.x = _controlBarBg.width - _fullscreenIcon.width - 7;
+				_fullscreenIcon.y = 7;
+
+				_volumeMuted.x = _volumeUnMuted.x = 7;
+				_volumeMuted.y = _volumeUnMuted.y = 7;
+
+				_scrubLoaded.x = _scrubBar.x = _scrubOverlay.x = _scrubTrack.x =_currentTime.x+_currentTime.width+7;
+				_scrubLoaded.y = _scrubBar.y = _scrubOverlay.y = _scrubTrack.y=_controlBarBg.height-_scrubTrack.height-10;
+
+				_scrubBar.width =  _scrubOverlay.width = _scrubTrack.width = (_duration.x-_duration.width-14);
+
+
+			} else {
+				trace("CONTROLS: normal, original");
+
+				/*
+				// Original style bottom display
+				_hoverTime.y=(_hoverTime.height/2)+1;
+				_hoverTime.x=0;
+				_controlBarBg.width = stage.stageWidth;
+				_controlBar.y = stage.stageHeight - _controlBar.height;
+				_duration.x = stage.stageWidth - _duration.width - 10;
+				//_currentTime.x = stage.stageWidth - _duration.width - 10 - _currentTime.width - 10;
+				_currentTime.x = _playButton.x+_playButton.width;
+				_scrubTrack.width = (_duration.x-_duration.width-10)-_duration.width+10;
+				_scrubOverlay.width = _scrubTrack.width;
+				_scrubBar.width = _scrubTrack.width;
+				*/
+
+				// FLOATING MODE BOTTOM DISPLAY - similar to normal
+				trace("THAT WAY!");
+				_hoverTime.y=(_hoverTime.height/2)+1;
+				_hoverTime.x=0;
+				_controlBarBg.width = stage.stageWidth;
+				_controlBarBg.height = 30;
+				_controlBarBg.y=0;
+				_controlBarBg.x=0;
+				// _controlBarBg.x = 0;
+				// _controlBarBg.y  = stage.stageHeight - _controlBar.height;
+
+				_pauseButton.scaleX = _playButton.scaleX=1;
+				_pauseButton.scaleY = _playButton.scaleY=1;
+
+				_pauseButton.x = _playButton.x = 7;
+				_pauseButton.y = _playButton.y = _controlBarBg.height-_playButton.height-2;
+
+
+				//_currentTime.x = stage.stageWidth - _duration.width - 10 - _currentTime.width - 10;
+				_currentTime.x = _playButton.x+_playButton.width;
+
+				_fullscreenIcon.x = _controlBarBg.width - _fullscreenIcon.width - 7;
+				_fullscreenIcon.y = 8;
+
+				_volumeMuted.x = _volumeUnMuted.x = _fullscreenIcon.x - _volumeMuted.width - 10;
+				_volumeMuted.y = _volumeUnMuted.y = 10;
+
+				_duration.x = _volumeMuted.x - _volumeMuted.width - _duration.width + 5;
+				_duration.y = _currentTime.y = _controlBarBg.height - _currentTime.height - 7;
+
+				_scrubLoaded.x = _scrubBar.x = _scrubOverlay.x = _scrubTrack.x = _currentTime.x + _currentTime.width + 10;
+				_scrubLoaded.y = _scrubBar.y = _scrubOverlay.y = _scrubTrack.y = _controlBarBg.height - _scrubTrack.height - 9;
+
+				_scrubBar.width =  _scrubOverlay.width = _scrubTrack.width =  (_duration.x-_duration.width-10)-_duration.width+5;
+				_controlBar.x = 0;
+				_controlBar.y = stage.stageHeight - _controlBar.height;
+
+			}
+
+		}
+
+		// END: Controls
+
+
+		function stageClicked(e:MouseEvent):void {
+			//_output.appendText("click: " + e.stageX.toString() +","+e.stageY.toString() + "\n");
+			if (e.target == stage) {
+				sendEvent("click", "");
+			}
+		}
+
+		function resizeHandler(e:Event):void {
+			//_video.scaleX = stage.stageWidth / _stageWidth;
+			//_video.scaleY = stage.stageHeight / _stageHeight;
+			//positionControls();
+
+			repositionVideo();
+		}
+
+		// START: Fullscreen
+		function enterFullscreen() {
+
+			_output.appendText("enterFullscreen()\n");
+
+			var screenRectangle:Rectangle = new Rectangle(0, 0, flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
+			stage.fullScreenSourceRect = screenRectangle;
+
+			stage.displayState = StageDisplayState.FULL_SCREEN;
+
+			repositionVideo(true);
+			positionControls();
+			updateControls(HtmlMediaEvent.FULLSCREENCHANGE);
+
+			_controlBar.visible = true;
+
+			_isFullScreen = true;
+		}
+
+		function exitFullscreen() {
+
+			stage.displayState = StageDisplayState.NORMAL;
+
+
+			_controlBar.visible = false;
+
+			_isFullScreen = false;
+		}
+
+		function setFullscreen(gofullscreen:Boolean) {
+
+			_output.appendText("setFullscreen: " + gofullscreen.toString() + "\n");
+
+			try {
+				//_fullscreenButton.visible = false;
+
+				if (gofullscreen) {
+					enterFullscreen();
+
+				} else {
+					exitFullscreen();
+				}
+
+			} catch (error:Error) {
+
+				// show the button when the security error doesn't let it work
+				//_fullscreenButton.visible = true;
+				_fullscreenButton.alpha = 1;
+
+				_isFullScreen = false;
+
+				_output.appendText("error setting fullscreen: " + error.message.toString() + "\n");
+			}
+		}
+
+		// control bar button/icon
+		function fullScreenIconClick(e:MouseEvent) {
+			try {
+				_controlBar.visible = true;
+				setFullscreen(!_isFullScreen);
+				repositionVideo(_isFullScreen);
+			} catch (error:Error) {
+			}
+		}
+
+		// special floating fullscreen icon
+		function fullscreenClick(e:MouseEvent) {
+			//_fullscreenButton.visible = false;
+			_fullscreenButton.alpha = 0
+
+			try {
+				_controlBar.visible = true;
+				setFullscreen(true);
+				repositionVideo(true);
+				positionControls();
+			} catch (error:Error) {
+			}
+		}
+
+
+		function stageFullScreenChanged(e:FullScreenEvent) {
+			_output.appendText("fullscreen event: " + e.fullScreen.toString() + "\n");
+
+			//_fullscreenButton.visible = false;
+			_fullscreenButton.alpha = 0;
+			_isFullScreen = e.fullScreen;
+
+			sendEvent(HtmlMediaEvent.FULLSCREENCHANGE, "isFullScreen:" + e.fullScreen );
+
+			if (!e.fullScreen) {
+				_controlBar.visible = _alwaysShowControls;
+			}
+		}
+		// END: Fullscreen
+
+		// START: external interface
+		function playMedia() {
+			_output.appendText("play\n");
+			_mediaElement.play();
+		}
+
+		function loadMedia() {
+			_output.appendText("load\n");
+			_mediaElement.load();
+		}
+
+		function pauseMedia() {
+			_output.appendText("pause\n");
+			_mediaElement.pause();
+		}
+
+		function setSrc(url:String) {
+			_output.appendText("setSrc: " + url + "\n");
+			_mediaElement.setSrc(url);
+		}
+
+		function stopMedia() {
+			_output.appendText("stop\n");
+			_mediaElement.stop();
+		}
+
+		function setCurrentTime(time:Number) {
+			_output.appendText("seek: " + time.toString() + "\n");
+			_mediaElement.setCurrentTime(time);
+		}
+
+		function setVolume(volume:Number) {
+			_output.appendText("volume: " + volume.toString() + "\n");
+			_mediaElement.setVolume(volume);
+			toggleVolumeIcons(volume);
+		}
+
+		function setMuted(muted:Boolean) {
+			_output.appendText("muted: " + muted.toString() + "\n");
+			_mediaElement.setMuted(muted);
+			toggleVolumeIcons(_mediaElement.getVolume());
+		}
+
+		function setVideoSize(width:Number, height:Number) {
+			_output.appendText("setVideoSize: " + width.toString() + "," + height.toString() + "\n");
+
+			_stageWidth = width;
+			_stageHeight = height;
+
+			if (_video != null) {
+				repositionVideo();
+				positionControls();
+				//_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width - 10;
+				_output.appendText("result: " + _video.width.toString() + "," + _video.height.toString() + "\n");
+			}
+
+
+		}
+
+		function positionFullscreenButton(x:Number, y:Number, visibleAndAbove:Boolean ) {
+
+			_output.appendText("position FS: " + x.toString() + "x" + y.toString() + "\n");
+
+			// bottom corner
+			/*
+			_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width
+			_fullscreenButton.y = stage.stageHeight - _fullscreenButton.height;
+			*/
+
+			// position just above
+			if (visibleAndAbove) {
+				_fullscreenButton.x = x+1;
+				_fullscreenButton.y = y - _fullscreenButton.height+1;
+			} else {
+				_fullscreenButton.x = x;
+				_fullscreenButton.y = y;
+			}
+
+			// check for oversizing
+			if ((_fullscreenButton.x + _fullscreenButton.width) > stage.stageWidth)
+				_fullscreenButton.x = stage.stageWidth - _fullscreenButton.width;
+
+			// show it!
+			if (visibleAndAbove) {
+				_fullscreenButton.alpha = 1;
+			}
+		}
+
+		function hideFullscreenButton() {
+
+			//_fullscreenButton.visible = false;
+			_fullscreenButton.alpha = 0;
+		}
+
+		// END: external interface
+
+
+		function repositionVideo(fullscreen:Boolean = false):void {
+
+			_output.appendText("positioning video\n");
+
+			if (_mediaElement is VideoElement) {
+
+				if (isNaN(_nativeVideoWidth) || isNaN(_nativeVideoHeight) || _nativeVideoWidth <= 0 || _nativeVideoHeight <= 0) {
+					_output.appendText("ERR: I dont' have the native dimension\n");
+					return;
+				}
+
+				// calculate ratios
+				var stageRatio, nativeRatio;
+
+				_video.x = 0;
+				_video.y = 0;
+
+				if(fullscreen == true) {
+					stageRatio = flash.system.Capabilities.screenResolutionX/flash.system.Capabilities.screenResolutionY;
+					nativeRatio = _nativeVideoWidth/_nativeVideoHeight;
+
+					// adjust size and position
+					if (nativeRatio > stageRatio) {
+						_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, _nativeVideoHeight * flash.system.Capabilities.screenResolutionX / _nativeVideoWidth);
+						_video.y = flash.system.Capabilities.screenResolutionY/2 - _video.height/2;
+					} else if (stageRatio > nativeRatio) {
+						_mediaElement.setSize(_nativeVideoWidth * flash.system.Capabilities.screenResolutionY / _nativeVideoHeight, flash.system.Capabilities.screenResolutionY);
+						_video.x = flash.system.Capabilities.screenResolutionX/2 - _video.width/2;
+					} else if (stageRatio == nativeRatio) {
+						_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
+					}
+
+				} else {
+					stageRatio = _stageWidth/_stageHeight;
+					nativeRatio = _nativeVideoWidth/_nativeVideoHeight;
+
+
+					// adjust size and position
+					if (nativeRatio > stageRatio) {
+						_mediaElement.setSize(_stageWidth, _nativeVideoHeight * _stageWidth / _nativeVideoWidth);
+						_video.y = _stageHeight/2 - _video.height/2;
+					} else if (stageRatio > nativeRatio) {
+						_mediaElement.setSize( _nativeVideoWidth * _stageHeight / _nativeVideoHeight, _stageHeight);
+						_video.x = _stageWidth/2 - _video.width/2;
+					} else if (stageRatio == nativeRatio) {
+						_mediaElement.setSize(_stageWidth, _stageHeight);
+					}
+
+				}
+
+			} else if (_mediaElement is YouTubeElement) {
+				if(fullscreen == true) {
+					_mediaElement.setSize(flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY);
+
+				} else {
+					_mediaElement.setSize(_stageWidth, _stageHeight);
+
+				}
+
+			}
+
+			positionControls();
+		}
+
+		// SEND events to JavaScript
+		public function sendEvent(eventName:String, eventValues:String) {
+
+			// special video event
+			if (eventName == HtmlMediaEvent.LOADEDMETADATA && _isVideo) {
+
+				_output.appendText("METADATA RECEIVED: ");
+
+				try {
+					if (_mediaElement is VideoElement) {
+						_nativeVideoWidth = (_mediaElement as VideoElement).videoWidth;
+						_nativeVideoHeight = (_mediaElement as VideoElement).videoHeight;
+					}
+				} catch (e:Error) {
+					_output.appendText(e.toString() + "\n");
+				}
+
+				_output.appendText(_nativeVideoWidth.toString() + "x" + _nativeVideoHeight.toString() + "\n");
+
+
+				 if(stage.displayState == "fullScreen" ) {
+					setVideoSize(_nativeVideoWidth, _nativeVideoHeight);
+					repositionVideo(true);
+				 } else {
+					repositionVideo();
+				 }
+			}
+
+			updateControls(eventName);
+
+			//trace((_mediaElement.duration()*1).toString() + " / " + (_mediaElement.currentTime()*1).toString());
+			//trace("CurrentProgress:"+_mediaElement.currentProgress());
+
+			if (ExternalInterface.objectID != null && ExternalInterface.objectID.toString() != "") {
+
+				//_output.appendText("event:" + eventName + " : " + eventValues);
+				//trace("event", eventName, eventValues);
+
+				if (eventValues == null)
+					eventValues == "";
+
+				if (_isVideo) {
+					eventValues += (eventValues != "" ? "," : "") + "isFullScreen:" + _isFullScreen;
+				}
+
+				eventValues = "{" + eventValues + "}";
+
+				/*
+				OLD DIRECT METHOD
+				ExternalInterface.call(
+					"function(id, name) { mejs.MediaPluginBridge.fireEvent(id,name," + eventValues + "); }",
+					ExternalInterface.objectID,
+					eventName);
+				*/
+
+				// use set timeout for performance reasons
+				//if (!_alwaysShowControls) {
+					ExternalInterface.call("setTimeout", "mejs.MediaPluginBridge.fireEvent('" + ExternalInterface.objectID + "','" + eventName + "'," + eventValues + ")",0);
+				//}
+			}
+		}
+
+
+		function updateControls(eventName:String):void {
+
+			//trace("updating controls");
+
+			try {
+				// update controls
+				switch (eventName) {
+					case "pause":
+					case "paused":
+					case "ended":
+						_playButton.visible = true;
+						_pauseButton.visible = false;
+						break;
+					case "play":
+					case "playing":
+						_playButton.visible = false;
+						_pauseButton.visible = true;
+						break;
+				}
+
+				if (eventName == HtmlMediaEvent.TIMEUPDATE ||
+					eventName == HtmlMediaEvent.PROGRESS ||
+					eventName == HtmlMediaEvent.FULLSCREENCHANGE) {
+
+					//_duration.text = (_mediaElement.duration()*1).toString();
+					_duration.text =  secondsToTimeCode(_mediaElement.duration());
+					//_currentTime.text = (_mediaElement.currentTime()*1).toString();
+					_currentTime.text =  secondsToTimeCode(_mediaElement.currentTime());
+
+					var pct:Number =  (_mediaElement.currentTime() / _mediaElement.duration()) *_scrubTrack.scaleX;
+
+					_scrubBar.scaleX = pct;
+					_scrubLoaded.scaleX = (_mediaElement.currentProgress()*_scrubTrack.scaleX)/100;
+				}
+			} catch (error:Error) {
+				trace("error: " + error.toString());
+
+			}
+
+		}
+
+		// START: utility
+		function secondsToTimeCode(seconds:Number):String {
+			var timeCode:String = "";
+			seconds = Math.round(seconds);
+			var minutes:Number = Math.floor(seconds / 60);
+			timeCode = (minutes >= 10) ? minutes.toString() : "0" + minutes.toString();
+			seconds = Math.floor(seconds % 60);
+			timeCode += ":" + ((seconds >= 10) ? seconds.toString() : "0" + seconds.toString());
+			return timeCode; //minutes.toString() + ":" + seconds.toString();
+		}
+
+		function applyColor(item:Object, color:String):void {
+
+			var myColor:ColorTransform = item.transform.colorTransform;
+			myColor.color = Number(color);
+			item.transform.colorTransform = myColor;
+		}
+		// END: utility
+
+	}
+}


调整调用顺序

调整调用顺序

--- age/src/age/renderers/AnimationLayerRenderer.as
+++ age/src/age/renderers/AnimationLayerRenderer.as
@@ -178,11 +178,11 @@
 			mVertexData.setPosition(1, width, 0.0);
 			mVertexData.setPosition(2, 0.0, height);
 			mVertexData.setPosition(3, width, height);
-			onVertexDataChanged();
 			// 调整原点
 			const box:Box = _info.frames[0].box;
 			pivotX = box.width * (box.pivot.x);
 			pivotY = box.height * (1 - box.pivot.y); // 坐标系不同，需要颠倒的 pivot.y
+			onVertexDataChanged();
 		}

 		/**


This is tested.

This is tested.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4793 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/crowd/chat/client/ChatDirector.as
+++ src/as/com/threerings/crowd/chat/client/ChatDirector.as
@@ -526,7 +526,6 @@
      */
     public function filter (msg :String, otherUser :Name, outgoing :Boolean) :String
     {
-        // TODO: needs testing
         _filters.apply(function (observer :ChatFilter) :void {
             if (msg != null) {
                 msg = observer.filter(msg, otherUser, outgoing);


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

--- frameworks/projects/automation/src/mx/automation/delegates/DragManagerAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/DragManagerAutomationImpl.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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@1251664 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/automation/src/mx/automation/tabularData/OLAPDataGridTabularData.as
+++ frameworks/projects/automation/src/mx/automation/tabularData/OLAPDataGridTabularData.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.tabularData
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19777
Author:   smgilson@adobe.com
Date:     2011-01-17T16:40:41.362914Z

Log Message:
-----------
ASDoc edits on validators

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/validators/supportClasses/NumberValidatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationUtils.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/NumberValidator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/validators/CurrencyValidator.as</path>

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

--- frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as
+++ frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as
@@ -77,24 +77,28 @@
  *  to make a field required, which means that the user must enter a value in
  *  the field or the validation fails.
  *  This class also enables or disables the validator.
- *  Any class inheriting from this class must override the
- *  createWorkingInstance() method.
  *
  *  @mxml
  *
- *
The GlobalizationValidatorBase class defines the following tag attributes
- *  which all of its subclasses inherit:

+ *
The <s:GlobalizationValidatorBase> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:

  *
  *

- *  <spark:GlobalizationValidatorBase
- *    enabled="true|false"
+ *  <s:GlobalizationValidatorBase
+ *    Properties
+ *    enabled="true"
  *    listener="Value of the source property"
  *    property="No default"
- *    required="true|false"
+ *    required="true"
  *    requiredFieldError="This field is required."
  *    source="No default"
  *    trigger="Value of the source property"
  *    triggerEvent="valueCommit"
+ *
+ *    Events
+ *    invalid="No default"
+ *    valid="No default"
  *  />
  *

  *


don't dispatch change event if nothing changed

--- frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
+++ frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
@@ -138,6 +138,8 @@
          */
 		public function set selectedIndex(value:int):void
 		{
+            if (value === _selectedIndex) return;
+
 			_selectedIndex = value;
 			_selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length) ? _dataProvider[value] : null;
 			dispatchEvent(new Event("selectedIndexChanged"));
@@ -185,6 +187,8 @@
          */
 		public function set selectedItem(value:Object):void
 		{
+            if (value === _selectedItem) return;
+
 			_selectedItem = value;
 			var n:int = _dataProvider.length;
 			for (var i:int = 0; i < n; i++)


Fix default znear value

Fix default znear value

--- src/aerys/minko/scene/node/light/DirectionalLight.as
+++ src/aerys/minko/scene/node/light/DirectionalLight.as
@@ -156,6 +156,7 @@
 			this.shadowSpread		= shadowSpread;
             this.shadowBias     	= shadowBias;
 			this.shadowColor		= shadowColor;
+			this.shadowZNear 		= 0;

 			transform.lookAt(Vector4.ZERO, new Vector4(1, 1, 1));
 		}


Add a merge function to the geometry class

--- src/aerys/minko/scene/node/mesh/geometry/Geometry.as
+++ src/aerys/minko/scene/node/mesh/geometry/Geometry.as
@@ -659,5 +659,60 @@
 			_boundingSphere = BoundingSphere.fromMinMax(min, max);
 			_boundingBox = new BoundingBox(min, max);
 		}
+
+		public function split() : Vector.<Geometry>
+		{
+			var geometries		: Vector.<Geometry> = new Vector.<Geometry>;
+			var numGeometries	: uint				= 0;
+			var geometryId 		: uint				= 0;
+			var numStreams		: uint				= _vertexStreams.length;
+			var indexData		: Vector.<uint>		= _indexStream.minko_stream::_data;
+
+			for (var streamId : uint = 0; streamId < numStreams; ++streamId)
+			{
+				var stream	: VertexStream	= _vertexStreams[streamId] as VertexStream;
+				if (stream == null)
+					stream = VertexStream.extractSubStream(_vertexStreams[streamId], StreamUsage.DYNAMIC);
+
+				var vertexData	: Vector.<Number>			= stream.minko_stream::_data;
+				var vertexDatas	: Vector.<Vector.<Number>>	= new Vector.<Vector.<Number>>();
+				var indexDatas	: Vector.<Vector.<uint>>	= new Vector.<Vector.<uint>>();
+
+				GeometrySanitizer.splitBuffers(vertexData, indexData, vertexDatas, indexDatas, stream.format.size);
+
+				if (streamId == 0)
+				{
+					numGeometries = geometries.length = vertexDatas.length;
+					for (geometryId = 0; geometryId < numGeometries; ++geometryId)
+						geometries[geometryId] = new Geometry(new <IVertexStream>[], new IndexStream(StreamUsage.DYNAMIC, indexDatas[geometryId]));
+				}
+
+				for (geometryId = 0; geometryId < numGeometries; ++geometryId)
+					geometries[geometryId].setVertexStream(new VertexStream(StreamUsage.DYNAMIC, stream.format, vertexDatas[geometryId]), streamId);
+			}
+
+			return geometries;
+		}
+
+		public function merge(geometry : Geometry, usage : uint = StreamUsage.STATIC) : Geometry
+		{
+			_vertexStreams = new <IVertexStream>[VertexStream.concat(
+				new <IVertexStream>[
+						geometry.getVertexStream(),
+						this.getVertexStream()
+				],
+				usage
+			)];
+			_indexStream = geometry.indexStream.clone().concat(
+					this.indexStream,
+					0,
+					0,
+					geometry.getVertexStream().length
+				);
+
+			updateBoundingVolumes();
+
+			return this;
+		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23292
Author:   cframpto@adobe.com
Date:     2012-01-11T19:34:51.110620Z

Log Message:
-----------
Remove AdobePatentID="9999" strings per directions from legal.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/as3/SkinPartExtension.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/mxml/gen/StatesGenerator.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/spark/src/spark/components/supportClasses/Skin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/framework/src/mx/collections/ModifiedCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/CompilerAPI.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/as3/SkinPartEvaluator.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/spark/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/as3/binding/TypeAnalyzer.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/modules/compiler/src/java/flex2/compiler/mxml/rep/StatesModel.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/mx/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/apache/frameworks/projects/framework/src/mx/states/AddItems.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SkinnableComponent.as
@@ -16,8 +16,6 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-
-// AdobePatentID="B976"

 package spark.components.supportClasses
 {


Add field for service directory build request (ServiceDirectoryBuilder).

--- src/com/esri/builder/components/serviceBrowser/supportClasses/ServiceDirectoryBuilder.as
+++ src/com/esri/builder/components/serviceBrowser/supportClasses/ServiceDirectoryBuilder.as
@@ -51,6 +51,7 @@
     private var count:int;
     private var searchType:String;

+    private var serviceDirectoryBuildRequest:ServiceDirectoryBuildRequest;
     private var hasCrossDomain:Boolean;
     private var crossDomainRequest:HTTPService;
     private var credential:Credential;
@@ -67,9 +68,11 @@
             LOG.info("Building service directory");
         }

+        this.serviceDirectoryBuildRequest = serviceDirectoryBuildRequest;
+
         try
         {
-            checkCrossDomainBeforeBuildingDirectory(serviceDirectoryBuildRequest);
+            checkCrossDomainBeforeBuildingDirectory();
         }
         catch (error:Error)
         {
@@ -77,7 +80,7 @@
         }
     }

-    private function checkCrossDomainBeforeBuildingDirectory(serviceDirectoryBuildRequest:ServiceDirectoryBuildRequest):void
+    private function checkCrossDomainBeforeBuildingDirectory():void
     {
         if (Log.isDebug())
         {
@@ -103,7 +106,7 @@
             crossDomainRequest = null;
             hasCrossDomain = true;

-            checkIfServiceIsSecure(serviceDirectoryBuildRequest);
+            checkIfServiceIsSecure();
         }

         function crossDomainRequest_faultHandler(event:FaultEvent):void
@@ -118,7 +121,7 @@
             crossDomainRequest = null;
             hasCrossDomain = false;

-            checkIfServiceIsSecure(serviceDirectoryBuildRequest);
+            checkIfServiceIsSecure();
         }
     }

@@ -129,7 +132,7 @@
         return baseURLMatch[0] + 'crossdomain.xml';
     }

-    private function checkIfServiceIsSecure(serviceDirectoryBuildRequest:ServiceDirectoryBuildRequest):void
+    private function checkIfServiceIsSecure():void
     {
         if (Log.isInfo())
         {
@@ -209,13 +212,13 @@
             }

             //continue with building service directory
-            startBuildingDirectory(serviceDirectoryBuildRequest);
+            startBuildingDirectory();
         }

         function serviceSecurityRequest_faultHandler(fault:Fault, token:Object = null):void
         {
             //continue with building service directory
-            startBuildingDirectory(serviceDirectoryBuildRequest);
+            startBuildingDirectory();
         }
     }

@@ -224,7 +227,7 @@
         return url.replace('/rest/services', '/rest/info');
     }

-    private function startBuildingDirectory(serviceDirectoryBuildRequest:ServiceDirectoryBuildRequest):void
+    private function startBuildingDirectory():void
     {
         if (Log.isInfo())
         {