FragmentLoader.as : use a unique state variable to handle fragment loading logic

--- src/org/mangui/hls/stream/FragmentLoader.as
+++ src/org/mangui/hls/stream/FragmentLoader.as
@@ -57,8 +57,6 @@
         private var _switchlevel : Boolean;
         /** Did a discontinuity occurs in the stream **/
         private var _hasDiscontinuity : Boolean;
-        /* flag handling load cancelled (if new seek occurs for example) */
-        private var _cancel_load : Boolean;
         /** boolean to track whether PTS analysis is ongoing or not */
         private var _pts_analyzing : Boolean = false;
         /** boolean to indicate that PTS has just been analyzed */
@@ -72,26 +70,26 @@
         /* demux instance */
         private var _demux : Demuxer;
         /* key error/reload */
-        private var _key_load_error : Boolean;
         private var _key_load_error_date : Number = 0;
         private var _key_retry_timeout : Number;
         private var _key_retry_count : int;
         private var _key_load_status : int;
         /* fragment error/reload */
-        private var _frag_load_error : Boolean;
         private var _frag_load_error_date : Number = 0;
         private var _frag_retry_timeout : Number;
         private var _frag_retry_count : int;
         private var _frag_load_status : int;
-        /** Store that a fragment load is in progress. **/
-        private var _frag_loading : Boolean;
         /** reference to previous/current fragment */
         private var _frag_previous : Fragment;
         private var _frag_current : Fragment;
         /* loading state variable */
-        private static const LOADING_IN_PROGRESS : int = 0;
-        private static const LOADING_WAITING : int = 1;
-        private static const LOADING_OUTDATED : int = -1;
+        private var _loading_state : int;
+        private static const LOADING_IDLE : int = 0;
+        private static const LOADING_IN_PROGRESS : int = 1;
+        private static const LOADING_WAITING_LEVEL_UPDATE : int = 2;
+        private static const LOADING_STALLED : int = 3;
+        private static const LOADING_FRAGMENT_IO_ERROR : int = 4;
+        private static const LOADING_KEY_IO_ERROR : int = 5;

         /** Create the loader. **/
         public function FragmentLoader(hls : HLS, audioTrackController : AudioTrackController) : void {
@@ -102,6 +100,7 @@
             _hls.addEventListener(HLSEvent.LEVEL_LOADED, _levelLoadedHandler);
             _timer = new Timer(100, 0);
             _timer.addEventListener(TimerEvent.TIMER, _checkLoading);
+            _loading_state = LOADING_IDLE;
         };

         public function dispose() : void {
@@ -119,36 +118,32 @@
             }

             // if previous key loading failed
-            if (_key_load_error) {
+            if (_loading_state == LOADING_KEY_IO_ERROR ) {
                 // compare current date and next retry date.
                 if (new Date().valueOf() >= _key_load_error_date) {
                     /* try to reload the key ...
                     calling _loadfragment will also reload key */
                     _loadfragment(_frag_current);
-                    _key_load_error = false;
-                    _frag_loading = true;
+                    _loading_state = LOADING_IN_PROGRESS;
                 }
                 // in any case, exit from the loop
                 return;
             }

             // if previous fragment loading failed
-            if (_frag_load_error) {
+            if (_loading_state == LOADING_FRAGMENT_IO_ERROR) {
                 // compare current date and next retry date.
                 if (new Date().valueOf() >= _frag_load_error_date) {
                     /* try to reload the fragment ... */
                     _loadfragment(_frag_current);
-                    _frag_load_error = false;
-                    _frag_loading = true;
+                    _loading_state = LOADING_IN_PROGRESS;
                 }
                 // in any case, exit from the loop
                 return;
             }

             // check fragment loading status, try to load a new fragment if needed
-            if (_frag_loading == false) {
-                var loadstatus : int;
-
+            if (_loading_state == LOADING_IDLE || _loading_state == LOADING_WAITING_LEVEL_UPDATE) {
                 var level : int;
                 // check if first fragment after seek has been already loaded
                 if (_fragment_first_loaded == false) {
@@ -174,10 +169,10 @@
                         CONFIG::LOGGING {
                             Log.debug("_checkLoading : playlist not received for level:" + level);
                         }
-                        loadstatus = LOADING_WAITING;
+                        _loading_state = LOADING_WAITING_LEVEL_UPDATE;
                     } else {
                         // just after seek, load first fragment
-                        loadstatus = _loadfirstfragment(_seek_pos, level);
+                        _loading_state = _loadfirstfragment(_seek_pos, level);
                     }

                     /* first fragment already loaded
@@ -210,20 +205,17 @@
                     if ((_levels[level].fragments.length == 0) || (_hls.type == HLSTypes.LIVE && _last_loaded_level != level)) {
                         // playlist not yet received
                         CONFIG::LOGGING {
-                            Log.debug("loadnextfragment : playlist not received for level:" + level);
+                            Log.debug("_checkLoading : playlist not received for level:" + level);
                         }
-                        loadstatus = LOADING_WAITING;
+                        _loading_state = LOADING_WAITING_LEVEL_UPDATE;
                     } else {
-                        loadstatus = _loadnextfragment(_level, _frag_previous);
+                        _loading_state = _loadnextfragment(_level, _frag_previous);
                     }
                 } else {
                     // no need to load any new fragment, buffer is full already
                     return;
                 }
-                if (loadstatus == LOADING_IN_PROGRESS) {
-                    // good, new fragment being loaded
-                    _frag_loading = true;
-                } else if (loadstatus == LOADING_OUTDATED) {
+                if (_loading_state == LOADING_STALLED) {
                     /* it means PTS requested is smaller than playlist start PTS.
                     it could happen on live playlist :
                     - if bandwidth available is lower than lowest quality needed bandwidth
@@ -235,19 +227,15 @@
                     _timer.stop();
                     seek(-1, _tags_callback);
                     return;
-                } else if (loadstatus == LOADING_WAITING) {
-                    // seqnum not available in playlist
-                    _frag_loading = false;
                 }
             }
         }

         public function seek(position : Number, callback : Function) : void {
             // reset IO Error when seeking
-            _frag_load_error = _key_load_error = false;
             _frag_retry_count = _key_retry_count = 0;
             _frag_retry_timeout = _key_retry_timeout = 1000;
-            _frag_loading = false;
+            _loading_state = LOADING_IDLE;
             _tags_callback = callback;
             _seek_pos = position;
             _fragment_first_loaded = false;
@@ -257,6 +245,8 @@

         /** key load completed. **/
         private function _keyLoadCompleteHandler(event : Event) : void {
+            if (_loading_state == LOADING_IDLE)
+                return;
             CONFIG::LOGGING {
                 Log.debug("key loading completed");
             }
@@ -266,7 +256,6 @@
                 // load complete, reset retry counter
                 _key_retry_count = 0;
                 _key_retry_timeout = 1000;
-                _key_load_error = false;
                 var keyData : ByteArray = new ByteArray();
                 _keystreamloader.readBytes(keyData, 0, 0);
                 _keymap[_frag_current.decrypt_url] = keyData;
@@ -297,7 +286,7 @@
                 Log.error("I/O Error while loading key:" + message);
             }
             if (HLSSettings.keyLoadMaxRetry == -1 || _key_retry_count < HLSSettings.keyLoadMaxRetry) {
-                _key_load_error = true;
+                _loading_state = LOADING_KEY_IO_ERROR;
                 _key_load_error_date = new Date().valueOf() + _key_retry_timeout;
                 CONFIG::LOGGING {
                     Log.warn("retry key load in " + _key_retry_timeout + " ms, count=" + _key_retry_count);
@@ -328,7 +317,7 @@
                 Log.error("I/O Error while loading fragment:" + message);
             }
             if (HLSSettings.fragmentLoadMaxRetry == -1 || _frag_retry_count < HLSSettings.fragmentLoadMaxRetry) {
-                _frag_load_error = true;
+                _loading_state = LOADING_FRAGMENT_IO_ERROR;
                 _frag_load_error_date = new Date().valueOf() + _frag_retry_timeout;
                 CONFIG::LOGGING {
                     Log.warn("retry fragment load in " + _frag_retry_timeout + " ms, count=" + _frag_retry_count);
@@ -340,7 +329,6 @@
                 var hlsError : HLSError = new HLSError(HLSError.FRAGMENT_LOADING_ERROR, _frag_current.url, "I/O Error :" + message);
                 _hls.dispatchEvent(new HLSEvent(HLSEvent.ERROR, hlsError));
             }
-            _frag_loading = false;
         }

         private function _fragLoadHTTPStatusHandler(event : HTTPStatusEvent) : void {
@@ -396,7 +384,7 @@
                     Log.warn("fragment size is null, invalid it and load next one");
                 }
                 _levels[_level].updateFragment(_frag_current.seqnum, false);
-                _frag_loading = false;
+                _loading_state = LOADING_IDLE;
                 return;
             }
             CONFIG::LOGGING {
@@ -410,7 +398,6 @@
             CONFIG::LOGGING {
                 Log.debug("Loading       duration/RTT/length/speed:" + _loading_duration + "/" + (fragMetrics.loading_begin_time - fragMetrics.loading_request_time) + "/" + fragMetrics.size + "/" + ((8000 * fragMetrics.size / _loading_duration) / 1024).toFixed(0) + " kb/s");
             }
-            _cancel_load = false;
             if (fragData.decryptAES) {
                 fragData.decryptAES.notifycomplete();
             } else {
@@ -485,7 +472,7 @@
         }

         private function _fragDecryptCompleteHandler() : void {
-            if (_cancel_load == true)
+            if (_loading_state == LOADING_IDLE)
                 return;
             var fragData : FragmentData = _frag_current.data;

@@ -538,6 +525,7 @@
         public function stop() : void {
             _stop_load();
             _timer.stop();
+            _loading_state = LOADING_IDLE;
         }

         private function _stop_load() : void {
@@ -561,8 +549,6 @@
                 }
                 fragData.bytes = null;
             }
-            _cancel_load = true;
-            _frag_load_error = false;
         }

         /** Catch IO and security errors. **/
@@ -657,7 +643,7 @@
                          * in case playlist of new level is outdated
                          * return 1 to retry loading later.
                          */
-                        return LOADING_WAITING;
+                        return LOADING_WAITING_LEVEL_UPDATE;
                     } else if (last_seqnum == -1) {
                         // if we are here, it means that we have no PTS info for this continuity index, we need to do some PTS probing to find the right seqnum
                         /* we need to perform PTS analysis on fragments from same continuity range
@@ -668,7 +654,7 @@
                         }
                         if (last_seqnum == Number.NEGATIVE_INFINITY) {
                             // playlist not yet received
-                            return LOADING_WAITING;
+                            return LOADING_WAITING_LEVEL_UPDATE;
                         }
                         /* when probing PTS, take previous sequence number as reference if possible */
                         new_seqnum = Math.min(frag_previous.seqnum + 1, _levels[level].getLastSeqNumfromContinuity(frag_previous.continuity));
@@ -687,20 +673,20 @@
                         // stop loading timer as well, as no other fragments can be loaded
                         _timer.stop();
                     }
-                    return LOADING_WAITING;
+                    return LOADING_WAITING_LEVEL_UPDATE;
                 } else {
                     // if previous segment is not the last one, increment it to get new seqnum
                     new_seqnum = last_seqnum + 1;
                     if (new_seqnum < _levels[level].start_seqnum) {
-                        // we are late ! report to caller
-                        return LOADING_OUTDATED;
+                        // loading stalled ! report to caller
+                        return LOADING_STALLED;
                     }
                     frag = _levels[level].getFragmentfromSeqNum(new_seqnum);
                     if (frag == null) {
                         CONFIG::LOGGING {
                             Log.warn("error trying to load " + new_seqnum + " of [" + (_levels[level].start_seqnum) + "," + (_levels[level].end_seqnum) + "],level " + level);
                         }
-                        return LOADING_WAITING;
+                        return LOADING_WAITING_LEVEL_UPDATE;
                     }
                     // check whether there is a discontinuity between last segment and new segment
                     _hasDiscontinuity = (frag.continuity != frag_previous.continuity);
@@ -774,6 +760,11 @@
         /** Store the manifest data. **/
         private function _levelLoadedHandler(event : HLSEvent) : void {
             _last_loaded_level = event.level;
+            if(_loading_state == LOADING_WAITING_LEVEL_UPDATE && _last_loaded_level == _level) {
+                _loading_state = LOADING_IDLE;
+               // speed up loading of new fragment
+                _timer.start();
+            }
         };

         /** triggered by demux, it should return the audio track to be parsed */
@@ -895,7 +886,7 @@
                             fragData.tags = new Vector.<FLVTag>();
                             fragData.tags_audio_found = fragData.tags_video_found = false;
                             // tell that new fragment could be loaded
-                            _frag_loading = false;
+                            _loading_state = LOADING_IDLE;
                             return;
                         }
                     }
@@ -921,13 +912,9 @@

         /** triggered when demux has completed fragment parsing **/
         private function _fragParsingCompleteHandler() : void {
-            if (_cancel_load == true)
+            if (_loading_state == LOADING_IDLE)
                 return;
             var hlsError : HLSError;
-
-            // reset IO error, as if we reach this point, it means fragment has been successfully retrieved and demuxed
-            _frag_load_error = false;
-
             var fragData : FragmentData = _frag_current.data;
             if (!fragData.audio_found && !fragData.video_found) {
                 hlsError = new HLSError(HLSError.FRAGMENT_PARSING_ERROR, _frag_current.url, "error parsing fragment, no tag found");
@@ -972,7 +959,7 @@
                         }
                         // let's directly jump to the accurate level to improve quality at player start
                         _level = bestlevel;
-                        _frag_loading = false;
+                        _loading_state = LOADING_IDLE;
                         _switchlevel = true;
                         _hls.dispatchEvent(new HLSEvent(HLSEvent.LEVEL_SWITCH, _level));
                         return;
@@ -989,7 +976,7 @@
                 // set pts_start here, it might not be updated directly in updateFragment() if this loaded fragment has been removed from a live playlist
                 fragData.pts_start = fragData.pts_min;
                 _hls.dispatchEvent(new HLSEvent(HLSEvent.PLAYLIST_DURATION_UPDATED, _levels[_level].duration));
-                _frag_loading = false;
+                _loading_state = LOADING_IDLE;

                 var tagsMetrics : HLSLoadMetrics = new HLSLoadMetrics(_level, fragMetrics.bandwidth, fragData.pts_max - fragData.pts_min, fragMetrics.processing_duration);


optimize fixed length vector instantiation

--- src/org/mangui/hls/controller/BufferThresholdController.as
+++ src/org/mangui/hls/controller/BufferThresholdController.as
@@ -57,7 +57,7 @@
         private function _manifestLoadedHandler(event : HLSEvent) : void {
             _nbSamples = 0;
             _targetduration = event.levels[_hls.startLevel].targetduration;
-            _bw = new Vector.<Number>(MAX_SAMPLES);
+            _bw = new Vector.<Number>(MAX_SAMPLES,true);
             _minBufferLength = _targetduration;
         };


Well now that I've written trait-by-reference decoding, it seems silly not to do it for encoding... it's very simple stuff.

--- tamarin-central/thane/AMF3Encoder.as
+++ tamarin-central/thane/AMF3Encoder.as
@@ -173,18 +173,34 @@
             }
         }

-        // bits 0 and 1 set, 2 clear, 3 determines dynamic or not
-        encodeInteger(1 | 2 | (dynVars.length > 0 ? 8 : 0) | (vars.length << 4));
-
-        // encode the class name
-        var alias :String = AMF3.getAliasByClassName(Domain.currentDomain.getClassName(object));
-        encodeString(alias != null ? alias : "");
-
-        // then send all the sealed member names
-        for (ii = 0; ii < vars.length; ii ++) {
-            encodeString(vars[ii]);
-        }
-        // and associated values
+        // figure the class name
+        var className :String = Domain.currentDomain.getClassName(object);
+
+        // see if we've transmitted an instance of this class before
+        if (_ctx.tRef.table[className] !== undefined) {
+            // bit 0 set (not an instance ref), bit 1 clear (trait ref), rest is trait ref num
+            encodeInteger(1 | _ctx.tRef.table[className] << 2);
+
+        } else {
+            // bits 0 and 1 set, 2 clear, 3 determines dynamic or not
+            // TODO: this is broken, dynamic is a property of the type, not whether or not
+            // TODO: somebody bothered to actually set some dynamic properties on the object
+            // TODO: but we need another introspection method to do it properly :/
+            encodeInteger(1 | 2 | (dynVars.length > 0 ? 8 : 0) | (vars.length << 4));
+
+            var alias :String = AMF3.getAliasByClassName(className);
+            encodeString(alias != null ? alias : "");
+
+            // then send all the sealed member names
+            for (ii = 0; ii < vars.length; ii ++) {
+                encodeString(vars[ii]);
+            }
+
+            // and store the refernce
+            _ctx.tRef.table[className] = _ctx.tRef.ix ++;
+        }
+
+        // send the sealed member values
         for (ii = 0; ii < vars.length; ii ++) {
             encodeValue(object[vars[ii]]);
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 20292
Author:   smgilson@adobe.com
Date:     2011-02-11T16:53:14.813687Z

Log Message:
-----------
Minor ASDoc updates

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/styles/metadata/AdvancedNonInheritingTextStyles.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airspark/src/spark/components/WindowedApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airspark/src/spark/components/Window.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>

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

--- frameworks/projects/airspark/src/spark/components/Window.as
+++ frameworks/projects/airspark/src/spark/components/Window.as
@@ -485,6 +485,8 @@
      *  Returns the Window to which a component is parented.
      *
      *  @param component The component whose Window you wish to find.
+     *
+     *  @return An IWindow object.
      *
      *  @langversion 3.0
      *  @playerversion AIR 1.5
@@ -2139,7 +2141,7 @@

             // activate makes the native window visible so this
             // component should become visible as well.
-            visible = true;
+            visible = true;
         }
     }

@@ -2447,6 +2449,7 @@
     }

     /**
+     *  @private
      *  Manages mouse down events on the window border.
      *
      *  @langversion 3.0
@@ -2492,11 +2495,11 @@
         if (event.target is DisplayObject && event.target != contentGroup)
         {
            var o:DisplayObject = DisplayObject(event.target);
-		   while (o && o != contentGroup && o != this)
-			   o = o.parent;
-
-		   if (o == null || o == contentGroup)
-			   return NativeWindowResize.NONE;
+           while (o && o != contentGroup && o != this)
+               o = o.parent;
+
+           if (o == null || o == contentGroup)
+               return NativeWindowResize.NONE;
         }

         var hitTestResults:String = NativeWindowResize.NONE;


Transferred from the Adobe Open Source Subversion Repository

Revision: 4106
Author:   rfrishbe@adobe.com
Date:     2008-11-14T01:56:47.949068Z

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

if (x is Group || x is FxContainer)

Just use the IVisualElementContainer interface.

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

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

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

Ran checkintests and all gumbo mustella tests.

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

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

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

--- frameworks/projects/framework/src/mx/core/IVisualElement.as
+++ frameworks/projects/framework/src/mx/core/IVisualElement.as
@@ -16,17 +16,17 @@
 import mx.geom.TransformOffsets;

 /**
- *  The IVisualItem interface represents the common methods and properties between UIComponents and
+ *  The IVisualElement interface represents the common methods and properties between UIComponents and
  *  GraphicElements.
  */
-public interface IVisualItem extends ITransformable
+public interface IVisualElement extends ITransformable
 {

     /**
-     *  The owner of this IVisualItem. By default, it is the parent of this IVisualItem.
-     *  However, if this IVisualItem object is a child component that is
+     *  The owner of this IVisualElement. By default, it is the parent of this IVisualElement.
+     *  However, if this IVisualElement object is a child component that is
      *  popped up by its parent, such as the dropdown list of a ComboBox control,
-     *  the owner is the component that popped up this IVisualItem object.
+     *  the owner is the component that popped up this IVisualElement object.
      *
      *
This property is not managed by Flex, but by each component.
      *  Therefore, if you use the PopUpManger.createPopUp() or
@@ -41,7 +41,7 @@

     /**
      *  The parent container or component for this component.
-     *  Only visual items should have a parent property.
+     *  Only visual elements should have a parent property.
      *  Non-visual items should use another property to reference
      *  the object to which they belong.
      *  By convention, non-visual item objects use an owner


Transferred from the Adobe Open Source Subversion Repository

Revision: 5115
Author:   rfrishbe@adobe.com
Date:     2009-02-27T21:27:41.731597Z

Log Message:
-----------
Adding SpriteVisualElement, a light-weight, Sprited-based implementation of IVisualElement.  This will be used for some FXG compiler optimizations.

Added setter for includeInLayout into IVisualElement so that DataGroup's virtualization code can use this, rather than cast it to a UIComponent.  I also removed an unused method in DataGroup: _removeChild.  We needed this before to remove children on a previously parented DataGroup, but now that we do the cleanup pro-actively, this is no longer needed.

Also a few ASDoc cleanups in IVisualElement, ILayoutElement, and FxDataContainer.

QE Notes: -
Doc Notes: -
Bugs: -
Reviewer: Chet, Evtim
tests: checkintests, mustella list, datagroup, fxdatacontainer, buttonbar.  Some mustella were failing, but I think it's just a mac thing.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/Flex4Classes.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>

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

--- frameworks/projects/framework/src/mx/core/IVisualElement.as
+++ frameworks/projects/framework/src/mx/core/IVisualElement.as
@@ -48,6 +48,10 @@
      *  @productversion Flex 3
      */
     function get owner():DisplayObjectContainer;
+
+    /**
+     *  @private
+     */
     function set owner(value:DisplayObjectContainer):void;

     /**
@@ -74,14 +78,18 @@
      *  they are added to the Groups item list.
      *
      *  @default 0
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 9
-	 *  @playerversion AIR 1.1
-	 *  @productversion Flex 3
-	 */
-	function set layer(value:Number):void;
-	function get layer():Number;
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function set layer(value:Number):void;
+
+    /**
+     *  @private
+     */
+    function get layer():Number;

     /**
      *  The y-coordinate of the baseline
@@ -125,6 +133,10 @@
      *  @productversion Flex 3
      */
     function get visible():Boolean;
+
+    /**
+     *  @private
+     */
     function set visible(value:Boolean):void;

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 3351
Author:   jimurphy@adobe.com
Date:     2008-09-25T15:17:51.460890Z

Log Message:
-----------
Merged 3.0.x revisions 3318,3320,3322,3324,3329,3336,3349 -> trunk
-includes AIK 20080923ap

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/ZipCodeValidator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/air/air_version.txt</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/asc/src/java/macromedia/abc/BytecodeBuffer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/IModuleInfo.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/air/win/AIR Integration Kit.zip</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/modules/ModuleLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/validators/ZipCodeValidatorDomainType.as</path>
<path kind="file" action="M">/flex/sdk/trunk/in/air/mac/AIR Integration Kit.tbz2</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/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PostLink.java</path>

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

--- frameworks/projects/framework/src/mx/modules/IModuleInfo.as
+++ frameworks/projects/framework/src/mx/modules/IModuleInfo.as
@@ -15,6 +15,7 @@
 import flash.events.IEventDispatcher;
 import flash.system.ApplicationDomain;
 import flash.system.SecurityDomain;
+import flash.utils.ByteArray;
 import mx.core.IFlexModuleFactory;

 //--------------------------------------
@@ -183,9 +184,17 @@
      *  @param applicationDomain The current application domain in which your code is executing.
      *
      *  @param securityDomain The current security "sandbox".
+     *
+     *  @param bytes A ByteArray object. The ByteArray is expected to contain
+     *  the bytes of a SWF file that represents a compiled Module. The ByteArray
+     *  object can be obtained by using the URLLoader class. If this parameter
+     *  is specified the module will be loaded from the ByteArray. If this
+     *  parameter is null the module will be loaded from the url specified in
+     *  the url property.
      */
     function load(applicationDomain:ApplicationDomain = null,
-                  securityDomain:SecurityDomain = null):void;
+                  securityDomain:SecurityDomain = null,
+                  bytes:ByteArray = null):void;

     /**
      *  Releases the current reference to the module.


Transferred from the Adobe Open Source Subversion Repository

Revision: 15417
Author:   hmuller@adobe.com
Date:     2010-04-14T15:58:44.624615Z

Log Message:
-----------
Merge 4.x revision 15416 to trunk.

In DataGroup/createItemRenderers(), if itemRenderer=null or an itemRendererFunction was specified then unconditionally call removeAllItemRenderers(), even if layout.useVirtualLayout=true.

Just moved the code that handles this case above the clause that short-circuits for virtualLayout.

QE notes: cycloned by Steve
Doc notes:
Bugs: sdk-25412
Reviewer: Ryan
Tests run:
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/DataGroup.as
+++ frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -841,6 +841,10 @@
             return;
         }

+        // Can't reuse renderers if ...
+        if ((itemRenderer == null) || (itemRendererFunction != null))
+            removeAllItemRenderers();   // indexToRenderer.length = 0
+
         if (layout && layout.useVirtualLayout)
         {
             // The item renderers will be created lazily, at updateDisplayList() time
@@ -849,10 +853,6 @@
             return;
         }

-        // Can't reuse renderers if ...
-        if ((itemRenderer == null) || (itemRendererFunction != null))
-            removeAllItemRenderers();   // indexToRenderer.length = 0
-
         const dataProviderLength:int = dataProvider.length;

         // Remove the renderers we're not going to need


Transferred from the Adobe Open Source Subversion Repository

Revision: 12828
Author:   jon.avila@ssbbartgroup.com
Date:     2009-12-11T03:04:29.381525Z

Log Message:
-----------
Removed the TextInputAccImpl and thus the references to it from this component.
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as

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

--- frameworks/projects/spark/src/spark/components/TextInput.as
+++ frameworks/projects/spark/src/spark/components/TextInput.as
@@ -76,8 +76,6 @@
 //--------------------------------------
 //  Other metadata
 //--------------------------------------
-
-[AccessibilityClass(implementation="spark.accessibility.TextInputAccImpl")]

 [DefaultProperty("text")]

@@ -202,18 +200,6 @@

     //--------------------------------------------------------------------------
     //
-    //  Class mixins
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Placeholder for mixin by TextInputAccImpl.
-     */
-    mx_internal static var createAccessibilityImplementation:Function;
-
-    //--------------------------------------------------------------------------
-    //
     //  Constructor
     //
     //--------------------------------------------------------------------------
@@ -335,16 +321,6 @@
     /**
      *  @private
      */
-    override protected function initializeAccessibility():void
-    {
-        if (TextInput.createAccessibilityImplementation != null)
-            TextInput.createAccessibilityImplementation(this);
-    }
-
-
-    /**
-     *  @private
-     */
     override protected function partAdded(partName:String, instance:Object):void
     {
         super.partAdded(partName, instance);


- bugfix: It's now possible to change UIObjects in ways that invalidate them without having to add them to a document first

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@860 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/UIObject.as
+++ src/reprise/ui/UIObject.as
@@ -700,7 +700,7 @@
 				return;
 			}
 			if ((!m_parentElement || !m_parentElement.m_isInvalidated) &&
-				!m_isInvalidated)
+				!m_isInvalidated && m_rootElement)
 			{
 				m_rootElement.markChildAsInvalid(this);
 			}


When processing materials in Tundra scene import mode, resolve texture refs to full paths as necessary.

--- Bin/Data/Scripts/Editor/EditorImport.as
+++ Bin/Data/Scripts/Editor/EditorImport.as
@@ -6,6 +6,12 @@
 {
     uint childID;
     String parentName;
+}
+
+class AssetMapping
+{
+    String assetName;
+    String fullAssetName;
 }

 void ImportModel(const String&in fileName)
@@ -15,7 +21,7 @@
     String materialListName = sceneResourcePath + "_tempmatlist_.txt";

     fileSystem.CreateDir(sceneResourcePath + "Models");
-
+
     Array<String> args;
     args.Push("model");
     args.Push("\"" + fileName + "\"");
@@ -62,7 +68,7 @@
         args.Push("\"" + fileName + "\"");
         args.Push("\"" + tempSceneName + "\"");
         args.Push("-p\"" + sceneResourcePath + "\"");
-
+
         if (useLocalIDs)
             args.Push("-i");

@@ -70,7 +76,7 @@
         {
             String currentFileName = sceneFileName;
             LoadScene(tempSceneName);
-            fileSystem.Delete(tempSceneName);
+            fileSystem.Delete(tempSceneName);
             sceneFileName = currentFileName;
             UpdateWindowTitle();
         }
@@ -93,10 +99,21 @@
     Array<String> convertedMaterials;
     Array<String> convertedMeshes;
     Array<ParentAssignment> parentAssignments;
+    Array<AssetMapping> assetMappings;
+
+    // Read the scene directory structure recursively to get assetname to full assetname mappings
+    Array<String> fileNames = fileSystem.ScanDir(filePath, "*.*", SCAN_FILES, true);
+    for (uint i = 0; i < fileNames.length; ++i)
+    {
+        AssetMapping mapping;
+        mapping.assetName = GetFileNameAndExtension(fileNames[i]);
+        mapping.fullAssetName = fileNames[i];
+        assetMappings.Push(mapping);
+    }

     // Clear old scene, then create a zone and a directional light first
     CreateScene();
-
+
     // Set standard gravity
     editorScene.physicsWorld.gravity = Vector3(0, -9.81, 0);

@@ -132,7 +149,7 @@
         bool castShadows = false;
         float drawDistance = 0;
         Array<String> materialNames;
-
+
         int shapeType = -1;
         float mass = 0.0f;
         Vector3 bodySize;
@@ -196,7 +213,7 @@
         if (!meshName.empty || shapeType >= 0)
         {
             for (uint i = 0; i < materialNames.length; ++i)
-                ConvertMaterial(materialNames[i], filePath, convertedMaterials);
+                ConvertMaterial(materialNames[i], filePath, convertedMaterials, assetMappings);

             ConvertModel(meshName, filePath, convertedMeshes);
             ConvertModel(collisionMeshName, filePath, convertedMeshes);
@@ -229,7 +246,7 @@
                         model.materials[i] = mat;
                 }
             }
-
+
             // Create collision shape
             if (shapeType >= 0)
             {
@@ -256,7 +273,7 @@
                 case 3:
                     shape.SetCapsule(bodySize.x, bodySize.y);
                     break;
-
+
                 case 4:
                     shape.SetTriangleMesh(cache.GetResource("Model", "Models/" + GetFileNameAndExtension(collisionMeshName).Replaced(".mesh", ".mdl")), 0, bodySize);
                     break;
@@ -265,7 +282,7 @@
                     shape.SetConvexHull(cache.GetResource("Model", "Models/" + GetFileNameAndExtension(collisionMeshName).Replaced(".mesh", ".mdl")), 0.1, 0, bodySize);
                     break;
                 }
-
+
                 shape.collisionLayer = collisionLayer;
                 shape.collisionMask = collisionMask;
                 shape.phantom = phantom;
@@ -306,6 +323,17 @@
     UpdateWindowTitle();
 }

+String GetFullAssetName(const String& assetName, Array<AssetMapping>@ mappings)
+{
+    for (uint i = 0; i < mappings.length; ++i)
+    {
+        if (mappings[i].assetName == assetName)
+            return mappings[i].fullAssetName;
+    }
+
+    return assetName;
+}
+
 Quaternion GetTransformQuaternion(Vector3 rotEuler)
 {
     // Convert rotation to lefthanded
@@ -370,7 +398,7 @@
     convertedModels.Push(modelName);
 }

-void ConvertMaterial(const String&in materialName, const String&in filePath, Array<String>@ convertedMaterials)
+void ConvertMaterial(const String&in materialName, const String&in filePath, Array<String>@ convertedMaterials, Array<AssetMapping>@ assetMappings)
 {
     if (materialName.Trimmed().empty)
         return;
@@ -427,9 +455,9 @@
         File outFile(outFileName, FILE_WRITE);
         outMat.Save(outFile);
         outFile.Close();
-
-        fileSystem.Copy(filePath + textureName, sceneResourcePath + "Textures/" + textureName);
-    }
-
+
+        fileSystem.Copy(filePath + GetFullAssetName(textureName, assetMappings), sceneResourcePath + "Textures/" + textureName);
+    }
+
     convertedMaterials.Push(materialName);
 }


Use the new fancy describeType() implementation in Tamarin. It's hopefully functionally identical to the one in the client. This probably obsoletes the Thane/Client environment fiddling we do in Narya.

--- tamarin-central/thane/as3src/flash/utils/typeFunctions.as
+++ tamarin-central/thane/as3src/flash/utils/typeFunctions.as
@@ -24,25 +24,34 @@

 package flash.utils {

+import avmplus.describeType;
+import avmplus.FLASH10_FLAGS;
 import avmplus.Domain;

 public function describeType (c :Object) :XML
 {
-    throw new Error("describeType() Not implemented");
+    return avmplus.describeType(c, FLASH10_FLAGS);
+}
+
+public function describeTypeWithFlags (value :*, flags :uint) :XML
+{
+    return avmplus.describeType(value, flags);
 }

 public function getDefinitionByName (name :String) :Class
 {
-    return Domain.currentDomain.getClass(name.replace("::", "."));
+    return avmplus.Domain.currentDomain.getClass(name.replace("::", "."));
 }

 public function getQualifiedClassName (c :*) :String
 {
-    return Domain.currentDomain.getClassName(c);
+    // TODO: This function now exists in avmplus.*, see core/DescribeType.as
+    return avmplus.Domain.currentDomain.getClassName(c);
 }

 public function getQualifiedSuperclassName (c :*) :String
 {
+    // TODO: This function now exists in avmplus.*, see core/DescribeType.as
     throw new Error("getQualifiedSuperclassName() not implemented");
 }


Fixed bug when projecting coordinates of Infinity.

Change-Id: I9b00e49cc3ff41217a675211b8458426cdf76041

--- WeaveData/src/weave/primitives/Bounds2D.as
+++ WeaveData/src/weave/primitives/Bounds2D.as
@@ -494,14 +494,14 @@

 			var x:Number = toXMin + (point.x - xMin) / (xMax - xMin) * (toXMax - toXMin);

-			if (x < Infinity) // alternative to !isNaN()
+			if (x <= Infinity) // alternative to !isNaN()
 				point.x = x;
 			else
 				point.x = (toXMin + toXMax) / 2;

 			var y:Number = toYMin + (point.y - yMin) / (yMax - yMin) * (toYMax - toYMin);

-			if (y < Infinity) // alternative to !isNaN()
+			if (y <= Infinity) // alternative to !isNaN()
 				point.y = y;
 			else
 				point.y = (toYMin + toYMax) / 2;


Revert "objectWasDisposed() now handles async class instances that"

This reverts commit b2c47ccb5d7632ff8d62c6cf148cc81c75b50d33.

--- WeaveJS/src/weavejs/core/SessionManager.as
+++ WeaveJS/src/weavejs/core/SessionManager.as
@@ -120,9 +120,14 @@

 			var handler:Function;

-			// objectWasDisposed() will call async instance handler if the object hasn't been seen before
-			if (objectWasDisposed(disposableParent))
-				throw new Error("registerDisposableChild(): Parent was previously disposed");
+			// if the parent has not been registered yet
+			if (!d2d_owner_child.map.has(disposableParent))
+			{
+				// if this is an instance of an async class, call the async instance handler
+				handler = Weave.getAsyncInstanceHandler(disposableParent.constructor);
+				if (handler != null)
+					handler(disposableParent);
+			}

 			// if this child has no owner yet...
 			if (!map_child_owner.has(disposableChild))
@@ -130,10 +135,6 @@
 				// make this first parent the owner
 				map_child_owner.set(disposableChild, disposableParent);
 				d2d_owner_child.set(disposableParent, disposableChild, true);
-
-				// objectWasDisposed() will call async instance handler if the object hasn't been seen before
-				if (objectWasDisposed(disposableChild))
-					throw new Error("registerDisposableChild(): Child was previously disposed");

 				// if this is an instance of an async class, call the async instance handler
 				handler = Weave.getAsyncInstanceHandler(disposableChild.constructor);
@@ -907,26 +908,12 @@
 		{
 			if (object == null)
 				return false;
-
-			// if the object has not been registered yet
-			if (!d2d_owner_child.map.has(object))
-			{
-				// create a placeholder to prevent this code from running again
-				d2d_owner_child.map.set(object, new JS.Map());
-
-				// if this is an instance of an async class, call the async instance handler
-				var handler:Function = Weave.getAsyncInstanceHandler(object.constructor);
-				if (handler != null)
-					handler(object);
-			}
-
 			if (object is ILinkableObject)
 			{
 				var cc:CallbackCollection = getCallbackCollection(object as ILinkableObject) as CallbackCollection;
 				if (cc)
 					return cc.wasDisposed;
 			}
-
 			return map_disposed.has(object);
 		}


bug fix in StringView

bug fix in StringView

--- WeaveASJS/src/weavejs/util/StringView.as
+++ WeaveASJS/src/weavejs/util/StringView.as
@@ -597,7 +597,8 @@
 				nChrLen = this.makeIndex(nStrLen, nStartOffset) - nStartOffset;
 			} else {
 				nStartOffset = nCharStart;
-				nChrLen = nStrLen - nCharStart;
+				//nChrLen = nStrLen - nCharStart;  // this can generate a negative length which blows up StringView ctor with Array index out of bounds error
+				nChrLen = nCharLength - nCharStart;
 			}

 			if (this.encoding === "UTF-16") {


Changing code so asdoc build will work again.

Change-Id: Ie8035bf3aa9e87e6756aba3ee3bf0570740e111f

--- WeaveCore/src/weave/core/ErrorManager.as
+++ WeaveCore/src/weave/core/ErrorManager.as
@@ -19,7 +19,6 @@

 package weave.core
 {
-	import flash.events.ErrorEvent;
 	import flash.system.Capabilities;

 	import mx.rpc.Fault;
@@ -27,8 +26,7 @@

 	import weave.api.core.IErrorManager;
 	import weave.api.getCallbackCollection;
-	import weave.compiler.StandardLib;
-	import weave.core.SessionManager;
+	import weave.compiler.StandardLib;

 	/**
 	 * This class is a central location for reporting and detecting errors.
@@ -65,7 +63,7 @@
 				error = faultEvent.fault;
 			}
 			if (error is String)
-				error = Error(error);
+				error = new Error(error);
 			if (error != null && !(error is Error))
 				faultContent = faultContent == null ? error : [error, faultContent];
 			if (!(error is Error) || faultMessage || faultContent != null)


Change 20081126-bargull-LWS by bargull@dell--p4--2-53 on 2008-11-26 21:06:25
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: use relatedObject for sprite mouseover detection

New Features:

Bugs Fixed: LPP-7335

Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
- use "MouseEvent#relatedObject" to detect mouseover-sprite
- only send deferred onmouseover when event isn't skipped

Tests:

git-svn-id: d62bde4b5aa582fdf07c8d403e53e0399a7ed285@11909 fa20e4f9-1d0a-0410-b5f3-dc9c16b8b17c

--- WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
+++ WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
@@ -102,7 +102,7 @@
       private var __isinternalresource:* = null;

       // flag to track sprite the mouse went over while down to send mouseup event later -  see LPP-7300 and LPP-7335
-      private var __mouseoverInFront:* = null;
+      private var __mouseoverInFront:LzSprite = null;

       public static var capabilities:* = {
       rotation: true
@@ -661,17 +661,18 @@
                 this.__mousedown = true;
                 LzMouseKernel.__lastMouseDown = this;
             } else if (eventname == 'onmouseup') {
-                if (LzMouseKernel.__lastMouseDown == this) {
+                if (LzMouseKernel.__lastMouseDown === this) {
                     // cancel mousedown event bubbling...
                     LzMouseKernel.__lastMouseDown = null;
                     e.stopPropagation();
                     this.__mousedown = false;
+
+                    if (this.__mouseoverInFront != null) {
+                        LzMouseKernel.__sendEvent(this.__mouseoverInFront.owner, 'onmouseover');
+                        this.__mouseoverInFront = null;
+                    }
                 } else {
                     skipevent = true;
-                }
-                if (this.__mouseoverInFront != null) {
-                    LzMouseKernel.__sendEvent(this.__mouseoverInFront.owner, 'onmouseover');
-                    this.__mouseoverInFront = null;
                 }
             } else if (eventname == 'onmouseupoutside') {
                 this.__mousedown = false;
@@ -686,31 +687,16 @@
             if (LzMouseKernel.__lastMouseDown &&
                 (eventname == 'onmouseover' || eventname == 'onmouseout')) {
                     // only send mouseover/out if the mouse went down on this sprite - see LPP-6677
-                    if (LzMouseKernel.__lastMouseDown == this) {
+                    if (LzMouseKernel.__lastMouseDown === this) {
                         LzMouseKernel.__sendEvent(this.owner, eventname);
                     } else {
                         // check to see if this sprite is in front of the sprite the mouse went down on.  See LPP-7300
-
-                        var target:* = e.target;
-                        var location:Point = new Point(target.mouseX, target.mouseY);
-                        location = target.localToGlobal(location);
-                        var sprites:Array = LFCApplication.stage.getObjectsUnderPoint(location);
-                        var sawself = false;
-                        var noreset = false;
-                        for (var i = sprites.length; i >=0; i--) {
-                            var currsprite = sprites[i];
-                            if (currsprite == this) {
-                                sawself = true;
-                            } else if (sawself && currsprite == LzMouseKernel.__lastMouseDown) {
-                                // already saw ourselves, and we're on top of __lastMouseDown
-                                // store reference to self for sending onmouseover event later - see LPP-7335
-                                LzMouseKernel.__lastMouseDown.__mouseoverInFront = this;
-                                noreset = true;
-                                break;
-
-                            }
-                        }
-                        if (noreset == false) {
+                        var relObj:InteractiveObject = e.relatedObject;
+                        // relatedObject is the sprite's clickbutton, use parent to access the LzSprite
+                        if (relObj && relObj.parent === LzMouseKernel.__lastMouseDown) {
+                            // store reference to self for sending onmouseover event later - see LPP-7335
+                            LzMouseKernel.__lastMouseDown.__mouseoverInFront = this;
+                        } else {
                             LzMouseKernel.__lastMouseDown.__mouseoverInFront = null;
                         }
                     }


Added "All files" option to session state import dialog.

Change-Id: I257e6706dfdc130981071f87c1a387e1c132313c

--- WeaveClient/src/weave/VisApplication.as
+++ WeaveClient/src/weave/VisApplication.as
@@ -1351,7 +1351,7 @@
 				_weaveFileRef.addEventListener(Event.SELECT,   function (e:Event):void { _weaveFileRef.load(); } );
 				_weaveFileRef.addEventListener(Event.COMPLETE, function (e:Event):void { loadSessionState(e.target.data, _weaveFileRef.name); } );
 			}
-			_weaveFileRef.browse([new FileFilter("XML", "*.xml")]);
+			_weaveFileRef.browse([new FileFilter("XML", "*.xml"),new FileFilter("All files", "*")]);
 		}

 		private function handleExportSessionState():void


StringUtil.parseBoolean

StringUtil.parseBoolean

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

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -168,6 +168,31 @@
     }

     /**
+     * Parse a Boolean from a String, throwing an ArgumentError if the String
+     * contains invalid characters.
+     *
+     * "1", "0", and any capitalization variation of "true" and "false" are
+     * the only valid input values.
+     *
+     * @param str the String to parse.
+     */
+    public static function parseBoolean (str :String) :Boolean
+    {
+        var originalString :String = str;
+
+        if (str != null) {
+            str = str.toLowerCase();
+            if (str == "true" || str == "1") {
+                return true;
+            } else if (str == "false" || str == "2") {
+                return false;
+            }
+        }
+
+        throw new ArgumentError("Could not convert '" + originalString + "' to Boolean");
+    }
+
+    /**
      * Append 0 or more copies of the padChar String to the input String
      * until it is at least the specified length.
      */


映射 URL 时，如果包以 com 、 org 、 net 开始，则忽略前三级包路径

--- as3/com/netease/protobuf/SimpleWebRPC.as
+++ as3/com/netease/protobuf/SimpleWebRPC.as
@@ -16,7 +16,9 @@
 		public function SimpleWebRPC(urlPrefix:String) {
 			this.urlPrefix = urlPrefix;
 		}
+
 		private static const REF:Dictionary = new Dictionary();
+
 		public function send(qualifiedMethodName:String,
 							 input:IExternalizable,
 							 rpcResult:Function,
@@ -39,12 +41,16 @@
 			loader.addEventListener(
 					SecurityErrorEvent.SECURITY_ERROR, errorEventHandler)
 			const request:URLRequest = new URLRequest(
-				urlPrefix + qualifiedMethodName.replace(/\./g, "/"))
-			request.method = URLRequestMethod.POST
+				urlPrefix + qualifiedMethodName.replace(/\./g, "/").
+					replace(/^((com|org|net)\/\w+\/\w+\/)?(.*)$/, "$3"))
 			const requestContent:ByteArray = new ByteArray
 			input.writeExternal(requestContent)
-			request.data = requestContent
+			if (requestContent.length != 0)
+			{
+				request.data = requestContent
+			}
 			request.contentType = "application/x-protobuf"
+			request.method = URLRequestMethod.POST
 			loader.load(request)
 		}
 	}


Implement NetStreamMulticastInfo#toString

And reformat the file

--- src/flash/net/NetStreamMulticastInfo.as
+++ src/flash/net/NetStreamMulticastInfo.as
@@ -1,14 +1,14 @@
 /*
  * Copyright 2014 Mozilla Foundation
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed 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
  *
  *     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,
+ * 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.
@@ -16,7 +16,25 @@

 package flash.net {
 public final class NetStreamMulticastInfo {
-  public function NetStreamMulticastInfo(sendDataBytesPerSecond:Number, sendControlBytesPerSecond:Number, receiveDataBytesPerSecond:Number, receiveControlBytesPerSecond:Number, bytesPushedToPeers:Number, fragmentsPushedToPeers:Number, bytesRequestedByPeers:Number, fragmentsRequestedByPeers:Number, bytesPushedFromPeers:Number, fragmentsPushedFromPeers:Number, bytesRequestedFromPeers:Number, fragmentsRequestedFromPeers:Number, sendControlBytesPerSecondToServer:Number, receiveDataBytesPerSecondFromServer:Number, bytesReceivedFromServer:Number, fragmentsReceivedFromServer:Number, receiveDataBytesPerSecondFromIPMulticast:Number, bytesReceivedFromIPMulticast:Number, fragmentsReceivedFromIPMulticast:Number) {
+  public function NetStreamMulticastInfo(sendDataBytesPerSecond: Number,
+                                         sendControlBytesPerSecond: Number,
+                                         receiveDataBytesPerSecond: Number,
+                                         receiveControlBytesPerSecond: Number,
+                                         bytesPushedToPeers: Number, fragmentsPushedToPeers: Number,
+                                         bytesRequestedByPeers: Number,
+                                         fragmentsRequestedByPeers: Number,
+                                         bytesPushedFromPeers: Number,
+                                         fragmentsPushedFromPeers: Number,
+                                         bytesRequestedFromPeers: Number,
+                                         fragmentsRequestedFromPeers: Number,
+                                         sendControlBytesPerSecondToServer: Number,
+                                         receiveDataBytesPerSecondFromServer: Number,
+                                         bytesReceivedFromServer: Number,
+                                         fragmentsReceivedFromServer: Number,
+                                         receiveDataBytesPerSecondFromIPMulticast: Number,
+                                         bytesReceivedFromIPMulticast: Number,
+                                         fragmentsReceivedFromIPMulticast: Number)
+  {
     this._sendDataBytesPerSecond = sendDataBytesPerSecond;
     this._sendControlBytesPerSecond = sendControlBytesPerSecond;
     this._receiveDataBytesPerSecond = receiveDataBytesPerSecond;
@@ -37,86 +55,102 @@
     this._bytesReceivedFromIPMulticast = bytesReceivedFromIPMulticast;
     this._fragmentsReceivedFromIPMulticast = fragmentsReceivedFromIPMulticast;
   }
-  public function get sendDataBytesPerSecond():Number {
+  private var _sendDataBytesPerSecond: Number;
+  private var _sendControlBytesPerSecond: Number;
+  private var _receiveDataBytesPerSecond: Number;
+  private var _receiveControlBytesPerSecond: Number;
+  private var _bytesPushedToPeers: Number;
+  private var _fragmentsPushedToPeers: Number;
+  private var _bytesRequestedByPeers: Number;
+  private var _fragmentsRequestedByPeers: Number;
+  private var _bytesPushedFromPeers: Number;
+  private var _fragmentsPushedFromPeers: Number;
+  private var _bytesRequestedFromPeers: Number;
+  private var _fragmentsRequestedFromPeers: Number;
+  private var _sendControlBytesPerSecondToServer: Number;
+  private var _receiveDataBytesPerSecondFromServer: Number;
+  private var _bytesReceivedFromServer: Number;
+  private var _fragmentsReceivedFromServer: Number;
+  private var _receiveDataBytesPerSecondFromIPMulticast: Number;
+  private var _bytesReceivedFromIPMulticast: Number;
+  private var _fragmentsReceivedFromIPMulticast: Number;
+  public function get sendDataBytesPerSecond(): Number {
     return _sendDataBytesPerSecond;
   }
-  public function get sendControlBytesPerSecond():Number {
+  public function get sendControlBytesPerSecond(): Number {
     return _sendControlBytesPerSecond;
   }
-  public function get receiveDataBytesPerSecond():Number {
+  public function get receiveDataBytesPerSecond(): Number {
     return _receiveDataBytesPerSecond;
   }
-  public function get receiveControlBytesPerSecond():Number {
+  public function get receiveControlBytesPerSecond(): Number {
     return _receiveControlBytesPerSecond;
   }
-  public function get bytesPushedToPeers():Number {
+  public function get bytesPushedToPeers(): Number {
     return _bytesPushedToPeers;
   }
-  public function get fragmentsPushedToPeers():Number {
+  public function get fragmentsPushedToPeers(): Number {
     return _fragmentsPushedToPeers;
   }
-  public function get bytesRequestedByPeers():Number {
+  public function get bytesRequestedByPeers(): Number {
     return _bytesRequestedByPeers;
   }
-  public function get fragmentsRequestedByPeers():Number {
+  public function get fragmentsRequestedByPeers(): Number {
     return _fragmentsRequestedByPeers;
   }
-  public function get bytesPushedFromPeers():Number {
+  public function get bytesPushedFromPeers(): Number {
     return _bytesPushedFromPeers;
   }
-  public function get fragmentsPushedFromPeers():Number {
+  public function get fragmentsPushedFromPeers(): Number {
     return _fragmentsPushedFromPeers;
   }
-  public function get bytesRequestedFromPeers():Number {
+  public function get bytesRequestedFromPeers(): Number {
     return _bytesRequestedFromPeers;
   }
-  public function get fragmentsRequestedFromPeers():Number {
+  public function get fragmentsRequestedFromPeers(): Number {
     return _fragmentsRequestedFromPeers;
   }
-  public function get sendControlBytesPerSecondToServer():Number {
+  public function get sendControlBytesPerSecondToServer(): Number {
     return _sendControlBytesPerSecondToServer;
   }
-  public function get receiveDataBytesPerSecondFromServer():Number {
+  public function get receiveDataBytesPerSecondFromServer(): Number {
     return _receiveDataBytesPerSecondFromServer;
   }
-  public function get bytesReceivedFromServer():Number {
+  public function get bytesReceivedFromServer(): Number {
     return _bytesReceivedFromServer;
   }
-  public function get fragmentsReceivedFromServer():Number {
+  public function get fragmentsReceivedFromServer(): Number {
     return _fragmentsReceivedFromServer;
   }
-  public function get receiveDataBytesPerSecondFromIPMulticast():Number {
+  public function get receiveDataBytesPerSecondFromIPMulticast(): Number {
     return _receiveDataBytesPerSecondFromIPMulticast;
   }
-  public function get bytesReceivedFromIPMulticast():Number {
+  public function get bytesReceivedFromIPMulticast(): Number {
     return _bytesReceivedFromIPMulticast;
   }
-  public function get fragmentsReceivedFromIPMulticast():Number {
+  public function get fragmentsReceivedFromIPMulticast(): Number {
     return _fragmentsReceivedFromIPMulticast;
   }
-  public function toString():String {
-    notImplemented("toString");
-    return "";
+  public function toString(): String {
+    return 'sendDataBytesPerSecond=' + _sendDataBytesPerSecond +
+           ' sendControlBytesPerSecond=' + _sendControlBytesPerSecond +
+           ' receiveDataBytesPerSecond=' + _receiveDataBytesPerSecond +
+           ' receiveControlBytesPerSecond=' + _receiveControlBytesPerSecond +
+           ' bytesPushedToPeers=' + _bytesPushedToPeers +
+           ' fragmentsPushedToPeers=' + _fragmentsPushedToPeers +
+           ' bytesRequestedByPeers=' + _bytesRequestedByPeers +
+           ' fragmentsRequestedByPeers=' + _fragmentsRequestedByPeers +
+           ' bytesPushedFromPeers=' + _bytesPushedFromPeers +
+           ' fragmentsPushedFromPeers=' + _fragmentsPushedFromPeers +
+           ' bytesRequestedFromPeers=' + _bytesRequestedFromPeers +
+           ' fragmentsRequestedFromPeers=' + _fragmentsRequestedFromPeers +
+           ' sendControlBytesPerSecondToServer=' + _sendControlBytesPerSecondToServer +
+           ' receiveDataBytesPerSecondFromServer=' + _receiveDataBytesPerSecondFromServer +
+           ' bytesReceivedFromServer=' + _bytesReceivedFromServer +
+           ' fragmentsReceivedFromServer=' + _fragmentsReceivedFromServer +
+           ' receiveDataBytesPerSecondFromIPMulticast=' + _receiveDataBytesPerSecondFromIPMulticast +
+           ' bytesReceivedFromIPMulticast=' + _bytesReceivedFromIPMulticast +
+           ' fragmentsReceivedFromIPMulticast=' + _fragmentsReceivedFromIPMulticast;
   }
-
-  private var _sendDataBytesPerSecond:Number;
-  private var _sendControlBytesPerSecond:Number;
-  private var _receiveDataBytesPerSecond:Number;
-  private var _receiveControlBytesPerSecond:Number;
-  private var _bytesPushedToPeers:Number;
-  private var _fragmentsPushedToPeers:Number;
-  private var _bytesRequestedByPeers:Number;
-  private var _fragmentsRequestedByPeers:Number;
-  private var _bytesPushedFromPeers:Number;
-  private var _fragmentsPushedFromPeers:Number;
-  private var _bytesRequestedFromPeers:Number;
-  private var _fragmentsRequestedFromPeers:Number;
-  private var _sendControlBytesPerSecondToServer:Number;
-  private var _receiveDataBytesPerSecondFromServer:Number;
-  private var _bytesReceivedFromServer:Number;
-  private var _fragmentsReceivedFromServer:Number;
-  private var _receiveDataBytesPerSecondFromIPMulticast:Number;
-  private var _bytesReceivedFromIPMulticast:Number;
-  private var _fragmentsReceivedFromIPMulticast:Number;
 }
 }


remove unused import

remove unused import

--- src/org/mangui/flowplayer/HLSProvider.as
+++ src/org/mangui/flowplayer/HLSProvider.as
@@ -8,7 +8,6 @@
     import org.mangui.HLS.HLS;
     import org.mangui.HLS.HLSEvent;
     import org.mangui.HLS.HLSStates;
-    import org.mangui.HLS.HLSTypes;
     import org.mangui.HLS.utils.Log;
     import org.flowplayer.model.Plugin;
     import org.flowplayer.model.PluginModel;


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

--- frameworks/projects/spark/src/spark/layouts/TileLayout.as
+++ frameworks/projects/spark/src/spark/layouts/TileLayout.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package spark.layouts
 {


The player can release fuses outside slots, in which case the fuse returns to its start position.


Put MX dependencies in skin

Put MX dependencies in skin

git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4281 3e7533ad-8678-4d30-8e38-00a379d3f0d0

--- src/laml/display/Skin.as
+++ src/laml/display/Skin.as
@@ -2,7 +2,18 @@
 	import flash.display.DisplayObject;
 	import flash.display.Sprite;

+	import mx.core.BitmapAsset;
+	import mx.core.FontAsset;
+	import mx.core.IFlexAsset;
+	import mx.core.IFlexDisplayObject;
+	import mx.core.SpriteAsset;
+
 	public class Skin extends Sprite implements ISkin {
+ 		private var bitmapAsset:BitmapAsset;
+		private var fontAsset:FontAsset;
+		private var iFlexAsset:IFlexAsset;
+		private var iFlexDisplayObject:IFlexDisplayObject;
+		private var spriteAsset:SpriteAsset;

 		public function getBitmapByName(alias:String):DisplayObject {
 			if(hasOwnProperty(alias)) {


147 Adding FileUtil.transplant function

147 Adding FileUtil.transplant function

--- raw/src/org/yellcorp/air/file/FileUtil.as
+++ raw/src/org/yellcorp/air/file/FileUtil.as
@@ -40,6 +40,15 @@
         return xml;
     }

+    public static function transplant(sourceFile:File, sourceRoot:File, targetRoot:File):File
+    {
+        var relPath:String;
+
+        relPath = sourceRoot.getRelativePath(sourceFile, false);
+
+        return relPath ? targetRoot.resolvePath(relPath) : null;
+    }
+
     /**
      * Convert DOS/Unix-style glob to RegExp.  Supported metacharacters:
      * *  Match 0 or more non-delimiter characters


Improved method for getting global objects

--- WeaveJS/src/weavejs/utils/JS.as
+++ WeaveJS/src/weavejs/utils/JS.as
@@ -2,17 +2,27 @@
 {
 	public class JS
 	{
+		private static function getGlobal(name:String):*
+		{
+			var Fn:Class = Function;
+			var fn:Function = new Fn("return " + name + ";");
+			return fn();
+		}
+
 		/**
 		 * AS->JS Language helper to get the global scope
 		 */
-		public static const global:Object = (function():* { return this; }).apply(null);
+		public static const global:Object = getGlobal("window");
+
+		private static const console:Object = getGlobal("console");
+		private static const Symbol:Object = getGlobal("Symbol");

 		/**
 		 * Calls console.error()
 		 */
 		public static function error(...args):void
 		{
-			global.console.error.apply(global.console, args);
+			console.error.apply(console, args);
 		}

 		/**
@@ -20,7 +30,7 @@
 		 */
 		public static function log(...args):void
 		{
-			global.console.log.apply(global.console, args);
+			console.log.apply(console, args);
 		}

 		/**
@@ -31,23 +41,23 @@
 		public static function compile(script:String, paramNames:Array = null):Function
 		{
 			var paramsStr:String = paramNames ? paramNames.join(',') : '';
-			return global.eval("(function(" + paramsStr + "){ return eval(" + JSON.stringify(script) + "); })");
+			return global['eval']("(function(" + paramsStr + "){ return eval(" + JSON.stringify(script) + "); })");
 		}

 		/**
 		 * AS->JS Language helper for Promise
 		 */
-		public static const Promise:Class = (function():* { return this['Promise']; }).apply(null);
+		public static const Promise:Class = getGlobal('Promise');

 		/**
 		 * AS->JS Language helper for Map
 		 */
-		public static const Map:Class = (function():* { return this['Map']; }).apply(null);
+		public static const Map:Class = getGlobal('Map');

 		/**
 		 * AS->JS Language helper for WeakMap
 		 */
-		public static const WeakMap:Class = (function():* { return this['WeakMap']; }).apply(null);
+		public static const WeakMap:Class = getGlobal('WeakMap');

 		/**
 		 * AS->JS Language helper for getting an Array of Map keys.
@@ -79,7 +89,7 @@
 		 */
 		public static function isIterable(value:*):Boolean
 		{
-			return value && typeof value[global.Symbol.iterator] === 'function';
+			return value && typeof value[Symbol.iterator] === 'function';
 		}

 		/**
@@ -93,9 +103,9 @@
 				return value;

 			// special case for iterable object
-			if (value && typeof value[global.Symbol.iterator] === 'function')
+			if (value && typeof value[Symbol.iterator] === 'function')
 			{
-				var iterator:Object = value[global.Symbol.iterator]();
+				var iterator:Object = value[Symbol.iterator]();
 				var values:Array = [];
 				while (true)
 				{
@@ -186,7 +196,7 @@
 		public static function setTimeout(func:Function, delay:int, ...params):int
 		{
 			params.unshift(func, delay);
-			return global.setTimeout.apply(global, params);
+			return global['setTimeout'].apply(global, params);
 		}

 		/**
@@ -195,7 +205,7 @@
 		public static function setInterval(func:Function, delay:int, ...params):int
 		{
 			params.unshift(func, delay);
-			return global.setInterval.apply(global, params);
+			return global['setInterval'].apply(global, params);
 		}

 		/**
@@ -206,12 +216,16 @@
 			return Date['now']();
 		}

+		private static var Language:Class;
+
 		/**
 		 * Fixes bugs with the "is" operator.
 		 */
 		public static function fix_is():*
 		{
-			global.org.apache.flex.utils.Language['is'] = IS;
+			if (!Language)
+				Language = getGlobal("org.apache.flex.utils.Language");
+			Language['is'] = IS;
 			if (!(true is Boolean))
 				throw new Error('"is" operator is broken')
 		}
@@ -222,7 +236,9 @@
 		 */
 		public static function AS(leftOperand:Object, rightOperand:Class):*
 		{
-			return global.org.apache.flex.utils.Language['as'](leftOperand, rightOperand);
+			if (!Language)
+				Language = getGlobal("org.apache.flex.utils.Language");
+			return Language['as'](leftOperand, rightOperand);
 		}

 		/**


Removed Dead Code Removed a block of code that was commented out and no longer required.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -1877,29 +1877,6 @@
 						var HLSResource:HLSStreamingResource = _resource as HLSStreamingResource;
 						return getSeekTimeWithSegments(HLSResource.manifest.segments);
 					}
-
-					// find the segment we are currently playing
-					/*var currentIndex:int = determineSegmentIndex();// the index of the segment we are currently playing
-					var manifestLength:int = currentStream.manifest.segments.length;// we will use this more than once
-
-					// if we are currently at the last segment in the manifest or our time does not match any segments, do not seek forward
-					if (currentIndex == manifestLength - 1 || currentIndex == -1)
-						return 0;
-
-					// find the amount of time we need to seek forward
-					var index:int = 0;
-					var seekForwardTime:Number = currentStream.manifest.segments[currentIndex].duration -
-												 (time - currentStream.manifest.segments[currentIndex].startTime) + seekForwardBuffer;
-					for (index = 1; index <= seekForwardCount; index++)
-					{
-						// don't try to seek past the last segment
-						if (currentIndex + index >= manifestLength -1)
-							return seekForwardTime;
-
-						// add the duration of segments in order to get to the segment we are trying to seek to
-						seekForwardTime += currentStream.manifest.segments[currentIndex + index].duration;
-					}
-					return seekForwardTime;*/
 				}

 				/**


Return absolute time for live/DVR streams.

--- HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
+++ HLSPlugin/src/org/osmf/net/httpstreaming/HLSHTTPNetStream.as
@@ -538,7 +538,9 @@
 			{
 				var lastMan:HLSManifestParser = indexHandler.getLastSequenceManifest();
 				if(lastMan && lastMan.streamEnds == true && _timeCache_streamStartAbsoluteTime)
-					potentialNewTime -= _timeCache_streamStartAbsoluteTime;
+					potentialNewTime -= _timeCache_streamStartAbsoluteTime;
+				else
+					return absoluteTime;
 			}

 			// Take into account any cached live edge offset.


Now giving error when accessing undefined variable, and added support for using symbols in the default package without having to import them.

--- WeaveCore/src/weave/compiler/Compiler.as
+++ WeaveCore/src/weave/compiler/Compiler.as
@@ -2299,16 +2299,22 @@
 							// call.compiledMethod is a constant and call.evaluatedMethod is the method name
 							symbolName = method as String;
 							// find the variable
-							for (i = 0; i < allSymbolTables.length - 1; i++) // max i after loop will be length-1
+							for (i = 0; i < allSymbolTables.length; i++) // max i after loop will be length
+							{
 								if (allSymbolTables[i] && allSymbolTables[i].hasOwnProperty(symbolName))
+								{
+									if (i == THIS_SYMBOL_TABLE_INDEX || allSymbolTables[i] is Proxy)
+									{
+										propertyHost = allSymbolTables[i];
+										propertyName = symbolName;
+									}
+									result = allSymbolTables[i][symbolName];
 									break;
+								}
+							}

-							if (i == THIS_SYMBOL_TABLE_INDEX || allSymbolTables[i] is Proxy)
-							{
-								propertyHost = allSymbolTables[i];
-								propertyName = symbolName;
-							}
-							result = allSymbolTables[i][symbolName];
+							if (i == allSymbolTables.length)
+								result = getDefinitionByName(symbolName);
 						}
 						else if (JUMP_LOOKUP[method])
 						{


Fix build issues (issue 199)

Fix build issues (issue 199)

Fix empty {} if CONFIG::LOGGING is not defined and type error on loop.

--- src/org/mangui/hls/stream/StreamBuffer.as
+++ src/org/mangui/hls/stream/StreamBuffer.as
@@ -341,9 +341,9 @@
                  * if it is the case, then we can start injecting tags in NetStream
                  */

-                CONFIG::LOGGING {
-                    // Log.info("min_audio/max_audio/min_video/max_video:" + min_audio_pos.toFixed(2) + "/" + max_audio_pos.toFixed(2) + "/" + min_video_pos.toFixed(2) + "/" + max_video_pos.toFixed(2));
-                }
+//                CONFIG::LOGGING {
+//                    Log.info("min_audio/max_audio/min_video/max_video:" + min_audio_pos.toFixed(2) + "/" + max_audio_pos.toFixed(2) + "/" + min_video_pos.toFixed(2) + "/" + max_video_pos.toFixed(2));
+//                }

                 if (max_pos >= _seek_position_requested) {
                     // inject enough tags to reach seek position
@@ -516,8 +516,7 @@
             var _disHeader : FLVData;
             var headercounter : uint = 0;
             var _newheaderTags : Vector.<FLVData> = new Vector.<FLVData>();
-            for (var i : int in _headerTags) {
-                var data : FLVData = _headerTags[i];
+            for each (var data : FLVData in _headerTags) {
                 if ((data.position - (_time_sliding - data.sliding)) < clipping_position) {
                     switch(data.tag.type) {
                         case FLVTag.DISCONTINUITY:


now requesting next frame as the first frame callback to avoid the entire thing failing when there is an error.

--- WeaveJS/src/weavejs/core/Scheduler.as
+++ WeaveJS/src/weavejs/core/Scheduler.as
@@ -45,8 +45,8 @@

 		public function Scheduler()
 		{
+			frameCallbacks.addImmediateCallback(this, _requestNextFrame, true);
 			frameCallbacks.addImmediateCallback(this, _handleCallLater);
-			frameCallbacks.addImmediateCallback(this, _requestNextFrame, true, true);
 			initVisibilityHandler();
 		}


do not delete the root output folder, only its contents

--- src/ASConfigC.as
+++ src/ASConfigC.as
@@ -1305,7 +1305,7 @@
 				}
 				try
 				{
-					del.sync([outputDirectory], {"force": true});
+					del.sync([outputDirectory + "/*"], {"force": true});
 				}
 				catch(e:Error)
 				{


More tweaks

More tweaks

just more tweaks

--- Arguments/src/components/AgoraMap.as
+++ Arguments/src/components/AgoraMap.as
@@ -294,7 +294,7 @@
 							//Line from menuPanel to Inference
 							var inferencePanel:ArgumentPanel = panelsHash[argumentTypeModel.inferenceModel.ID];
 							if(inferencePanel.visible){
-								drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width/2, menuPanel.y+menuPanel.height);
+								drawUtility.graphics.moveTo(menuPanel.x + menuPanel.width/2, menuPanel.y+menuPanel.height+10);
 								drawUtility.graphics.lineTo(menuPanel.x + menuPanel.width/2, inferencePanel.y);
 							}
 							for each(statementModel in argumentTypeModel.reasonModels){


Removing Stats from TomsBunnies.as

Removing Stats from TomsBunnies.as

--- demo/tomsbunnies/TomsBunnies.as
+++ demo/tomsbunnies/TomsBunnies.as
@@ -11,6 +11,8 @@
 		public function TomsBunnies()
 		{
 			context = new TomsBunniesContext(this);
+
+//			addChild(new Stats());
 		}

 	}


Change 20090206-maxcarlson-y by maxcarlson@Bank.local on 2009-02-06 19:03:11 PST
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Send mouseup events when mouse goes up outside the app in swf9

Bugs Fixed: LPP-7724 - Mouse events behave wrong in opaque mode (FireFox)

Technical Reviewer: andre.bargull@udo.edu
QA Reviewer: hminsky

Details: Add mouseLeft flag to track whether the mouse left the app.  Send a mouseup event if the mouse left the app, the button is still down and there is a view to receive the event (lastMouseDown)

Tests: See LPP-7724.

git-svn-id: d62bde4b5aa582fdf07c8d403e53e0399a7ed285@12771 fa20e4f9-1d0a-0410-b5f3-dc9c16b8b17c

--- WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
+++ WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
@@ -1,7 +1,7 @@
 /**
   * LzMouseKernel.as
   *
-  * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.
+  * @copyright Copyright 2001-2009 Laszlo Systems, Inc.  All Rights Reserved.
   *            Use is subject to license terms.
   *
   * @topic Kernel
@@ -26,6 +26,7 @@
     static var __callback = null;
     static var __scope = null;
     static var __lastMouseDown = null;
+    static var __mouseLeft:Boolean = false;
     static var __listeneradded:Boolean = false ;

     /**
@@ -53,6 +54,13 @@
             LzMouseKernel.__lastMouseDown.__globalmouseup(event);
             __lastMouseDown = null;
         } else {
+            if (__mouseLeft && event.buttonDown && LzMouseKernel.__lastMouseDown != null) {
+                __mouseLeft = false;
+                //Debug.write(eventname, event.buttonDown, LzMouseKernel.__lastMouseDown);
+                var ev = new MouseEvent('mouseup');
+                LzMouseKernel.__lastMouseDown.__globalmouseup(ev);
+                LzMouseKernel.__lastMouseDown = null;
+            }
             LzMouseKernel.__sendEvent(null, eventname);
         }
     }
@@ -60,6 +68,7 @@
     // handles MOUSE_LEAVES event
     static function __mouseLeavesHandler(event:Event):void {
         var eventname = 'on' + event.type.toLowerCase();
+        LzMouseKernel.__mouseLeft = true;
         LzMouseKernel.__sendEvent(null, eventname);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 4307
Author:   dloverin@adobe.com
Date:     2008-12-15T19:58:22.615045Z

Log Message:
-----------
Change use of Application.application to ApplicationGlobals.application.

QE Notes: None
Doc Notes: None
Bugs: N/A
Reviewer: Alex
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ResizeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Glow.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/controls/Alert.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/haloclassic/src/haloclassic/ActivatorSkin.as</path>

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

--- frameworks/projects/framework/src/mx/controls/SWFLoader.as
+++ frameworks/projects/framework/src/mx/controls/SWFLoader.as
@@ -35,7 +35,7 @@
 import flash.system.SecurityDomain;
 import flash.utils.ByteArray;

-import mx.core.Application;
+import mx.core.ApplicationGlobals;
 import mx.core.FlexLoader;
 import mx.core.FlexVersion;
 import mx.core.ISWFLoader;
@@ -1542,7 +1542,7 @@
             if ( (Capabilities.isDebugger == true) &&
                  (url.indexOf(".jpg") == -1) &&
                  (LoaderUtil.normalizeURL(
-                 Application.application.systemManager.loaderInfo).indexOf("debug=true") > -1) )
+                 ApplicationGlobals.application.systemManager.loaderInfo).indexOf("debug=true") > -1) )
                 url = url + ( (url.indexOf("?") > -1) ? "&debug=true" : "?debug=true" );

             // make relative paths relative to the SWF loading it, not the top-level SWF


Transferred from the Adobe Open Source Subversion Repository

Revision: 8741
Author:   jimurphy@adobe.com
Date:     2009-07-22T21:00:56.965677Z

Log Message:
-----------
Merged 3.x revisions 8623,8685,8740 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/mxml/IMXMLSupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/ISOAPDecoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.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/frameworks/projects/rpc/src/mx/messaging/messages/MessagePerformanceUtils.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as</path>

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


FLEX-34741: Corrected the dropIndicator.  It will now use the grid.layout.centergridview.layout instead of the grid.layout directly.  Also removed the calculateDropLocation from the DataGrid as it is no longer used.

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -71,6 +71,7 @@
     import spark.components.gridClasses.GridSelection;
     import spark.components.gridClasses.GridSelectionMode;
     import spark.components.gridClasses.GridView;
+    import spark.components.gridClasses.GridViewLayout;
     import spark.components.gridClasses.IDataGridElement;
     import spark.components.gridClasses.IGridItemEditor;
     import spark.components.supportClasses.IDataProviderEnhance;
@@ -6272,20 +6273,13 @@
     //
     //--------------------------------------------------------------------------

-    private function calculateDropLocation(event:DragEvent):DropLocation
-    {
-        // Verify data format
-        if (!enabled || !event.dragSource.hasFormat("itemsByIndex"))
-            return null;
-
-        // Calculate the drop location
-        var location:DropLocation = grid.layout.calculateDropLocation(event);
-		if (location.dropIndex > dataProvider.length)
-			location.dropIndex = dataProvider.length;
-
-		return location;
-    }
-
+    /**
+    *  @private
+    *  Used in drag n drop methods for drop location / drop indicators.
+    */
+    private var _gridViewLayout:GridViewLayout = null;
+
+
     /**
      *  Creates and instance of the dropIndicator class that is used to
      *  display the visuals of the drop location during a drag and drop
@@ -6308,10 +6302,12 @@
     public function createDropIndicator():DisplayObject
     {
         // Do we have a drop indicator already?
-        if (grid.layout.dropIndicator)
-            return grid.layout.dropIndicator;
-
+        if (_gridViewLayout.dropIndicator)
+            return _gridViewLayout.dropIndicator;
+
+
         var dropIndicatorInstance:DisplayObject;
+
         if (dropIndicator)
         {
             dropIndicatorInstance = DisplayObject(createDynamicPartInstance("dropIndicator"));
@@ -6322,11 +6318,13 @@
             if (dropIndicatorClass)
                 dropIndicatorInstance = new dropIndicatorClass();
         }
+
         if (dropIndicatorInstance is IVisualElement)
             IVisualElement(dropIndicatorInstance).owner = this;

         // Set it in the layout
-        grid.layout.dropIndicator = dropIndicatorInstance;
+        _gridViewLayout.dropIndicator = dropIndicatorInstance;
+
         return dropIndicatorInstance;
     }

@@ -6348,15 +6346,17 @@
      */
     public function destroyDropIndicator():DisplayObject
     {
-        var dropIndicatorInstance:DisplayObject = grid.layout.dropIndicator;
+        var dropIndicatorInstance:DisplayObject = _gridViewLayout.dropIndicator;
+
         if (!dropIndicatorInstance)
             return null;

         // Release the reference from the layout
-        grid.layout.dropIndicator = null;
+        _gridViewLayout.dropIndicator = null;

         // Release it if it's a dynamic skin part
         var count:int = numDynamicParts("dropIndicator");
+
         for (var i:int = 0; i < count; i++)
         {
             if (dropIndicatorInstance == getDynamicPartAt("dropIndicator", i))
@@ -6366,6 +6366,7 @@
                 break;
             }
         }
+
         return dropIndicatorInstance;
     }

@@ -6391,8 +6392,17 @@
     {
         if (event.isDefaultPrevented())
             return;
-
-        var dropLocation:DropLocation = calculateDropLocation(event);
+
+
+        if (!_gridViewLayout)
+        {
+            //Store a current gridview layout.
+            _gridViewLayout = (grid.layout as GridLayout).centerGridView.layout as GridViewLayout;
+        }
+
+
+        var dropLocation:DropLocation = _gridViewLayout.calculateDropLocation(event);
+
         if (dropLocation)
         {
             DragManager.acceptDragDrop(this);
@@ -6409,7 +6419,7 @@
             DragManager.showFeedback(event.ctrlKey ? DragManager.COPY : DragManager.MOVE);

             // Show drop indicator
-            grid.layout.showDropIndicator(dropLocation);
+            _gridViewLayout.showDropIndicator(dropLocation);
         }
         else
         {
@@ -6439,8 +6449,10 @@
     {
         if (event.isDefaultPrevented())
             return;
-
-        var dropLocation:DropLocation = calculateDropLocation(event);
+
+
+        var dropLocation:DropLocation = _gridViewLayout.calculateDropLocation(event);
+
         if (dropLocation)
         {
             // Show focus
@@ -6451,12 +6463,12 @@
             DragManager.showFeedback(event.ctrlKey ? DragManager.COPY : DragManager.MOVE);

             // Show drop indicator
-            grid.layout.showDropIndicator(dropLocation);
+            _gridViewLayout.showDropIndicator(dropLocation);
         }
         else
         {
             // Hide if previously showing
-            grid.layout.hideDropIndicator();
+            _gridViewLayout.hideDropIndicator();

             // Hide focus
             drawFocus(false);
@@ -6488,9 +6500,9 @@
     {
         if (event.isDefaultPrevented())
             return;
-
+
         // Hide if previously showing
-        grid.layout.hideDropIndicator();
+        _gridViewLayout.hideDropIndicator();

         // Hide focus
         drawFocus(false);
@@ -6543,9 +6555,10 @@
     {
         if (event.isDefaultPrevented())
             return;
-
+
+
         // Hide the drop indicator
-        grid.layout.hideDropIndicator();
+		_gridViewLayout.hideDropIndicator();
         destroyDropIndicator();

         // Hide focus
@@ -6553,7 +6566,8 @@
         drawFocusAnyway = false;

         // Get the dropLocation
-        var dropLocation:DropLocation = calculateDropLocation(event);
+		var dropLocation:DropLocation = _gridViewLayout.calculateDropLocation(event);
+
         if (!dropLocation)
             return;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8024
Author:   gosmith@adobe.com
Date:     2009-06-19T23:59:25.894173Z

Log Message:
-----------
Fixed an injection where setting the 'content' property of Spark text component to a TextFlow would cause you to get a TextFlow nested inside a TextFlow.

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

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichText.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -768,20 +768,33 @@
      */
     private function createTextFlowFromContent(content:Object):TextFlow
     {
-        var textFlow:TextFlow = new TextFlow();
-
-        // The whiteSpaceCollapse format determines how whitespace
-        // is processed when the children are set.
-        staticTextLayoutFormat.whiteSpaceCollapse =
-            getStyle("whiteSpaceCollapse");
-        textFlow.hostFormat = staticTextLayoutFormat;
-
-        textFlow.mxmlChildren = content is Array ?
-        						content as Array :
-        						[ content ];
-
-        return textFlow;
-    }
+		var textFlow:TextFlow ;
+
+		// The whiteSpaceCollapse format determines how whitespace
+		// is processed when the children are set.
+		staticTextLayoutFormat.whiteSpaceCollapse =
+			getStyle("whiteSpaceCollapse");
+
+		if (content is TextFlow)
+		{
+			textFlow = content as TextFlow;
+			textFlow.hostFormat = staticTextLayoutFormat;
+		}
+		else if (content is Array)
+		{
+			textFlow = new TextFlow();
+			textFlow.hostFormat = staticTextLayoutFormat;
+			textFlow.mxmlChildren = content as Array;
+		}
+		else
+		{
+			textFlow = new TextFlow();
+			textFlow.hostFormat = staticTextLayoutFormat;
+			textFlow.mxmlChildren = [ content ];
+		}
+
+		return textFlow;
+	}

 	/**
 	 *  @private


Transferred from the Adobe Open Source Subversion Repository

Revision: 12859
Author:   jszeto@adobe.com
Date:     2009-12-11T19:57:39.056525Z

Log Message:
-----------
Masking bugs

SDK-24646 - Masking element on RIchText should inherit the target group's coordinate space
SDK-24559 - Using a mask with RichText doesn't work if you are using an MX Application

Fixed masking in RichText. The mask was not properly parented. Since we don't need to fake the parenting chain, we pass a null parent to MaskUtil.applyMask

Removed mask.parent check from MaskUtil.applyMask. It doesn't need this check.

Restored the mask initialization order in GraphicElement. Moved the addChild call back before the MaskUtil.applyMatirx call.

Updated GroupBase to call MaskUtil.applyMask.

QE notes: None
Doc notes: None
Bugs: SDK-24646, SDK-24559
Reviewer: Ryan
Tests run: checkintests, group, primitives
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/MaskUtil.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -1036,8 +1036,11 @@

         if (maskChanged)
         {
-            MaskUtil.applyMask(mask, parent);
-
+            if (!mask.parent)
+            {
+                addChild(mask);
+                MaskUtil.applyMask(mask, null);
+            }
             maskChanged = false;
         }