use states. <mx:State name="red">
<mx:AddChild relativeTo="{screenContainer}" position="firstChild" > <views:myView id="redView" width="100%" addedEffect="show" horizontalScrollPolicy="off" minHeight="484" model={redData} /> </mx:AddChild> </mx:State> On 10/25/07, Mike Krotscheck <[EMAIL PROTECTED]> wrote: > > On second thought, addedToStage might be the wrong event to listen for > :). You get the idea though. > > > > *Michael Krotscheck* > > Senior Developer > > > > > *RESOURCE INTERACTIVE* > > <http://www.resource.com/>www.resource.com > > [EMAIL PROTECTED] > > > ____________________________________________________________________________ > This email and any of its attachments may contain Resource Interactive > proprietary information, which is privileged, confidential and may be > subject to copyright or other intellectual property rights belonging to > Resource Interactive. This email is intended solely for the use of the > individual or entity to which it is addressed. If you are not the intended > recipient of this email, you are hereby notified that any dissemination, > distribution, copying or action taken in relation to the contents of and > attachments to this email is strictly prohibited and may be unlawful. If you > have received this email in error, please notify the sender immediately and > permanently delete the original and any copy of this email and any printout. > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mike Krotscheck > *Sent:* Thursday, October 25, 2007 8:16 AM > *To:* flexcoders@yahoogroups.com > *Subject:* RE: [flexcoders] Add reference in MXML without adding to > children > > > > You can either: > > > > override protected function childrenCreated():void > > { > > super.childrenCreated(); > > removeChild(titleWindow); > > } > > > > Or: > > > > <mx:TitleWindow id="titleWindow" addedToStage=" > titleWindow.parent.removeChild(titleWindow)" /> > > > > *Michael Krotscheck* > > Senior Developer > > > > > *RESOURCE INTERACTIVE* > > <http://www.resource.com/>www.resource.com > > [EMAIL PROTECTED] > > * > ____________________________________________________________________________ > * > *This email and any of its attachments may contain Resource Interactive > proprietary information, which is privileged, confidential and may be > subject to copyright or other intellectual property rights belonging to > Resource Interactive. This email is intended solely for the use of the > individual or entity to which it is addressed. If you are not the intended > recipient of this email, you are hereby notified that any dissemination, > distribution, copying or action taken in relation to the contents of and > attachments to this email is strictly prohibited and may be unlawful. If you > have received this email in error, please notify the sender immediately and > permanently delete the original and any copy of this email and any printout. > * > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mark Ingram > *Sent:* Thursday, October 25, 2007 7:42 AM > *To:* flexcoders@yahoogroups.com > *Subject:* RE: [flexcoders] Add reference in MXML without adding to > children > > > > Hi guys, thanks for the fast responses – I'm currently creating the window > in action script – but wanted to move it to MXML purely for easier binding: > > > > i.e. > > > > <mx:TitleWindow title="{someVar}"/> > > > > Vs > > > > <mx:Script> > > creationComplete > > { > > BindingUtils.bindProperty(etc) > > } > > </mx:Script> > > > > I was just thinking I could write 1 line of MXML vs 10 – 20 lines of > action script. > > > > Thanks, > > > > Mark > > > > > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mike Krotscheck > *Sent:* 25 October 2007 12:38 > *To:* flexcoders@yahoogroups.com > *Subject:* RE: [flexcoders] Add reference in MXML without adding to > children > > > > Does it have to be MXML? > > > > <mx:Script> > > <![CDATA[ > > import mx.managers.PopUpManager; > > import mx.containers.TitleWindow; > > > > [Bindable] > > private var titleWindow:TitleWindow; > > > > private function someFunction():void > > { > > titleWindow = new > TitleWindow(); > > PopUpManager.addPopUp > (titleWindow); > > } > > ]]> > > </mx:Script> > > > > > > *Michael Krotscheck* > > Senior Developer > > > > > *RESOURCE INTERACTIVE* > > <http://www.resource.com/>www.resource.com > > [EMAIL PROTECTED] > > * > ____________________________________________________________________________ > * > *This email and any of its attachments may contain Resource Interactive > proprietary information, which is privileged, confidential and may be > subject to copyright or other intellectual property rights belonging to > Resource Interactive. This email is intended solely for the use of the > individual or entity to which it is addressed. If you are not the intended > recipient of this email, you are hereby notified that any dissemination, > distribution, copying or action taken in relation to the contents of and > attachments to this email is strictly prohibited and may be unlawful. If you > have received this email in error, please notify the sender immediately and > permanently delete the original and any copy of this email and any printout. > * > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mark Ingram > *Sent:* Thursday, October 25, 2007 5:29 AM > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] Add reference in MXML without adding to children > > > > Hi, does anyone know if it's possible to create a reference in MXML (so > that you can later use it as a variable and also easily use bindings) but > not add it to the parent's children? > > > > i.e. > > > > <mx:Canvas> > > > > <mx:Script> > > Private function someEvent() > > { > > PopUpManager.addPopUp(titleWindow); > > } > > </mx:Script> > > > > <mx:TitleWindow/> > > </mx:Canvas> > > > > I don't want the title window to be shown inside the canvas, I just want > to create it as a variable. > > > > Thanks, > > > > Mark > > > > > > > > > ____________________________________________________________________________ > This email and any of its attachments may contain Resource Interactive > proprietary information, which is privileged, confidential and may be > subject to copyright or other intellectual property rights belonging to > Resource Interactive. This email is intended solely for the use of the > individual or entity to which it is addressed. If you are not the intended > recipient of this email, you are hereby notified that any dissemination, > distribution, copying or action taken in relation to the contents of and > attachments to this email is strictly prohibited and may be unlawful. If you > have received this email in error, please notify the sender immediately and > permanently delete the original and any copy of this email and any printout. > > > -- j:pn \\no comment