Transferred from the Adobe Open Source Subversion Repository

Revision: 11596
Author:   rfrishbe@adobe.com
Date:     2009-11-10T00:36:35.849792Z

Log Message:
-----------
Some changes to the new OSMF video player classes.  Some PARB renames, like videoElement->videoDisplay and playWhenHidden -> pauseWhenHidden as well as some fundamental changes around events.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/mediaClasses/VolumeBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/VideoPlayerSkin2.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/VideoDisplay.as
+++ frameworks/projects/spark/src/spark/components/VideoDisplay.as
@@ -17,8 +17,10 @@
 import flash.geom.Point;
 import flash.media.Video;

+import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
+import mx.events.FlexEvent;

 import org.osmf.display.MediaPlayerSprite;
 import org.osmf.display.ScaleMode;
@@ -64,99 +66,34 @@
 //--------------------------------------

 /**
- *  Dispatched when the NetConnection is closed,
- *  whether by being timed out, by calling the close() method,
- *  or by loading a new video stream.  This event is only dispatched
- *  with RTMP streams, never HTTP.
+ * Dispatched when the data is received as a download operation progresses.
  *
- *  @eventType spark.events.VideoEvent.CLOSE
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ * @eventType flash.events.ProgressEvent
  */
-[Event(name="close", type="spark.events.VideoEvent")]
+[Event(name="bytesDownloadedChange",type="org.osmf.events.BytesDownloadedChangeEvent")]

 /**
- * Dispatched when playing completes because the player reached the end of the FLV file.
- * The component does not dispatch the event if you call the stop() or
- * pause() methods
- * or click the corresponding controls.
+ * Dispatched when the MediaPlayer's state has changed.
+ *
+ * @eventType org.osmf.events.PlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE
+ */
+[Event(name="mediaPlayerStateChange", type="org.osmf.events.MediaPlayerStateChangeEvent")]
+
+/**
+ * Dispatched when the playhead property of the MediaPlayer has changed.
+ * This value is updated at the interval set by
+ * the MediaPlayer's playheadUpdateInterval property.
  *
- *  @eventType spark.events.VideoEvent.COMPLETE
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ * @eventType org.osmf.events.PlayheadChangeEvent.PLAYHEAD_CHANGE
+ **/
+[Event(name="playheadChange",type="org.osmf.events.PlayheadChangeEvent")]
+
+/**
+ * Dispatched when the duration property of the media has changed.
+ *
+ * @eventType org.osmf.events.DurationChangeEvent.DURATION_CHANGE
  */
-[Event(name="complete", type="spark.events.VideoEvent")]
-
-/**
- *  Dispatched the first time the FLV file's metadata is reached.
- *  The event object has an info property that contains the
- *  info object received by the NetStream.onMetaData event callback.
- *
- *  @eventType spark.events.VideoEvent.METADATA_RECEIVED
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="metadataReceived", type="spark.events.VideoEvent")]
-
-/**
- *  Dispatched every 0.25 seconds while the
- *  video is playing.  This event is not dispatched when it is paused
- *  or stopped, unless a seek occurs.
- *
- *  @eventType spark.events.VideoEvent.PLAYHEAD_UPDATE
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="playheadUpdate", type="spark.events.VideoEvent")]
-
-/**
- *  Indicates progress made in number of bytes downloaded. Dispatched starting
- *  when the load begins and ending when all bytes are loaded or there is a network error.
- *  Dispatched every 0.25 seconds starting when load is called and ending
- *  when all bytes are loaded or if there is a network error. Use this event to check
- *  bytes loaded or number of bytes in the buffer.
- *
- *
Dispatched only for a progressive HTTP download. Indicates progress in number of
- *  downloaded bytes. The event object has the bytesLoaded and bytesTotal
- *  properties.

- *
- *  @eventType flash.events.ProgressEvent.PROGRESS
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="progress", type="flash.events.ProgressEvent")]
-
-/**
- *  Dispatched when the video is loaded and ready to display.
- *
- *
This event is dispatched the first time the VideoPlayer
- *  enters a responsive state after a new FLV is loaded
- *  with the play() or load() method.
- *  It is dispatched once for each FLV loaded.

- *
- *  @eventType spark.events.VideoEvent.READY
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-[Event(name="ready", type="spark.events.VideoEvent")]
+[Event(name="durationChange", type="org.osmf.events.DurationChangeEvent")]

 //--------------------------------------
 //  Other metadata
@@ -279,30 +216,7 @@
             return;

         _autoPlay = value;
-        effectiveAutoPlayChanged(false);
-    }
-
-    // FIXME (rfrishbe): Copy this behavior correctly from the spark checked-in versions
-    private function effectiveAutoPlayChanged(takeAction:Boolean):void
-    {
-        if (!playWhenHidden)
-        {
-            var shouldBePlaying:Boolean = visible && _isOnDisplayList && enabled && _parentVisibility;
-
-            if (shouldBePlaying)
-            {
-                if (!playing && takeAction && videoPlayer.playable)
-                    play();
-            }
-            else
-            {
-                if (playing && takeAction && videoPlayer.playable)
-                    pause();
-            }
-
-            if (videoPlayer)
-                videoPlayer.autoPlay = shouldBePlaying && autoPlay;
-        }
+        changePlayback();
     }

     //----------------------------------
@@ -327,8 +241,7 @@
      */
     public function get autoRewind():Boolean
     {
-        var myVideoPlayer:MediaPlayer = videoPlayer;
-        return myVideoPlayer.autoRewind;
+        return videoPlayer.autoRewind;
     }

     public function set autoRewind(value:Boolean):void
@@ -336,6 +249,98 @@
         videoPlayer.autoRewind = value;
     }

+    //----------------------------------
+    //  bytesLoaded
+    //----------------------------------
+
+    [Inspectable(Category="General", defaultValue="0")]
+    [Bindable("bytesDownloadedChange")]
+
+    /**
+     *  The number of bytes of data that have been downloaded into the application.
+     *
+     *  @return The number of bytes of data that have been downloaded into the application.
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get bytesLoaded():Number
+    {
+        return videoPlayer.bytesDownloaded;
+    }
+
+    //----------------------------------
+    //  bytesTotal
+    //----------------------------------
+
+    [Inspectable(Category="General", defaultValue="0")]
+    [Bindable("mediaPlayerStateChange")]
+
+    /**
+     *  The total size in bytes of the data being downloaded into the application.
+     *
+     *  @return The total size in bytes of the data being downloaded into the application.
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get bytesTotal():Number
+    {
+        return videoPlayer.bytesTotal;
+    }
+
+    //----------------------------------
+    //  currentTime
+    //----------------------------------
+
+    [Inspectable(Category="General", defaultValue="0")]
+    [Bindable("playheadChange")]
+
+    /**
+     *  Current time of the playhead, measured in seconds,
+     *  since the video starting playing.
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get currentTime():Number
+    {
+        return videoPlayer.currentTime;
+    }
+
+    //----------------------------------
+    //  duration
+    //----------------------------------
+
+    [Inspectable(Category="General", defaultValue="0")]
+    [Bindable("durationChange")]
+
+    /**
+     *  Duration of the video's playback, in seconds
+     *
+     *  @return The total running time of the video in seconds
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get duration():Number
+    {
+        return videoPlayer.duration;
+    }
+
     //----------------------------------
     //  enabled
     //----------------------------------
@@ -367,100 +372,7 @@
             return;

         super.enabled = value;
-
-        effectiveAutoPlayChanged(true);
-    }
-
-    //----------------------------------
-    //  bytesDownloaded
-    //----------------------------------
-
-    [Bindable("bytesDownloadedChange")]
-    [Inspectable(Category="General", defaultValue="0")]
-
-    /**
-     *  The number of bytes of data that have been downloaded into the application.
-     *
-     *  @return The number of bytes of data that have been downloaded into the application.
-     *  @default 0
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get bytesLoaded():Number
-    {
-        return videoPlayer.bytesDownloaded;
-    }
-
-    //----------------------------------
-    //  bytesTotal
-    //----------------------------------
-
-    [Inspectable(Category="General", defaultValue="0")]
-
-    /**
-     *  The total size in bytes of the data being downloaded into the application.
-     *
-     *  @return The total size in bytes of the data being downloaded into the application.
-     *  @default 0
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get bytesTotal():Number
-    {
-        return videoPlayer.bytesTotal;
-    }
-
-    //----------------------------------
-    //  currentTime
-    //----------------------------------
-
-    [Bindable("playheadUpdate")]
-    [Bindable("playheadTimeChanged")]
-    [Inspectable(Category="General", defaultValue="0")]
-
-    /**
-     *  Current time of the playhead, measured in seconds,
-     *  since the video starting playing.
-     *
-     *  @default 0
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get currentTime():Number
-    {
-        return videoPlayer.currentTime;
-    }
-
-    //----------------------------------
-    //  duration
-    //----------------------------------
-
-    [Bindable("totalTimeChanged")]
-    [Inspectable(Category="General", defaultValue="0")]
-
-    /**
-     *  Duration of the video's playback, in seconds
-     *
-     *  @return The total running time of the video in seconds
-     *  @default 0
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get duration():Number
-    {
-        return videoPlayer.duration;
+        changePlayback();
     }

     //----------------------------------
@@ -499,16 +411,113 @@
     }

     //----------------------------------
-    //  maintainAspectRatio
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for maintainAspectRatio property.
-     */
-    private var _maintainAspectRatio:Boolean = true;
-
-    [Inspectable(Category="General", enumeration="none,stretch,letterBox,zoom", defaultValue="letterBox")]
+    //  muted
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="false")]
+    [Bindable("volumeChanged")]
+
+    /**
+     *  Set to true to mute the video, false
+     *  to unmute the video.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get muted():Boolean
+    {
+        return videoPlayer.muted;
+    }
+
+    /**
+     *  @private
+     */
+    public function set muted(value:Boolean):void
+    {
+        if (muted == value)
+            return;
+
+        videoPlayer.muted = value;
+    }
+
+    //----------------------------------
+    //  pauseWhenHidden
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage variable for pauseWhenHidden
+     */
+    private var _pauseWhenHidden:Boolean = true;
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  Controls whether the video continues to play when it is
+     *  hidden.  The video is hidden when either visible
+     *  is set to false on it or one of its ancestors,
+     *  or when the video is taken off
+     *  of the display list.  If set to true, the video
+     *  will pause playback until the video is visible again.  If set to
+     *  false the video will continue to play when it is hidden.
+     *
+     *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get pauseWhenHidden():Boolean
+    {
+        return _pauseWhenHidden;
+    }
+
+    /**
+     *  @private
+     */
+    public function set pauseWhenHidden(value:Boolean):void
+    {
+        _pauseWhenHidden = value;
+
+        changePlayback();
+    }
+
+    //----------------------------------
+    //  playing
+    //----------------------------------
+
+    [Inspectable(category="General")]
+    [Bindable("mediaPlayerStateChange")]
+
+    /**
+     *  Returns true if the video is playing or is attempting to play.
+     *
+     *
The video may not be currently playing, as it may be seeking
+     *  or buffering, but the video is attempting to play.

+     *
+     *  @see #play()
+     *  @see #pause()
+     *  @see #stop()
+     *  @see #autoPlay
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get playing():Boolean
+    {
+        return videoPlayer.playing;
+    }
+
+    //----------------------------------
+    //  scaleMode
+    //----------------------------------
+
+    [Inspectable(Category="General", enumeration="none,stretch,letterbox,zoom", defaultValue="letterbox")]

     /**
      *  The scaleMode property describes different ways of
@@ -535,127 +544,27 @@
      */
     public function set scaleMode(value:String):void
     {
-        if (scaleMode != value)
-        {
-            switch(value.toLowerCase())
-            {
-                case "none":
-                    videoSprite.scaleMode = ScaleMode.NONE;
-                    break;
-                case "stretch":
-                    videoSprite.scaleMode = ScaleMode.STRETCH;
-                    break;
-                case "letterbox":
-                    videoSprite.scaleMode = ScaleMode.LETTERBOX;
-                    break;
-                case "zoom":
-                    videoSprite.scaleMode = ScaleMode.ZOOM;
-                    break;
-            }
-        }
-    }
-
-    //----------------------------------
-    //  muted
-    //----------------------------------
-
-    [Inspectable(category="General", defaultValue="false")]
-    [Bindable("volumeChanged")]
-
-    /**
-     *  Set to true to mute the video, false
-     *  to unmute the video.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get muted():Boolean
-    {
-        return videoPlayer.muted;
-    }
-
-    /**
-     *  @private
-     */
-    public function set muted(value:Boolean):void
-    {
-        if (muted == value)
+        if (scaleMode == value)
             return;

-        videoPlayer.muted = value;
-    }
-
-    //----------------------------------
-    //  playing
-    //----------------------------------
-
-    [Inspectable(category="General")]
-    [Bindable("playingChanged")]
-    /**
-     *  Returns true if the video is playing or is attempting to play.
-     *
-     *
The video may not be currently playing, as it may be seeking
-     *  or buferring, but the video is attempting to play.

-     *
-     *  @see #play()
-     *  @see #pause()
-     *  @see #stop()
-     *  @see #autoPlay
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get playing():Boolean
-    {
-        return videoPlayer.playing;
-    }
-
-    //----------------------------------
-    //  playWhenHidden
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage variable for playWhenHidden
-     */
-    private var _playWhenHidden:Boolean = false;
-
-    [Inspectable(category="General", defaultValue="false")]
-
-    /**
-     *  Controls whether the video continues to play when it is
-     *  hidden.  The video is hidden when either visible
-     *  is set to false or when the video is taken off
-     *  of the display list.  If set to false, the video
-     *  will pause playback until the video is visible again.  If set to
-     *  true the video will continue to play when it is hidden.
-     *  The default is false.
-     *
-     *  @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get playWhenHidden():Boolean
-    {
-        return _playWhenHidden;
-    }
-
-    /**
-     *  @private
-     */
-    public function set playWhenHidden(value:Boolean):void
-    {
-        _playWhenHidden = value;
-
-        if (value)
-            videoPlayer.autoPlay = autoPlay;
+        switch(value.toLowerCase())
+        {
+            case "none":
+                videoSprite.scaleMode = ScaleMode.NONE;
+                break;
+            case "stretch":
+                videoSprite.scaleMode = ScaleMode.STRETCH;
+                break;
+            case "letterbox":
+                videoSprite.scaleMode = ScaleMode.LETTERBOX;
+                break;
+            case "zoom":
+                videoSprite.scaleMode = ScaleMode.ZOOM;
+                break;
+        }
+
+        invalidateSize();
+        invalidateDisplayList();
     }

     //----------------------------------
@@ -665,8 +574,8 @@
     private var _source:Object;
     private var sourceChanged:Boolean;

+    [Inspectable(category="General", defaultValue="null")]
     [Bindable("sourceChanged")]
-    [Inspectable(category="General", defaultValue="null")]

     /**
      *  For progressive download, the source is just a path or URL pointing
@@ -689,9 +598,6 @@
      */
     public function set source(value:Object):void
     {
-        if (_source == value)
-            return;
-
         _source = value;

         // if we haven't initialized, let's wait to set up the
@@ -714,22 +620,6 @@
         dispatchEvent(new Event("sourceChanged"));
     }

-    override public function setVisible(value:Boolean, noEvent:Boolean=false) : void
-    {
-        super.setVisible(value, noEvent);
-
-        effectiveAutoPlayChanged(true);
-    }
-
-    private var _parentVisibility:Boolean = true;
-
-    mx_internal function set parentVisibility(value:Boolean) : void
-    {
-        _parentVisibility = value;
-
-        effectiveAutoPlayChanged(true);
-    }
-
     /**
      *  @private
      *  Sets up the source for use.
@@ -757,10 +647,11 @@

             var n:int = streamingSource.streamItems.length;
             var item:DynamicStreamingVideoItem;
+            var dsi:DynamicStreamingItem;
             for (var i:int = 0; i < n; i++)
             {
                 item = DynamicStreamingVideoItem(streamingSource.streamItems[i]);
-                var dsi:DynamicStreamingItem = new DynamicStreamingItem(item.streamName, item.bitrate);
+                dsi = new DynamicStreamingItem(item.streamName, item.bitrate);
                 dsr.addItem(dsi);
             }

@@ -773,7 +664,8 @@
             var urlResource:URLResource = new URLResource(new URL(source as String));
             videoElement = new org.osmf.video.VideoElement(new NetLoader(), urlResource );
         }
-
+        changePlayback();
+
         videoPlayer.element = videoElement;
     }

@@ -890,8 +782,8 @@
     //  volume
     //----------------------------------

+    [Inspectable(category="General", defaultValue="1.0")]
     [Bindable("volumeChanged")]
-    [Inspectable(category="General", defaultValue="1.0")]

     /**
      *  The volume level, specified as an value between 0 and 1.
@@ -943,6 +835,14 @@
         super.commitProperties();

         initializedOnce = true;
+
+        if (visibilityChanged)
+        {
+            visibilityChanged = false;
+
+            computeEffectiveVisibility();
+            changePlayback();
+        }

         if (sourceChanged)
         {
@@ -958,64 +858,37 @@
     /**
      *  @private
      */
-    private var videoPlayerProperties:Object;
-
-    /**
-     *  @private
-     */
-    private function createUnderlyingVideoPlayer():void
-    {
-        // create new video player
-        videoPlayer = new MediaPlayer();
-        videoSprite = new MediaPlayerSprite(videoPlayer);
-
-        videoPlayer.addEventListener(DimensionChangeEvent.DIMENSION_CHANGE, videoPlayer_dimensionChangeHandler);
-        videoPlayer.addEventListener(VolumeChangeEvent.VOLUME_CHANGE, videoPlayer_volumeChangeHandler);
-        videoPlayer.addEventListener(MutedChangeEvent.MUTED_CHANGE, videoPlayer_mutedChangeHandler);
-        videoPlayer.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, dispatchEvent);
-        videoPlayer.addEventListener(PlayheadChangeEvent.PLAYHEAD_CHANGE, dispatchEvent);
-        videoPlayer.addEventListener(BytesDownloadedChangeEvent.BYTES_DOWNLOADED_CHANGE, dispatchEvent);
-        videoPlayer.addEventListener(DurationChangeEvent.DURATION_CHANGE, dispatchEvent);
-
-        videoPlayer.autoPlay = false;
-
-        addChild(videoSprite);
-    }
-
-    /**
-     *  @private
-     */
     override protected function measure() : void
     {
         super.measure();
+
+        var intrinsicWidth:Number;
+        var intrinsicHeight:Number;

         // if showing the thumbnail, just use the thumbnail's size
         if (thumbnailSource && thumbnailGroup)
         {
-            measuredWidth = thumbnailGroup.getPreferredBoundsWidth();
-            measuredHeight = thumbnailGroup.getPreferredBoundsHeight();
-            return;
-        }
-
-        // otherwise grab the width/height from the video
-        var vw:Number = videoPlayer.width;
-        var vh:Number = videoPlayer.height;
-
-        measuredWidth = vw;
-        measuredHeight = vh;
+            intrinsicWidth = thumbnailGroup.getPreferredBoundsWidth();
+            intrinsicHeight = thumbnailGroup.getPreferredBoundsHeight();
+        }
+        else
+        {
+            intrinsicWidth = videoPlayer.width;
+            intrinsicHeight = videoPlayer.height;
+        }
+
+        measuredWidth = intrinsicWidth;
+        measuredHeight = intrinsicHeight;

         // Determine whether 'width' and 'height' have been set.
         var bExplicitWidth:Boolean = !isNaN(explicitWidth);
         var bExplicitHeight:Boolean = !isNaN(explicitHeight);
-
+
         // If only one has been set, calculate the other based on aspect ratio.
-        if (_maintainAspectRatio && (bExplicitWidth || bExplicitHeight))
-        {
-            if (bExplicitWidth && !bExplicitHeight && vw > 0)
-                measuredHeight = explicitWidth * vh / vw;
-            else if (bExplicitHeight && !bExplicitWidth && vh > 0)
-                measuredWidth = explicitHeight * vw / vh;
-        }
+        if (bExplicitWidth && !bExplicitHeight && intrinsicWidth > 0)
+            measuredHeight = explicitWidth * intrinsicHeight / intrinsicWidth;
+        else if (bExplicitHeight && !bExplicitWidth && intrinsicHeight > 0)
+            measuredWidth = explicitHeight * intrinsicWidth / intrinsicHeight;
     }

     /**
@@ -1089,34 +962,6 @@
             return;

         videoPlayer.play();
-    }
-
-    /**
-     *  @private
-     *  If the video player is responsive, then methods can be called on the underlying
-     *  video player.
-     */
-    private function videoPlayerResponsive():Boolean
-    {
-        // can't call any methods before we've initialized
-        if (!initializedOnce)
-            return false;
-
-        // if displaying a thumbnail, no methods can be called b/c there's no video
-        // loaded up
-        if (thumbnailSource)
-            return false;
-
-        // if the video player's in a bad state, we can't do anything
-        if (videoPlayer.state == MediaPlayerState.PLAYBACK_ERROR)
-            return false;
-
-        // if no source, return false as well
-        if (!source)
-            return false;
-
-        // otherwise, we are in a good state and have a source, so let's go
-        return true;
     }

     /**
@@ -1158,9 +1003,6 @@
         if (!videoPlayerResponsive())
             return;

-        if (time < 0)
-            time = 0;
-
         videoPlayer.seek(time);
     }

@@ -1184,9 +1026,242 @@
         if (!videoPlayerResponsive())
             return;

-        videoPlayer.pause();
-        videoPlayer.seek(0);
-        // should be stop()
+        videoPlayer.stop();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  If the video player is responsive, then methods can be called on the underlying
+     *  video player.
+     */
+    private function videoPlayerResponsive():Boolean
+    {
+        // can't call any methods before we've initialized
+        if (!initializedOnce)
+            return false;
+
+        // if displaying a thumbnail, no methods can be called b/c there's no video
+        // loaded up
+        if (thumbnailSource)
+            return false;
+
+        // if the video player's in a bad state, we can't do anything
+        if (videoPlayer.state == MediaPlayerState.PLAYBACK_ERROR)
+            return false;
+
+        // if no source, return false as well
+        if (!source)
+            return false;
+
+        // otherwise, we are in a good state and have a source, so let's go
+        return true;
+    }
+
+    /**
+     *  @private
+     */
+    private var videoPlayerProperties:Object;
+
+    /**
+     *  @private
+     */
+    private function createUnderlyingVideoPlayer():void
+    {
+        // create new video player
+        videoPlayer = new MediaPlayer();
+        videoSprite = new MediaPlayerSprite(videoPlayer);
+
+        videoPlayer.addEventListener(DimensionChangeEvent.DIMENSION_CHANGE, videoPlayer_dimensionChangeHandler);
+        videoPlayer.addEventListener(VolumeChangeEvent.VOLUME_CHANGE, videoPlayer_volumeChangeHandler);
+        videoPlayer.addEventListener(MutedChangeEvent.MUTED_CHANGE, videoPlayer_mutedChangeHandler);
+        videoPlayer.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, dispatchEvent);
+        videoPlayer.addEventListener(PlayheadChangeEvent.PLAYHEAD_CHANGE, dispatchEvent);
+        videoPlayer.addEventListener(BytesDownloadedChangeEvent.BYTES_DOWNLOADED_CHANGE, dispatchEvent);
+        videoPlayer.addEventListener(DurationChangeEvent.DURATION_CHANGE, dispatchEvent);
+
+        addChild(videoSprite);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  pauseWhenHidden: Event handlers and Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Whether the video should be playing based on enabled,
+     *  pauseWhenHidden, whether it's on the display list, and its
+     *  effective visibility.
+     */
+    private function get shouldBePlaying():Boolean
+    {
+        // if disabled, return false
+        if (!enabled)
+            return false;
+
+        // if we want to look at visibility, check to
+        // see if we are on the display list and check out
+        // effectiveVisibility (which looks up our parent chain
+        // to make sure us and all of our ancestors are visible)
+        if (pauseWhenHidden)
+        {
+            if (!_isOnDisplayList)
+                return false;
+
+            if (!effectiveVisibility)
+                return false;
+        }
+
+        return true;
+    }
+
+    /**
+     *  @private
+     *  Whether the video was paused due to a change in visibility
+     *  or being added/removed from the stage. This starts out as
+     *  true so the first time we come through in changePlayback(),
+     *  we play the video.
+     */
+    private var visibilityPausedTheVideo:Boolean = true;
+
+    /**
+     *  @private
+     *  This method will pause or play the video when the video
+     *  loads up or the video is added/removed from the stage,
+     *  or the video's visible property is set.
+     */
+    private function changePlayback():void
+    {
+        // if we shouldn't be playing, we pause the video.
+        // if we come back up and should be playing, we will
+        // start playing the video again if the video wasn't paused
+        // by the user or developer and autoPlay is true.
+        if (shouldBePlaying)
+        {
+            // only play the video if visibility caused it to pause
+            // (instead of a user or developer calling video.pause()).
+            // Also, only play if autoPlay is true.  Otherwise when
+            // the visibility changes, we won't automatically
+            // play the video
+            if (visibilityPausedTheVideo && autoPlay)
+            {
+                visibilityPausedTheVideo = false;
+
+                // set autoplay and call play() if the
+                // source has loaded up and it's playable
+                videoPlayer.autoPlay = autoPlay;
+                if (videoPlayer.playable)
+                    videoPlayer.play();
+            }
+        }
+        else
+        {
+            // there are really three states the video player can
+            // be in with respect to play vs. paused:
+            // 1) playing
+            // 2) paused
+            // 3) loading
+            // Here we are checking if we are playing or are not paused (loading)
+            // and going to play soon (autoPlay = true)
+            if (playing || (!videoPlayer.paused && autoPlay))
+                visibilityPausedTheVideo = true;
+
+            // always set autoPlay to false here and
+            // if pausable, pause the video
+            videoPlayer.autoPlay = false;
+            if (videoPlayer.pausable)
+                videoPlayer.pause();
+        }
+    }
+
+    private var _isOnDisplayList:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private function addedToStageHandler(event:Event):void
+    {
+        _isOnDisplayList = true;
+
+        // add listeners to current parents to see if their visibility has changed
+        var current:IVisualElement = this;
+        while (current)
+        {
+            current.addEventListener(FlexEvent.HIDE, visibilityChangedHandler, false, 0, true);
+            current.addEventListener(FlexEvent.SHOW, visibilityChangedHandler, false, 0, true);
+
+            current = current.parent as IVisualElement;
+        }
+
+        computeEffectiveVisibility();
+        changePlayback();
+    }
+
+    /**
+     *  @private
+     */
+    private function removedFromStageHandler(event:Event):void
+    {
+        _isOnDisplayList = false;
+
+        // remove listeners from old parents
+        var current:IVisualElement = this;
+        while (current)
+        {
+            current.removeEventListener(FlexEvent.HIDE, visibilityChangedHandler, false);
+            current.removeEventListener(FlexEvent.SHOW, visibilityChangedHandler, false);
+
+            current = current.parent as IVisualElement;
+        }
+
+        changePlayback();
+    }
+
+    /**
+     *  @private
+     */
+    private var visibilityChanged:Boolean = false;
+
+    /**
+     *  @private
+     *  Event call back whenever the visibility of us or one of our ancestors
+     *  changes
+     */
+    private function visibilityChangedHandler(event:FlexEvent):void
+    {
+        visibilityChanged = true;
+        invalidateProperties();
+    }
+
+    /**
+     *  @private
+     */
+    private var effectiveVisibility:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private function computeEffectiveVisibility():void
+    {
+        effectiveVisibility = true;
+        var current:IVisualElement = this;
+        while (current)
+        {
+            if (!current.visible)
+            {
+                effectiveVisibility = false;
+                break;
+            }
+
+            current = current.parent as IVisualElement;
+        }
     }

     //--------------------------------------------------------------------------
@@ -1194,28 +1269,6 @@
     //  Event handlers
     //
     //--------------------------------------------------------------------------
-
-    private var _isOnDisplayList:Boolean = false;
-
-    /**
-     *  @private
-     */
-    private function addedToStageHandler(event:Event):void
-    {
-        _isOnDisplayList = true;
-
-        effectiveAutoPlayChanged(true);
-    }
-
-    /**
-     *  @private
-     */
-    private function removedFromStageHandler(event:Event):void
-    {
-        _isOnDisplayList = false;
-
-        effectiveAutoPlayChanged(true);
-    }

     /**
      *  @private


Version 1.2.0

Version 1.2.0

--- src/org/openvv/OVVAsset.as
+++ src/org/openvv/OVVAsset.as
@@ -110,7 +110,7 @@
         /**
          * Hold OVV version. Will past to JavaScript as well $ovv.version
          */
-        public static const RELEASE_VERSION: String = "1.1.0";
+        public static const RELEASE_VERSION: String = "1.2.0";

         ////////////////////////////////////////////////////////////


reset level upon hls.load(url)

reset level upon hls.load(url)

--- src/org/mangui/hls/HLS.as
+++ src/org/mangui/hls/HLS.as
@@ -159,6 +159,7 @@

         /** Load and parse a new HLS URL **/
         public function load(url : String) : void {
+            _level = 0;
             _hlsNetStream.close();
             _levelLoader.load(url);
         };


Fix initialization of constant UPDATE_ALL.

--- src/aerys/minko/type/math/Vector4.as
+++ src/aerys/minko/type/math/Vector4.as
@@ -28,7 +28,7 @@
 		private static const UPDATE_NONE		: uint		= 0;
 		private static const UPDATE_LENGTH		: uint		= 1;
 		private static const UPDATE_LENGTH_SQ	: uint		= 2;
-		private static const UPDATE_ALL			: uint		= UPDATE_LENGTH | UPDATE_LENGTH_SQ;
+		private static const UPDATE_ALL			: uint		= 3; // UPDATE_LENGTH | UPDATE_LENGTH_SQ;

 		private static const DATA_DESCRIPTOR	: Object	= {
 			'x'	: 'x',
@@ -147,7 +147,7 @@
 		public function Vector4(x 	: Number	= 0.,
 								y	: Number	= 0.,
 								z	: Number	= 0.,
-								w 	: Number	= 1)
+								w 	: Number	= 1.)
 		{
 			_vector.x = x;
 			_vector.y = y;


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 10633
Author:   dloverin@adobe.com
Date:     2009-09-28T13:24:30.559033Z

Log Message:
-----------
Use styleManager instance instead of StyleManager singleton (framework and compiler generated code)

Modified compiler generated style code for the FlexInit class. The style related changes are only available with the -keep option. AST generation is coming later.

Only the framework project is changed here. The other projects are will be changed soon.

QE notes: None.
Doc notes: None.
Bugs:
Reviewer: Alex and Paul
Tests run: checkintests, all Mustella tests(no new failures)
Is noteworthy for integration: no.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonBarButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressIndeterminateSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserMonthArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderThumbSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/DividedBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollThumbSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColumn.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleModule.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Form.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IStyleManager2.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TitleBackground.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperDownSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PopUpButtonSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/ProgrammaticSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/TabSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/textClasses/TextRange.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/CheckBoxIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/NumericStepperUpSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/RadioButtonIcon.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/states/SetStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ComboBoxArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.as</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/framework/src/mx/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/MenuBarBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ProgressBarSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/BusyCursor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/Request.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/SliderTrackSkin.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/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DataGridHeaderBackgroundSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SetStyleActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm</path>

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

--- frameworks/projects/mx/src/mx/controls/Label.as
+++ frameworks/projects/mx/src/mx/controls/Label.as
@@ -30,7 +30,6 @@
 import mx.core.UITextField;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
-import mx.styles.StyleManager;

 use namespace mx_internal;


Transferred from the Adobe Open Source Subversion Repository

Revision: 7986
Author:   gosmith@adobe.com
Date:     2009-06-18T23:30:43.672956Z

Log Message:
-----------
Fixed breakage in wireframe skins due to skin part renaming (textView -> textDisplay).

Also renamed private var textViewClass to richEditableTextClass in Container and CursorManagerImpl so that the old terminology "textView" is banished.

QE Notes: None
Doc Notes: None
Bugs: SDK-21893
Reviewer: Carol to review

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/TextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/NumericStepperTextInputSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/TextAreaSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>

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

--- frameworks/projects/mx/src/mx/core/Container.as
+++ frameworks/projects/mx/src/mx/core/Container.as
@@ -486,9 +486,15 @@

         showInAutomationHierarchy = false;

-        // If available, get soft-link to the TextView class to use in keyDownHandler().
-        if (ApplicationDomain.currentDomain.hasDefinition("spark.components.RichEditableText"))
-            textViewClass = Class(ApplicationDomain.currentDomain.getDefinition("spark.components.RichEditableText"));
+        // If available, get soft-link to the RichEditableText class
+		// to use in keyDownHandler().
+        if (ApplicationDomain.currentDomain.hasDefinition(
+				"spark.components.RichEditableText"))
+		{
+            richEditableTextClass =
+				Class(ApplicationDomain.currentDomain.getDefinition(
+					"spark.components.RichEditableText"));
+		}
     }

     //--------------------------------------------------------------------------
@@ -637,9 +643,9 @@

     /**
      *  @private
-     *  Soft-link to TextView class object, if available.
-     */
-    private var textViewClass:Class;
+     *  Soft-link to RichEditableText class object, if available.
+     */
+    private var richEditableTextClass:Class;

     //--------------------------------------------------------------------------
     //
@@ -5456,8 +5462,11 @@
         // ToDo: replace with universal scrolling scheme that provides same
         // experience as browser.
         var focusObj:Object = getFocus();
-        if ((focusObj is TextField) || (textViewClass && focusObj is textViewClass))
+        if ((focusObj is TextField) ||
+			(richEditableTextClass && focusObj is richEditableTextClass))
+		{
             return;
+		}

         // If the KeyBoardEvent can be canceled and a descendant has done so,
         // don't process it at all.


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

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPSet.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPSet.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: 5220
Author:   chaase@adobe.com
Date:     2009-03-10T15:55:06.496289Z

Log Message:
-----------
New Transform effects to handle correctly doing Move, Rotate, and Scale operations simultaneously. Also, added keyframe capabilities to new effects system (necessary for the transform effects, shouldn't affect operation of other effects). Fixed various issues with effects/transition infrastructure as necessary. Added transform utility functions to UIComponent, AdvancedLayoutFeatures, and GraphicElement.

QE Notes: This will break existing new effects tests due to changes in core Animation and AnimationEvent classes, QE is disabling them for now and will add them back in as changes are made.
Doc Notes: None
Bugs:
Reviewer: Ely (transform utilities) and Jason (the rest)
tests: checkintests, Mustella tests/Effects, tests/ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/TransformOffsets.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/KeyFrame.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</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/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate3D.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateColorInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimate.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxRotateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/baseClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxMoveInstance.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/effectClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/events/AnimationEvent.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/AnimationProperty.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/AdvancedLayoutFeatures.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -31,6 +31,7 @@
 import flash.geom.Point;
 import flash.geom.Rectangle;
 import flash.geom.Transform;
+import flash.geom.Vector3D;
 import flash.system.ApplicationDomain;
 import flash.text.TextFormatAlign;
 import flash.text.TextLineMetrics;
@@ -4731,6 +4732,7 @@
      *  the size and position of the component.
      *  It is not used by the component itself in determining
      *  its default size.
+     *
      *  Thus this property may not have any effect if parented by
      *  Container, or containers that don't factor in
      *  this property.
@@ -11450,47 +11452,125 @@
             invalidateParentSizeAndDisplayList();
     }

-    /**
-     * A utility method to update the rotation and scale of the transform while keeping a particular point, specified in the component's own coordinate space,
-     * fixed in the parent's coordinate space.  This function will assign the rotation and scale values provided, then update the x/y/z properties
-     * as necessary to keep tx/ty/tz fixed.
-     * @param rx,ry,rz the new values for the rotation of the transform
-     * @param sx,sy,sz the new values for the scale of the transform
-     * @param tx,ty,tz the point, in the component's own coordinates, to keep fixed relative to its parent.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    public function transformAround(rx:Number,ry:Number,rz:Number,sx:Number,sy:Number,sz:Number,tx:Number,ty:Number,tz:Number):void
-    {
-        if(_layoutFeatures == null && (
-            (!isNaN(rx) && rx != 0) ||
-            (!isNaN(ry) && ry != 0) ||
-            (!isNaN(sz) && sz != 1)
-            ))
-        {
-            initAdvancedLayoutFeatures();
-        }
-        if(_layoutFeatures != null)
-        {
-            _layoutFeatures.transformAround(rx,ry,rz,sx,sy,sz,tx,ty,tz,true);
+    private static var xformPt:Point;
+
+    /**
+     * A utility method to update the rotation, scale, and translation of the
+     * transform while keeping a particular point, specified in the component's
+     * own coordinate space, fixed in the parent's coordinate space.
+     * This function will assign the rotation, scale, and translation values
+     * provided, then update the x/y/z properties as necessary to keep
+     * the transform center fixed.
+     * @param transformCenter the point, in the component's own coordinates,
+     * to keep fixed relative to its parent.
+     * @param scale the new values for the scale of the transform
+     * @param rotation the new values for the rotation of the transform
+     * @param translation the new values for the translation of the transform
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function transformAround(transformCenter:Vector3D,
+                                    scale:Vector3D = null,
+                                    rotation:Vector3D = null,
+                                    translation:Vector3D = null,
+                                    postLayoutScale:Vector3D = null,
+                                    postLayoutRotation:Vector3D = null,
+                                    postLayoutTranslation:Vector3D = null):void
+    {
+        if (_layoutFeatures == null)
+        {
+            var needAdvancedLayout:Boolean =
+                (scale != null && scale.z != 1 && !isNaN(scale.z)) ||
+                (rotation != null && ((!isNaN(rotation.x) && rotation.x != 0) ||
+                                     (!isNaN(rotation.y) && rotation.y != 0))) ||
+                (translation != null && translation.z != 0 && !isNaN(translation.z)) ||
+                postLayoutScale != null ||
+                postLayoutRotation != null ||
+                postLayoutTranslation != null;
+            if (needAdvancedLayout)
+                initAdvancedLayoutFeatures();
+        }
+        if (_layoutFeatures != null)
+        {
+            _layoutFeatures.transformAround(transformCenter, scale, rotation,
+                translation, postLayoutScale, postLayoutRotation,
+                postLayoutTranslation);
             invalidateTransform();
             invalidateParentSizeAndDisplayList();
         }
         else
         {
-            var xformedPt:Point = super.transform.matrix.transformPoint(new Point(tx,ty));
-            if(!isNaN(rz))
-            rotation = rz;
-            if(!isNaN(sx))
-                scaleX = sx;
-            if(!isNaN(sx))
-                scaleY = sy;
-            var postXFormPoint:Point = super.transform.matrix.transformPoint(new Point(tx,ty));
-            x += xformedPt.x - postXFormPoint.x;
-            y += xformedPt.y - postXFormPoint.y;
+            if (rotation != null && !isNaN(rotation.z))
+                this.rotation = rotation.z;
+            if (scale != null)
+            {
+                scaleX = scale.x;
+                scaleY = scale.y;
+            }
+            if (transformCenter == null)
+            {
+                if (translation != null)
+                {
+                    x = translation.x;
+                    y = translation.y;
+                }
+            }
+            else
+            {
+                if (xformPt == null)
+                    xformPt = new Point();
+                xformPt.x = transformCenter.x;
+                xformPt.y = transformCenter.y;
+                var postXFormPoint:Point =
+                    super.transform.matrix.transformPoint(xformPt);
+                if (translation != null)
+                {
+                    x += translation.x - postXFormPoint.x;
+                    y += translation.y - postXFormPoint.y;
+                }
+                else
+                {
+                    var xformedPt:Point =
+                        super.transform.matrix.transformPoint(xformPt);
+                    x += xformedPt.x - postXFormPoint.x;
+                    y += xformedPt.y - postXFormPoint.y;
+                }
+            }
+        }
+    }
+
+    public function transformPointToParent(transformCenter:Vector3D,position:Vector3D,postLayoutPosition:Vector3D):void
+    {
+        if (_layoutFeatures != null)
+        {
+            _layoutFeatures.transformPointToParent(true, transformCenter,
+                position, postLayoutPosition);
+        }
+        else
+        {
+            if(xformPt == null)
+                xformPt = new Point();
+            if (transformCenter)
+            {
+                xformPt.x = transformCenter.x;
+                xformPt.y = transformCenter.y;
+            }
+            var tmp:Point = super.transform.matrix.transformPoint(xformPt);
+            if (position != null)
+            {
+                position.x = tmp.x;
+                position.y = tmp.y;
+                position.z = 0;
+            }
+            if (postLayoutPosition != null)
+            {
+                postLayoutPosition.x = tmp.x;
+                postLayoutPosition.y = tmp.y;
+                postLayoutPosition.z = 0;
+            }
         }
     }


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

--- frameworks/projects/rpc/src/mx/rpc/events/HeaderEvent.as
+++ frameworks/projects/rpc/src/mx/rpc/events/HeaderEvent.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/spark/src/spark/components/HGroup.as
+++ frameworks/projects/spark/src/spark/components/HGroup.as
@@ -9,11 +9,11 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package flex.component
+package mx.components
 {
 import flash.events.Event;
-import flex.core.Group;
-import flex.layout.HorizontalLayout;
+import mx.components.Group;
+import mx.layout.HorizontalLayout;

 /**
  * A Group with a HorizontalLayout.
@@ -23,7 +23,7 @@
  *
  * The layout property should not be set or configured directly.
  *
- * @see flex.layout.HorizontalLayout
+ * @see mx.layout.HorizontalLayout
  */
 public class HGroup extends Group
 {
@@ -35,8 +35,8 @@
      *  Resetting the layout property or setting its properties directly
      *  is not supported.
      *
-     *  @see flex.layout.HorizontalLayout
-     *  @see flex.component.VGroup
+     *  @see mx.layout.HorizontalLayout
+     *  @see mx.components.VGroup
      */
     public function HGroup():void
     {
@@ -63,7 +63,7 @@
     //----------------------------------

     /**
-     * @copy flex.layout.HorizontalLayout#gap
+     * @copy mx.layout.HorizontalLayout#gap
      */
     public function get gap():int
     {
@@ -85,7 +85,7 @@
     [Bindable("propertyChange")]

     /**
-     * @copy flex.layout.HorizontalLayout#columnCount
+     * @copy mx.layout.HorizontalLayout#columnCount
      */
     public function get columnCount():int
     {
@@ -97,7 +97,7 @@
     //----------------------------------

     /**
-     * @copy flex.layout.HorizontalLayout#requestedColumnCount
+     * @copy mx.layout.HorizontalLayout#requestedColumnCount
      */
     public function get requestedColumnCount():int
     {
@@ -119,7 +119,7 @@
     [Inspectable(category="General")]

     /**
-     * @copy flex.layout.HorizontalLayout#columnWidth
+     * @copy mx.layout.HorizontalLayout#columnWidth
      */
     public function get columnWidth():Number
     {
@@ -141,7 +141,7 @@
     [Inspectable(category="General")]

     /**
-     * @copy flex.layout.HorizontalLayout#variableColumnWidth
+     * @copy mx.layout.HorizontalLayout#variableColumnWidth
      */
     public function get variableColumnWidth():Boolean
     {
@@ -163,7 +163,7 @@
     [Bindable("indexInViewChanged")]

     /**
-     * @copy flex.layout.HorizontalLayout#firstIndexInView
+     * @copy mx.layout.HorizontalLayout#firstIndexInView
      */
     public function get firstIndexInView():int
     {
@@ -177,7 +177,7 @@
     [Bindable("indexInViewChanged")]

     /**
-     * @copy flex.layout.HorizontalLayout#lastIndexInView
+     * @copy mx.layout.HorizontalLayout#lastIndexInView
      */
     public function get lastIndexInView():int
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16728
Author:   clucier@adobe.com
Date:     2010-06-29T20:58:52.356567Z

Log Message:
-----------
Added ability to cancel all queued content requests.  Added bitmapData property to BitmapImage and Image.

QE notes: None
Doc notes:  None
Bugs: SDK-26559, SDK-26708
Reviewer: Glenn
Tests run: Checkin
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/ContentCache.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Image.as</path>

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

--- frameworks/projects/spark/src/spark/core/ContentCache.as
+++ frameworks/projects/spark/src/spark/core/ContentCache.as
@@ -584,6 +584,36 @@
     }

     /**
+     *  Resets the queue to initial empty state.  All requests, both active
+     *  and queued, are cancelled. All cache entries associated with canceled
+     *  requests are invalidated.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4.5
+     */
+    public function removeAllQueueEntries():void
+    {
+        // Cancel any active requests and return to queue.
+        requeueActive(true);
+
+        // Walk queue and invalidate any associated cache entries.
+        if (enableCaching)
+        {
+            var current:QueueEntryNode = requestQueue.head as QueueEntryNode;
+            while (current)
+            {
+                removeCacheEntry(current.urlRequest.url);
+                current = current.next as QueueEntryNode;
+            }
+        }
+
+        // Clear request queue.
+        requestQueue = new LinkedList();
+    }
+
+    /**
      *  Reorder our request queue giving priorityGroup preference.
      *  @private
      */
@@ -616,18 +646,22 @@
     }

     /**
-     *  Requeues all active requests.
-     *
-     *  @private
-     */
-    mx_internal function requeueActive():void
+     *  Requeues active requests.
+     *
+     *  @param requeueAll Cancel all active requests if true,
+     *  otherwise cancel and requeue any requests not in the
+     *  active priority group.
+     *
+     *  @private
+     */
+    mx_internal function requeueActive(requeueAll:Boolean=false):void
     {
         var current:QueueEntryNode = activeRequests.head as QueueEntryNode;
         while (current)
         {
             var activeNode:QueueEntryNode = current;
             current = current.next as QueueEntryNode;
-            if (activeNode.queueGroup != priorityGroup)
+            if (activeNode.queueGroup != priorityGroup || requeueAll)
             {
                 // Remove from active list and invoke close() on the Loader.
                 // We'll reinvoke load() again once the queued request is
@@ -644,7 +678,6 @@
                     requestQueue.unshift(activeNode);
                 }
             }
-
         }
     }
     //--------------------------------------------------------------------------


git-svn-id: http://svn.rails2u.com/as3rails2u/trunk@28 96db6a20-122f-0410-8d9f-89437bbe4005

--- src/com/rails2u/mx/mxTweener.as
+++ src/com/rails2u/mx/mxTweener.as
@@ -2,6 +2,7 @@
     import mx.effects.Effect;
     import mx.effects.AnimateProperty;
     import mx.effects.easing.*;
+    import mx.effects.*;
     import flash.utils.getDefinitionByName;
     import flash.utils.getQualifiedClassName;
     import mx.events.TweenEvent;
@@ -10,11 +11,25 @@
     import mx.utils.DescribeTypeCache;
     import mx.utils.DescribeTypeCacheRecord;
     import mx.effects.Parallel;
+    import mx.effects.CompositeEffect;
+    import mx.effects.Sequence;
+    import mx.core.mx_internal;
+    import mx.events.EffectEvent;
+    import mx.effects.effectClasses.TweenEffectInstance;
+    import mx.effects.TweenEffect;
+    use namespace mx_internal;

+    /*
+     * prop Ϥ櫓褦
+     */
     public class mxTweener {
         private static const EASYING_CLASSES:Array = [
             Back, Circular, Elastic, Quartic, Sine,
             Bounce, Cubic, Exponential, Quadratic, Quintic
+        ];
+
+        private static const TWEEN_EFFECT_CLASSES:Array = [
+            AnimateProperty, Blur, Dissolve, Fade, Glow, Move, Pause, Resize, Rotate, Zoom
         ];

         public static const EASYING_FUNCTIONS:Object = createEasyingFunctions();
@@ -31,14 +46,49 @@
             return o;
         }

-        public static function addTween(options:Object):Effect {
-            var pa:Parallel = new Parallel();
+        public static function tween(... args):Effect {
+            if(args.length == 1) {
+                if(args[0] is Array) {
+                    var par:Parallel= new Parallel;
+                    for each (var options:Object in args[0]) {
+                        par.addChild(factoryTween(options));
+                    }
+                    return par;
+                } else {
+                    return factoryTween(args[0]);
+                }
+            }
+            if(args.length > 1) {
+                var seq:Sequence = new Sequence;
+                for each (options in args) {
+                    seq.addChild(factoryTween(options));
+                }
+                return seq;
+            }
+            return new CompositeEffect;
+        }

-            var ef:AnimateProperty = new AnimateProperty();
+        public static function factoryTween(options:Object):Effect {
+            if (options.properties) {
+                return animatePropertyTween(options);
+            } else {
+                return effectTween(options);
+            }
+        }
+
+        public static function effectTween(options:Object):Effect {
+            var klass:Class;
+            if(options.klass as Class) {
+                klass = options.klass;
+            } else {
+               klass = Class(getDefinitionByName('mx.effects.' + options.klass));
+            }
+            var ef:Effect = new klass();
+
             var desc:XML = DescribeTypeCache.describeType(ef).typeDescription;
             var effectOptions:Object = {};
-
-            for (var key:String in options) {
+            var key:String;
+            for (key in options) {
                 if(
                     desc.variable.(@name == key).@name.toString() ||
                     desc.accessor.(@name == key && @access == 'readwrite').@name.toString()
@@ -48,53 +98,89 @@
                 }
             }

+            if (options.easing is Function) {
+                effectOptions.easingFunction = options.easing;
+            } else if (options.easing is String){
+                effectOptions.easingFunction = EASYING_FUNCTIONS[options.easing.toLocaleLowerCase()];
+            }
+
+            ef = createEffect(klass, effectOptions);
+            if(options.repeatReverse) {
+                if(ef.repeatCount != 0) {
+                    ef.addEventListener(TweenEvent.TWEEN_START,
+                            createRepeatCountHandler(ef.repeatCount));
+                    ef.repeatCount = 0;
+                }
+                ef.addEventListener(TweenEvent.TWEEN_END, tweenReverseHandler);
+            }
+            return ef;
+        }
+
+        public static function animatePropertyTween(options:Object):Parallel {
+            var parallel:Parallel = new Parallel();
+
+            var ef:AnimateProperty = new AnimateProperty();
+            var desc:XML = DescribeTypeCache.describeType(ef).typeDescription;
+            var effectOptions:Object = {};
+
+            var key:String;
+            for (key in options) {
+                if(
+                    desc.variable.(@name == key).@name.toString() ||
+                    desc.accessor.(@name == key && @access == 'readwrite').@name.toString()
+                ) {
+                    effectOptions[key] = options[key];
+                    delete options[key];
+                }
+            }

             if (options.easing is Function) {
                 effectOptions.easingFunction = options.easing;
-                delete options.easing;
             } else if (options.easing is String){
                 effectOptions.easingFunction = EASYING_FUNCTIONS[options.easing.toLocaleLowerCase()];
-                delete options.easing;
             }

-            var repeatReverseFlag:Boolean = false;
-            if (options.repeatReverse) {
-                repeatReverseFlag = true;
-                delete options.repeatReverse;
+            var properties:Object = options.properties;
+            for (key in properties) {
+                var effect:AnimateProperty = AnimateProperty(createEffect(AnimateProperty, effectOptions));
+                effect.property = key;
+                if (properties[key] is Array) {
+                    effect.fromValue = properties[key][0];
+                    effect.toValue = properties[key][1];
+                } else {
+                    effect.toValue = properties[key];
+                }
+                parallel.addChild(effect);
             }

-            if (options.properties) {
-                var props:Object = options.properties;
-                delete options.properties;
-                for (var key:String in props) {
-                    options[key] = props[key];
-                }
-            };
-
-            for (var key:String in options) {
-                var effect:AnimateProperty = createAnimateProperty(effectOptions);
-                effect.property = key;
-                if (options[key] is Array) {
-                    effect.fromValue = options[key][0];
-                    effect.toValue = options[key][1];
-                } else {
-                    effect.toValue = options[key];
-                }
-                pa.addChild(effect);
-            }
-
-            if(repeatReverseFlag) {
-                for each(var eff:Effect in pa.children) {
+            if(options.repeatReverse) {
+                for each(var eff:Effect in parallel.children) {
                     // eff.repeatCount = 0;
+                    // dirty code... :(
+                    if(eff.repeatCount != 0) {
+                        eff.addEventListener(TweenEvent.TWEEN_START,
+                          createRepeatCountHandler(eff.repeatCount));
+                        eff.repeatCount = 0;
+                    }
                     eff.addEventListener(TweenEvent.TWEEN_END, tweenReverseHandler);
                 }
             }

-            return Effect(pa);
+            return parallel;
         }

-        private static function createAnimateProperty(effectOptions:Object):AnimateProperty {
-            var ef:AnimateProperty = new AnimateProperty();
+        private static function createRepeatCountHandler(origRepCount:uint):Function {
+            var repCount:uint = 0;
+            return function(e:TweenEvent):void {
+                if(origRepCount == repCount++) {
+                    e.currentTarget.end();
+                    repCount = 0;
+                }
+            }
+        }
+
+        private static function createEffect(klass:Class, effectOptions:Object):Effect {
+            var ef:Effect = new klass();
             for (var key:String in effectOptions) {
                 ef[key] = effectOptions[key];
             }
@@ -102,7 +188,7 @@
         }

         private static function tweenReverseHandler(e:TweenEvent):void {
-            e.target.reverse();
+            e.currentTarget.reverse();
         }
     }
 }


widevine: change retries logic when doConnect fails

--- plugins/wvPlugin/src/com/widevine/WvNetConnection.as
+++ plugins/wvPlugin/src/com/widevine/WvNetConnection.as
@@ -11,7 +11,8 @@
 	import flash.external.ExternalInterface;
 	import flash.net.NetConnection;
 	import flash.net.Responder;
-	import flash.utils.setTimeout;
+	import flash.utils.Timer;
+	import flash.utils.setTimeout;

 	public class WvNetConnection extends NetConnection
 	{
@@ -80,15 +81,21 @@
 				//trace("(Handling Wv RTMP stream:" + command);
 			}
 			if (doConnect(command) != 0) {
-				setTimeout(function():void{
-					if (doConnect(command) != 0) {
-						//dispatchEvent(new NetStatusEvent("netStatus", obj));
-						//throw new Error("doConnect() failed");
-						dispatchEvent(new Event(DO_CONNECT_FAILED));
+				var connectTimer:Timer = new Timer(100, 30);
+				connectTimer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void {
+					//managed to connect without errors
+					if (doConnect(command) == 0) {
+						connectTimer.stop();
 					}
-				},1500);
+				});
+				connectTimer.addEventListener(TimerEvent.TIMER_COMPLETE,  function(e:TimerEvent):void {
+					dispatchEvent(new Event(DO_CONNECT_FAILED));
+				});
+				connectTimer.start();
 			}
-		}
+		}
+
+
 		///////////////////////////////////////////////////////////////////////////
 		private function doConnect(theURL:String):Number
 		{


NORMAL_SOUND_ARCHITECT のループ処理を修正

NORMAL_SOUND_ARCHITECT のループ処理を修正

--- project/SoundConductor/src/jp/hiiragi/managers/soundConductor/PlayingDataForNormalSound.as
+++ project/SoundConductor/src/jp/hiiragi/managers/soundConductor/PlayingDataForNormalSound.as
@@ -189,117 +189,117 @@
 			_soundChannel.removeEventListener(Event.SOUND_COMPLETE, onSoundCompleteHandler);
 			_soundChannel.stop();

-			super.dispose();
-		}
-
-//--------------------------------------------------------------------------
-//
-//  Service methods
-//
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//
-//  Public methods
-//
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//
-//  Protected methods
-//
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//
-//  Private methods
-//
-//--------------------------------------------------------------------------
-
-		private function executePlaySoundProcess(startPosition:int, volume:Number = 1, pan:Number = 0
-												 , fadeInTimeByMS:Number = 0, fadeInEasing:Function = null):void
-		{
-			// まずは最大音量で鳴らす（Sound.play() で初回に設定された音量が内部的に 1 となる仕様らしいため）
-			_soundChannel = _sound.play(startPosition, 0, new SoundTransform(1, pan));
-			_soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundCompleteHandler);
-
-			var initVolume:Number = volume;
-			if (fadeInTimeByMS > 0)
-			{
-				initVolume = 0;
-			}
-
-			// コントローラ設定
-			var groupVolumeController:ParameterController;
-			if (soundGroupController != null)
-			{
-				groupVolumeController = soundGroupController.groupVolumeController;
-			}
-
-			setSoundChannel(_soundChannel);
-
-			if (volumeController != null)
-			{
-				SoundParameterController(volumeController).replaceSoundChannel(_soundChannel);
-				SoundParameterController(panController).replaceSoundChannel(_soundChannel);
-			}
-			else
-			{
-				setVolumeController(new SoundParameterController(SoundParameterType.VOLUME, _soundChannel, masterVolumeController, groupVolumeController));
-				setPanController(new SoundParameterController(SoundParameterType.PAN, _soundChannel));
-			}
-
-			if (initVolume == 1)
-			{
-				// 音は最大音量のままなので、マスターボリュームとグループボリュームを適用させるのみにする
-				SoundParameterController(volumeController).validateNow();
-			}
-			else
-			{
-				// 音の変更があるので、通常通りセットする
-				volumeController.setValue(volume, fadeInTimeByMS, fadeInEasing);
-			}
-
-			var enabled:Boolean = validateEnabled();
-
-			if (enabled)
-			{
-				volumeController.setEnabled(true);
-			}
-			else
-			{
-				volumeController.setEnabled(false);
-			}
-		}
-
-//--------------------------------------------------------------------------
-//
-//  Overridden Event handlers
-//
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//
-//  Event handlers
-//
-//--------------------------------------------------------------------------
-
-		protected function onSoundCompleteHandler(event:Event):void
-		{
-			_soundChannel.removeEventListener(Event.SOUND_COMPLETE, onSoundCompleteHandler);
-
-			var currentVolume:Number = volumeController.value;
-			var currentPan:Number = panController.value;
-
 			if (volumeController != null)
 				volumeController.dispose();
 			if (panController != null)
 				panController.dispose();

+			super.dispose();
+		}
+
+//--------------------------------------------------------------------------
+//
+//  Service methods
+//
+//--------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------
+//
+//  Public methods
+//
+//--------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------
+//
+//  Protected methods
+//
+//--------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------
+//
+//  Private methods
+//
+//--------------------------------------------------------------------------
+
+		private function executePlaySoundProcess(startPosition:int, volume:Number = 1, pan:Number = 0
+												 , fadeInTimeByMS:Number = 0, fadeInEasing:Function = null):void
+		{
+			// まずは最大音量で鳴らす（Sound.play() で初回に設定された音量が内部的に 1 となる仕様らしいため）
+			_soundChannel = _sound.play(startPosition, 0, new SoundTransform(1, pan));
+			_soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundCompleteHandler);
+
+			var initVolume:Number = volume;
+			if (fadeInTimeByMS > 0)
+			{
+				initVolume = 0;
+			}
+
+			// コントローラ設定
+			var groupVolumeController:ParameterController;
+			if (soundGroupController != null)
+			{
+				groupVolumeController = soundGroupController.groupVolumeController;
+			}
+
+			setSoundChannel(_soundChannel);
+
+			if (volumeController != null)
+			{
+				SoundParameterController(volumeController).replaceSoundChannel(_soundChannel);
+				SoundParameterController(panController).replaceSoundChannel(_soundChannel);
+			}
+			else
+			{
+				setVolumeController(new SoundParameterController(SoundParameterType.VOLUME, _soundChannel, masterVolumeController, groupVolumeController));
+				setPanController(new SoundParameterController(SoundParameterType.PAN, _soundChannel));
+			}
+
+			if (initVolume == 1)
+			{
+				// 音は最大音量のままなので、マスターボリュームとグループボリュームを適用させるのみにする
+				SoundParameterController(volumeController).validateNow();
+			}
+			else
+			{
+				// 音の変更があるので、通常通りセットする
+				volumeController.setValue(volume, fadeInTimeByMS, fadeInEasing);
+			}
+
+			var enabled:Boolean = validateEnabled();
+
+			if (enabled)
+			{
+				volumeController.setEnabled(true);
+			}
+			else
+			{
+				volumeController.setEnabled(false);
+			}
+		}
+
+//--------------------------------------------------------------------------
+//
+//  Overridden Event handlers
+//
+//--------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------
+//
+//  Event handlers
+//
+//--------------------------------------------------------------------------
+
+		protected function onSoundCompleteHandler(event:Event):void
+		{
+			_soundChannel.removeEventListener(Event.SOUND_COMPLETE, onSoundCompleteHandler);
+
+			var currentVolume:Number = volumeController.value;
+			var currentPan:Number = panController.value;
+
 			if (loops == SoundLoopType.NO_LOOP || (loops != SoundLoopType.INFINITE_LOOP && currentLoopCount >= loops))
 			{
 				// 終了
-				dispose();
+				stop();
 			}
 			else if (loops == SoundLoopType.INFINITE_LOOP || currentLoopCount < loops)
 			{


Transferred from the Adobe Open Source Subversion Repository

Revision: 19980
Author:   chiedozi@adobe.com
Date:     2011-01-27T19:46:02.128372Z

Log Message:
-----------
TabbedViewNavigator now disables the TabBar when a child navigator is changing views
TabbedViewNavigator now enforces its tabBar skinpart to have its requireSelection property be true
Removed an unnecessary  validateNow from TabbedViewNavigator
Resolved some TODOs and FIXMEs

QE notes:
Doc notes:
Bugs:
Reviewer: Jason San Jose
Tests run:
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers/PersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewDescriptor.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as
@@ -9,7 +9,6 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-// TODO (chiedozi): Make private in view nav?
 package spark.components.supportClasses
 {
 import flash.utils.IDataInput;


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

--- frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as
+++ frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.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.
 //
 ////////////////////////////////////////////////////////////////////////////////


Revert "commented new trace"

Revert "commented new trace"

This reverts commit 94dce8179e59a86b75b0e930bced16272ad2e67a.

--- HLSPlugin/src/com/kaltura/hls/m2ts/M2TSFileHandler.as
+++ HLSPlugin/src/com/kaltura/hls/m2ts/M2TSFileHandler.as
@@ -358,7 +358,7 @@
 			if(isBestEffort)
 			{
 				// Force processing immediately. We only need a starting timestamp.
-				//trace("Extracting timestamps for BEF.");
+				trace("Extracting timestamps for BEF.");
 				_parser.handleBestEffortProcess();
 			}


Modify comment

Modify comment

--- krew-framework/krewfw/core/KrewPoolableActor.as
+++ krew-framework/krewfw/core/KrewPoolableActor.as
@@ -39,7 +39,7 @@
         /**
          * Poolable actor's constructor should be able to receive zero arguments
          * because KrewObjectPool instanciates it with no arguments.
-         * You can init instance in onPooledObjectCreate() handler.
+         * You can init instance in onPoolableInit() handler.
          */
         public function KrewPoolableActor() {
             poolable = true;


FLEX-33731: solves 'access of possibly undefined property' that pops up when trying to compile 'experimental.swc' with Falcon. Not sure if this is a valid difference between the old compiler and Falcon, or if I'm just working around an issue that needs fixin'

Signed-off-by: Erik de Bruin <c195b508e6f0c57aeafdb5e96947e2b79e6a4b40@ixsoftware.nl>

--- frameworks/projects/experimental/src/spark/containers/DeferredGroup.as
+++ frameworks/projects/experimental/src/spark/containers/DeferredGroup.as
@@ -955,8 +955,8 @@
 				// see https://bugs.adobe.com/jira/browse/SDK-25601
 				// https://bugs.adobe.com/jira/browse/SDK-25333
 				throw new Error( "You cannot use an IGraphicElement in a DeferredGroup, all elements must extend UIComponent" );
-				numGraphicElements++;
-				addingGraphicElementChild(element as IGraphicElement);
+				//numGraphicElements++;
+				//addingGraphicElementChild(element as IGraphicElement);
 				invalidateDisplayObjectOrdering();
 			}
 			else