vb.createChild(mx.containers.Label,undefined,{text:"Hello"});
var ref:VBox = VBox(vb.createChild(VBox, undefined));
...or something to that effect. You do the same thing with popups to give
you another example:
var win:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, Window,
true));
----- Original Message -----
From: "Harris Reynolds" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, April 02, 2005 6:30 PM
Subject: Re: [flexcoders] Create ViewStack children via Actionscript
Quick qustion... after creating a Flex component using
ViewStack.createChild, how do you coerce the MovieClip
that is returned to be the correct type.
In the example code that was posted below, how to you
get the VBox variable (vb) to actually walk and talk
like a VBox? (instead of a MovieClip).
thanks,
~harris
--- Krzysztof Szlapinski <[EMAIL PROTECTED]> wrote:
> You can create children with CreateChild method
> In the example below when clicking on the button you
> create a label inside
> of a VBox which is a child of a ViewStack
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application
> xmlns:mx="http://www.macromedia.com/2003/mxml">
> <mx:Script>
> <![CDATA[
> function generateChildren(){
> var vs=mx.core.Application.application.vs01;
> var vb =
>
vs.createChild(mx.containers.VBox,undefined,{id:"vb01"});
>
>
vb.createChild(mx.containers.Label,undefined,{text:"Hello"});
> }
> ]]>
> </mx:Script>
> <mx:Panel>
> <mx:ViewStack id="vs01" >
> </mx:ViewStack>
> <mx:Button click="generateChildren()">
> </mx:Panel>
> </mx:Application>
> >
> > Does any1 know how i do that?
> >
> >
> > Greetz Erik
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/