No, the Repeater is not a container; you will need to place a
repeater object within a container (I used VBox in the sample, but
any container should do).

You can use createClassObject() to create child objects at runtime
in AS.  MovieClip.attachMovie() should be there as well, although I
can't remember ever seeing it used in a Flex app.  Typically, you'll
see createClassObject() used in custom controls that extend an
existing class, or for specific applications where child objects
need to be created dynamically in actionscript as opposed to mxml.

Hope that helps!
Doug

--- In flexcoders@yahoogroups.com, "flexlearner" <[EMAIL PROTECTED]>
wrote:
>
> Cool!
> thanks a lot
> yes i have the variables in my component file
> and also the xml and component mxml is available  to mail
> application I could import one instance of custom component
> just the information on repeater component(which in the hirarchy
of
> container class ..am i right? ) was missing
> my problem is solved
> but just asking for curiosity that
> can we have run time "asset assembling" in flex  as we do
>  attachmovie() or creatClassobject() in flash -actionscript
>
> Thanks once again
> Regards
> Flex Learner
>
> --- In flexcoders@yahoogroups.com, "Doug Lowder" <douglowder@>
> wrote:
> >
> > Hello,
> >
> > You could use a Model tag for accessing the xml within your app,
> and
> > a Repeater tag to loop through the items and pass their values
to
> > your custom component.  I'm assuming your component has
variables
> > for the category, notes, and date_day xml fields, so code would
be
> > something like the following (Flex 1.5, but should be very
similar
> > in 2.0).  Make sure your app can find the xml file and
> > CustomComponent.mxml (or whatever you chose to name your custom
> > component).
> >
> > <?xml version="1.0" encoding="utf-8"?>
> >
> > <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
> > width="100%" height="100%">
> >
> > <mx:Model id="xmlFromFile" source="xml_file.xml"/>
> >
> > <mx:VBox height="100%" width="100%">
> >     <mx:Repeater
> >         id="rp"
> >         dataProvider="{xmlFromFile.dailly_learning}">
> >         <CustomComponent
> >             category="{rp.currentItem.category}"
> >             notes="{rp.currentItem.notes}"
> >             date_day="{rp.currentItem.date_day}" />
> >         </CustomComponent>
> >     </mx:Repeater>
> > </mx:VBox>
> >
> > </mx:Application>
> >
> >
> > --- In flexcoders@yahoogroups.com, "flexlearner" <flexlearner@>
> > wrote:
> > >
> > >
> > >
> > >  I created a custom component there are some text Areas  in
that
> > > component
> > >  This component will be imported in main application
> > >
> > > My final and simple goal is :
> > >   To load a xml file --  loop thru the array of
> > > node  "dailly_learning"
> > >   And attach the custom component as many as dailly_learning
> nodes
> > > are and fill the data into it
> > > I could have easily done flash using attachmovie but how to do
> it
> > in
> > > Flex
> > > I could load the xml and could  retrieve the value from it
> > >
> > > Some one please guide me !
> > >
> > >
> > >
> > >
> > >     Structure of xml files is  something like :
> > >
> > > <!---- Xml file -->
> > >
> > >  <dailly_learning>
> > >
> > >          <category > flex  </category >
> > >          <notes> some text </notes>
> > >          <date_day> date <date_day>
> > >  
> > > </dailly_learning>
> > >
> > > <dailly_learning>
> > >
> > >          <category > flash  </category >
> > >          <notes> some text </notes>
> > >          <date_day> date <date_day>
> > >  
> > > </dailly_learning>
> > >
> > > <dailly_learning>
> > >
> > >          <category > Misc  </category >
> > >          <notes> some text </notes>
> > >          <date_day> date <date_day>
> > >  
> > > </dailly_learning>
> > >
> > > Regards,
> > > Flex Learner
> > >
> >
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to