establish separate arrays for each instance.  In the future, the compiler 
should generate these off the constructor and not the prototype where they get 
shared


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/207359d0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/207359d0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/207359d0

Branch: refs/heads/develop
Commit: 207359d0952ed7a944e45ccdfe89012859888e30
Parents: ddfc11f
Author: Alex Harui <aha...@apache.org>
Authored: Thu Jan 15 16:17:10 2015 -0800
Committer: Alex Harui <aha...@apache.org>
Committed: Fri Jan 23 12:24:04 2015 -0800

----------------------------------------------------------------------
 examples/FlexJSStore/src/productsView/ProductList.mxml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/207359d0/examples/FlexJSStore/src/productsView/ProductList.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductList.mxml 
b/examples/FlexJSStore/src/productsView/ProductList.mxml
index e99397d..88d3377 100755
--- a/examples/FlexJSStore/src/productsView/ProductList.mxml
+++ b/examples/FlexJSStore/src/productsView/ProductList.mxml
@@ -45,7 +45,7 @@ limitations under the License.
         import samples.flexstore.Product;
         import samples.flexstore.ProductListEvent;
         
-        public var items:Array = [];
+        public var items:Array;
         
         public var newItemStartX:int;
         public var newItemStartY:int;
@@ -57,6 +57,9 @@ limitations under the License.
         
         public function addProduct(product:Product):void
                {
+            if (items == null)
+                items = [];
+            
             var index:int = indexOf(product.productId);
             var event:ProductListEvent;
             var item:ProductListItem;

Reply via email to