Return-Path: X-Original-To: apmail-flex-dev-archive@www.apache.org Delivered-To: apmail-flex-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D80AC365 for ; Sat, 6 Jul 2013 15:18:04 +0000 (UTC) Received: (qmail 58814 invoked by uid 500); 6 Jul 2013 15:18:03 -0000 Delivered-To: apmail-flex-dev-archive@flex.apache.org Received: (qmail 58571 invoked by uid 500); 6 Jul 2013 15:18:03 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 58563 invoked by uid 99); 6 Jul 2013 15:18:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jul 2013 15:18:02 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aharui@adobe.com designates 64.18.1.234 as permitted sender) Received: from [64.18.1.234] (HELO exprod6og119.obsmtp.com) (64.18.1.234) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jul 2013 15:17:55 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob119.postini.com ([64.18.5.12]) with SMTP ID DSNKUdg1DX2JE9XW9sXHnFtuYrqXVhcgp1z3@postini.com; Sat, 06 Jul 2013 08:17:35 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r66FEAD8019704 for ; Sat, 6 Jul 2013 08:14:10 -0700 (PDT) Received: from nacas02.corp.adobe.com (nacas02.corp.adobe.com [10.8.189.100]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r66FHX6A023680 for ; Sat, 6 Jul 2013 08:17:33 -0700 (PDT) Received: from NAMBX02.corp.adobe.com ([10.8.127.96]) by nacas02.corp.adobe.com ([10.8.189.100]) with mapi; Sat, 6 Jul 2013 08:17:33 -0700 From: Alex Harui To: "dev@flex.apache.org" Date: Sat, 6 Jul 2013 08:17:30 -0700 Subject: Re: [2/2] git commit: [flex-sdk] [refs/heads/develop] - support mxml.children-as-data mainstream SDK Thread-Topic: [2/2] git commit: [flex-sdk] [refs/heads/develop] - support mxml.children-as-data mainstream SDK Thread-Index: Ac56W+/S5Dfp3VSRSb6PgNWjVYqHlQ== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.4.130416 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org No, this was the original plan for Falcon even at Adobe. The idea is to convert MXML to data structures so that the compiler is not dependent on particular versions of the SDK and thus folks can tweak the behavior of Flex without needing to know how to modify the compiler sources. Regarding Vanilla, I would love to see folks add more and more of the APIs in the current Flex SDK to the FlexJS controls as beads. -Alex On 7/6/13 7:48 AM, "Erik de Bruin" wrote: >Daring move... what are you trying to achieve? Are you attempting to >get some kind of "vanilla SDK" support going for FlexJS? > >EdB > > > >On Sat, Jul 6, 2013 at 8:29 AM, wrote: >> support mxml.children-as-data mainstream SDK >> >> >> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo >> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/6907ac09 >> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/6907ac09 >> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/6907ac09 >> >> Branch: refs/heads/develop >> Commit: 6907ac09e43f1df07af558964946316dddefd829 >> Parents: aeed464 >> Author: Alex Harui >> Authored: Thu Jun 27 23:34:51 2013 -0700 >> Committer: Alex Harui >> Committed: Fri Jul 5 23:29:02 2013 -0700 >> >> ---------------------------------------------------------------------- >> .../framework/src/mx/core/UIComponent.as | 256 >>++++++++++++++++++- >> .../framework/src/mx/states/AddItems.as | 186 +++++++++++++- >> .../projects/mx/src/mx/containers/ViewStack.as | 9 + >> frameworks/projects/mx/src/mx/core/Container.as | 6 +- >> .../spark/src/spark/components/Group.as | 10 +- >> .../src/spark/components/SkinnableContainer.as | 31 +++ >> 6 files changed, 492 insertions(+), 6 deletions(-) >> ---------------------------------------------------------------------- >> >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/framework/src/mx/core/UIComponent.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/framework/src/mx/core/UIComponent.as >>b/frameworks/projects/framework/src/mx/core/UIComponent.as >> index 8e46058..4eb4a6f 100644 >> --- a/frameworks/projects/framework/src/mx/core/UIComponent.as >> +++ b/frameworks/projects/framework/src/mx/core/UIComponent.as >> @@ -1723,6 +1723,11 @@ public class UIComponent extends FlexSprite >> >> _width =3D super.width; >> _height =3D super.height; >> + >> + var attributes:Array =3D this.MXMLProperties; >> + if (attributes) >> + generateMXMLAttributes(attributes); >> + >> } >> >> >>//----------------------------------------------------------------------- >>--- >> @@ -4425,6 +4430,44 @@ public class UIComponent extends FlexSprite >> { >> return document =3D=3D this; >> } >> + >> + //---------------------------------- >> + // MXML Descriptor >> + //---------------------------------- >> + >> + /** >> + * The descriptor of MXML children. >> + */ >> + private var _MXMLDescriptor:Array; >> + >> + public function get MXMLDescriptor():Array >> + { >> + return _MXMLDescriptor; >> + } >> + >> + public function setMXMLDescriptor(value:Array):void >> + { >> + _MXMLDescriptor =3D value; >> + } >> + >> + //---------------------------------- >> + // MXML Properties >> + //---------------------------------- >> + >> + /** >> + * The attributes of MXML top tag. >> + */ >> + private var _MXMLProperties:Array; >> + >> + public function get MXMLProperties():Array >> + { >> + return _MXMLProperties; >> + } >> + >> + public function setMXMLProperties(value:Array):void >> + { >> + _MXMLProperties =3D value; >> + } >> >> //---------------------------------- >> // parentApplication >> @@ -7763,8 +7806,219 @@ public class UIComponent extends FlexSprite >> */ >> protected function createChildren():void >> { >> + var children:Array =3D this.MXMLDescriptor; >> + if (children) >> + generateMXMLInstances(document, children); >> + } >> + >> + protected function addMXMLChildren(comps:Array):void >> + { >> + for each (var i:DisplayObject in comps) >> + { >> + addChild(i); >> + } >> + } >> + >> + protected function generateMXMLObject(document:Object, >>data:Array):Object >> + { >> + var i:int =3D 0; >> + var cls:Class =3D data[i++]; >> + var comp:Object =3D new cls(); >> + >> + var m:int; >> + var j:int; >> + var name:String; >> + var simple:*; >> + var value:Object; >> + var id:String; >> + >> + m =3D data[i++]; // num props >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(document, value as Array); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(document, value as Array); >> + if (name =3D=3D "id") >> + { >> + document[value] =3D comp; >> + id =3D value as String; >> + } >> + else if (name =3D=3D "_id") >> + { >> + document[value] =3D comp; >> + id =3D value as String; >> + continue; // skip assignment to comp >> + } >> + comp[name] =3D value; >> + } >> + if (comp is IMXMLObject) >> + comp.initialized(document, id); >> + return comp; >> + } >> + >> + public function generateMXMLArray(document:Object, data:Array, >>recursive:Boolean =3D true):Array >> + { >> + var comps:Array =3D []; >> + >> + var n:int =3D data.length; >> + var i:int =3D 0; >> + while (i < n) >> + { >> + var cls:Class =3D data[i++]; >> + var comp:Object =3D new cls(); >> + >> + var m:int; >> + var j:int; >> + var name:String; >> + var simple:*; >> + var value:Object; >> + var id:String =3D null; >> + >> + m =3D data[i++]; // num props >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(document, value as >>Array, recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(document, value as >>Array); >> + if (name =3D=3D "id") >> + id =3D value as String; >> + if (name =3D=3D "document" && !comp.document) >> + comp.document =3D document; >> + else if (name =3D=3D "_id") >> + id =3D value as String; // and don't assign to comp >> + else >> + comp[name] =3D value; >> + } >> + m =3D data[i++]; // num styles >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(document, value as >>Array, recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(document, value as >>Array); >> + comp.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num effects >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(document, value as >>Array, recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(document, value as >>Array); >> + comp.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num events >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + value =3D data[i++]; >> + comp.addEventListener(name, value); >> + } >> + >> + var children:Array =3D data[i++]; >> + if (children) >> + { >> + if (recursive) >> + comp.generateMXMLInstances(document, children, >>recursive); >> + else >> + comp.setMXMLDescriptor(children); >> + } >> + >> + if (id) >> + { >> + document[id] =3D comp; >> + mx.binding.BindingManager.executeBindings(document, >>id, comp); >> + } >> + if (comp is IMXMLObject) >> + comp.initialized(document, id); >> + comps.push(comp); >> + } >> + return comps; >> + } >> + >> + protected function generateMXMLInstances(document:Object, >>data:Array, recursive:Boolean =3D true):void >> + { >> + var comps:Array =3D generateMXMLArray(document, data, recursive= ); >> + addMXMLChildren(comps); >> + } >> + >> + protected function generateMXMLAttributes(data:Array):void >> + { >> + var i:int =3D 0; >> + var m:int; >> + var j:int; >> + var name:String; >> + var simple:*; >> + var value:Object; >> + var id:String =3D null; >> + >> + m =3D data[i++]; // num props >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(this, value as Array, false= ); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(this, value as Array); >> + if (name =3D=3D "id") >> + id =3D value as String; >> + if (name =3D=3D "_id") >> + id =3D value as String; // and don't assign >> + else >> + this[name] =3D value; >> + } >> + m =3D data[i++]; // num styles >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(this, value as Array, false= ); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(this, value as Array); >> + this.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num effects >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(this, value as Array, false= ); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(this, value as Array); >> + this.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num events >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + value =3D data[i++]; >> + this.addEventListener(name, value as Function); >> + } >> } >> - >> /** >> * Performs any final processing after child objects are created. >> * This is an advanced method that you might override >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/framework/src/mx/states/AddItems.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/framework/src/mx/states/AddItems.as >>b/frameworks/projects/framework/src/mx/states/AddItems.as >> index 6fc388c..01fe514 100644 >> --- a/frameworks/projects/framework/src/mx/states/AddItems.as >> +++ b/frameworks/projects/framework/src/mx/states/AddItems.as >> @@ -26,10 +26,12 @@ import mx.collections.IList; >> import mx.core.ContainerCreationPolicy; >> import mx.core.IChildList; >> import mx.core.IDeferredContentOwner; >> +import mx.core.IMXMLObject; >> import mx.core.ITransientDeferredInstance; >> import mx.core.IVisualElement; >> import mx.core.IVisualElementContainer; >> import mx.core.UIComponent; >> +import mx.binding.BindingManager; >> >> [DefaultProperty("itemsFactory")] >> >> @@ -41,7 +43,7 @@ import mx.core.UIComponent; >> * @playerversion AIR 1.5 >> * @productversion Flex 4 >> */ >> -public class AddItems extends OverrideBase >> +public class AddItems extends OverrideBase implements IMXMLObject >> { >> include "../core/Version.as"; >> >> @@ -115,7 +117,9 @@ public class AddItems extends OverrideBase >> // Variables >> // >> >>//----------------------------------------------------------------------- >>--- >> - >> + >> + private var document:Object; >> + >> /** >> * @private >> */ >> @@ -308,6 +312,52 @@ public class AddItems extends OverrideBase >> { >> _items =3D value; >> } >> + >> + //------------------------------------ >> + // itemsDescriptor >> + //------------------------------------ >> + >> + /** >> + * @private >> + * Storage for the itemsDescriptor property. >> + */ >> + private var _itemsDescriptor:Array; >> + >> + [Inspectable(category=3D"General")] >> + >> + /** >> + * >> + * The descriptor that describes the items. >> + * >> + *

If you set this property, the items are instantiated at the >>time >> + * determined by the creationPolicy property.

>> + * >> + *

Do not set this property if you set the items >> + * property. >> + * This propety is the AddItems class default >>property. >> + * Setting this property with a creationPolicy of >>"all" >> + * is equivalent to setting a items property.

>> + * >> + * @langversion 3.0 >> + * @playerversion Flash 10 >> + * @playerversion AIR 1.5 >> + * @productversion Flex 4 >> + */ >> + public function get itemsDescriptor():Array >> + { >> + return _itemsDescriptor; >> + } >> + >> + /** >> + * @private >> + */ >> + public function set itemsDescriptor(value:Array):void >> + { >> + _itemsDescriptor =3D value; >> + >> + if (creationPolicy =3D=3D ContainerCreationPolicy.ALL) >> + createInstance(); >> + } >> >> //------------------------------------ >> // itemsFactory >> @@ -489,11 +539,132 @@ public class AddItems extends OverrideBase >> */ >> public function createInstance():void >> { >> - if (!instanceCreated && !_items && itemsFactory) >> + if (!instanceCreated && !_items && itemsFactory && >>!_itemsDescriptor) >> { >> instanceCreated =3D true; >> items =3D itemsFactory.getInstance(); >> } >> + else if (!instanceCreated && !_items && !itemsFactory && >>_itemsDescriptor) >> + { >> + instanceCreated =3D true; >> + items =3D generateMXMLArray(itemsDescriptor, false); >> + } >> + } >> + >> + protected function generateMXMLObject(data:Array):Object >> + { >> + var i:int =3D 0; >> + var cls:Class =3D data[i++]; >> + var comp:Object =3D new cls(); >> + >> + var m:int; >> + var j:int; >> + var name:String; >> + var simple:*; >> + var value:Object; >> + var id:String; >> + >> + m =3D data[i++]; // num props >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(value as Array); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(value as Array); >> + comp[name] =3D value; >> + } >> + return comp; >> + } >> + >> + // varies slightly from version in UIComponent in how it handles >>documents >> + public function generateMXMLArray(data:Array, recursive:Boolean =3D >>true):Array >> + { >> + var comps:Array =3D []; >> + >> + var n:int =3D data.length; >> + var i:int =3D 0; >> + while (i < n) >> + { >> + var cls:Class =3D data[i++]; >> + var comp:Object =3D new cls(); >> + >> + var m:int; >> + var j:int; >> + var name:String; >> + var simple:*; >> + var value:Object; >> + var id:String =3D null; >> + >> + m =3D data[i++]; // num props >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(value as Array, >>recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(value as Array); >> + if (name =3D=3D "id") >> + id =3D value as String; >> + if (name =3D=3D "_id") >> + id =3D value as String; // and don't assign to comp >> + else >> + comp[name] =3D value; >> + } >> + m =3D data[i++]; // num styles >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(value as Array, >>recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(value as Array); >> + comp.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num effects >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + simple =3D data[i++]; >> + value =3D data[i++]; >> + if (simple =3D=3D null) >> + value =3D generateMXMLArray(value as Array, >>recursive); >> + else if (simple =3D=3D false) >> + value =3D generateMXMLObject(value as Array); >> + comp.setStyle(name, value); >> + } >> + >> + m =3D data[i++]; // num events >> + for (j =3D 0; j < m; j++) >> + { >> + name =3D data[i++]; >> + value =3D data[i++]; >> + comp.addEventListener(name, value); >> + } >> + >> + var children:Array =3D data[i++]; >> + if (children) >> + { >> + if (recursive) >> + comp.generateMXMLInstances(children, recursive); >> + else >> + comp.setMXMLDescriptor(children); >> + } >> + if (id) >> + { >> + document[id] =3D comp; >> + mx.binding.BindingManager.executeBindings(document, >>id, comp); >> + } >> + comps.push(comp); >> + } >> + return comps; >> } >> >> /** >> @@ -907,6 +1078,15 @@ public class AddItems extends OverrideBase >> _waitingForDeferredContent =3D false; >> } >> } >> + >> + /** >> + * IMXMLObject support >> + */ >> + public function initialized(document:Object, id:String):void >> + { >> + this.document =3D document; >> + } >> + >> } >> >> } >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/mx/src/mx/containers/ViewStack.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/mx/src/mx/containers/ViewStack.as >>b/frameworks/projects/mx/src/mx/containers/ViewStack.as >> index e2b97d5..bf462ca 100644 >> --- a/frameworks/projects/mx/src/mx/containers/ViewStack.as >> +++ b/frameworks/projects/mx/src/mx/containers/ViewStack.as >> @@ -738,6 +738,15 @@ public class ViewStack extends Container >>implements IHistoryManagerClient, ISele >> >> /** >> * @private >> + */ >> + override protected function generateMXMLInstances(document:Object, >>data:Array, recursive:Boolean =3D true):void >> + { >> + // in theory, creationpolicy gets applied later >> + super.generateMXMLInstances(document, data, false); >> + } >> + >> + /** >> + * @private >> */ >> override protected function commitProperties():void >> { >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/mx/src/mx/core/Container.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/mx/src/mx/core/Container.as >>b/frameworks/projects/mx/src/mx/core/Container.as >> index 635d8bc..c3f7d91 100644 >> --- a/frameworks/projects/mx/src/mx/core/Container.as >> +++ b/frameworks/projects/mx/src/mx/core/Container.as >> @@ -4219,7 +4219,11 @@ public class Container extends UIComponent >> */ >> public function createDeferredContent():void >> { >> - createComponentsFromDescriptors(true); >> + var children:Array =3D this.MXMLDescriptor; >> + if (children) >> + generateMXMLInstances(document, children); >> + else >> + createComponentsFromDescriptors(true); >> } >> >> /** >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/spark/src/spark/components/Group.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/spark/src/spark/components/Group.as >>b/frameworks/projects/spark/src/spark/components/Group.as >> index 7068fc5..f3a75fb 100644 >> --- a/frameworks/projects/spark/src/spark/components/Group.as >> +++ b/frameworks/projects/spark/src/spark/components/Group.as >> @@ -546,7 +546,15 @@ public class Group extends GroupBase implements >>IVisualElementContainer, >> >> } >> } >> - >> + >> + /** >> + * override setting of children >> + */ >> + override protected function addMXMLChildren(comps:Array):void >> + { >> + mxmlContent =3D comps; >> + } >> + >> //---------------------------------- >> // mxmlContent >> //---------------------------------- >> >> >>http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/6907ac09/frameworks/ >>projects/spark/src/spark/components/SkinnableContainer.as >> ---------------------------------------------------------------------- >> diff --git >>a/frameworks/projects/spark/src/spark/components/SkinnableContainer.as >>b/frameworks/projects/spark/src/spark/components/SkinnableContainer.as >> index f011a01..edff9c6 100644 >> --- >>a/frameworks/projects/spark/src/spark/components/SkinnableContainer.as >> +++ >>b/frameworks/projects/spark/src/spark/components/SkinnableContainer.as >> @@ -672,6 +672,14 @@ public class SkinnableContainer extends >>SkinnableContainerBase >> _contentModified =3D true; >> } >> >> + /** >> + * override setting of children >> + */ >> + override protected function addMXMLChildren(comps:Array):void >> + { >> + mxmlContent =3D comps; >> + } >> + >> //---------------------------------- >> // mxmlContentFactory >> //---------------------------------- >> @@ -873,6 +881,17 @@ public class SkinnableContainer extends >>SkinnableContainerBase >> // >> >>//----------------------------------------------------------------------- >>--- >> >> + private var creatingChildren:Boolean; >> + >> + override protected function generateMXMLInstances(document:Object, >>data:Array, recursive:Boolean =3D true):void >> + { >> + // don't generate children during super.createChildren >> + if (creatingChildren) >> + return; >> + >> + super.generateMXMLInstances(document, data, recursive); >> + } >> + >> /** >> * Create content children, if the creationPolicy >>property >> * is not equal to none. >> @@ -884,7 +903,9 @@ public class SkinnableContainer extends >>SkinnableContainerBase >> */ >> override protected function createChildren():void >> { >> + creatingChildren =3D true; >> super.createChildren(); >> + creatingChildren =3D false; >> >> // TODO (rfrishbe): When navigator support is added, this is >>where we would >> // determine if content should be created now, or wait until >> @@ -1048,6 +1069,16 @@ public class SkinnableContainer extends >>SkinnableContainerBase >> */ >> public function createDeferredContent():void >> { >> + var children:Array =3D this.MXMLDescriptor; >> + if (children) >> + { >> + generateMXMLInstances(document, children); >> + mxmlContentCreated =3D true; // keep the code from recursin= g >>back into here. >> + _deferredContentCreated =3D true; >> + dispatchEvent(new >>FlexEvent(FlexEvent.CONTENT_CREATION_COMPLETE)); >> + return; >> + } >> + >> if (!mxmlContentCreated) >> { >> mxmlContentCreated =3D true; >> > > > >-- >Ix Multimedia Software > >Jan Luykenstraat 27 >3521 VB Utrecht > >T. 06-51952295 >I. www.ixsoftware.nl