Amen to that. I had to work with a related issue using
repeater. But ours  involved a dynamically generated
form with images which positions it's children
depending on the config xml passed into it. Embed
simply cannot work for the reason stated by ralf. So
we simply used url's passed in by the same config xml.


However, you should take note that using a repeater to
tile your custom component will leave the
'positioning'  work to you. Hence I suggest you use
another component such as TileList and have your
custom component be the item renderer. For this kind
of approach, you can bind the 'image urls' inside the
custom component itself by using the data property of
the base class from which you derived your custom
component and of course setting the dataprovider of
your tilelist to an arraycollection(or whatever type
suitable ie XMLlist)  which contains all the data you
need to show.

 AS for the repeater - although I dont suggest using
that unless you terribly need to - you can access the
individual repeater instances using the id of the
repeater and the index of the item you wish to access.
Say you named our repeater rep, you can access the nth
repeated component using rep[n] followed by whatever
property you want to access assuming the component is
fully instantiated and that property exists. Cheers.

--- Ralf Bokelberg <[EMAIL PROTECTED]> wrote:

> Hi Jason,
> 
> are you trying to embed the images? I'm not sure, if
> a repeater can do that
> at all, since it is executed at runtime and not at
> compile time like the
> embed directive. Maybe you can load the images at
> runtime by binding their
> url to the source attribute of an image?
> Setting labels in a custom component works similar.
> Expose a public property
> of your component to set the value from outside and
> bind the label's text
> property to it internally.
> 
> Cheers,
> Ralf.
> 
> 
> On 1/9/07, jmerrill_2001
> <[EMAIL PROTECTED]> wrote:
> >
> >   Newbie to Flex, (but not Flash/AS 2.0) so for me
> it's like a skier
> > learning to snowboard. I have dabbled with Flex in
> the past, and
> > recently went through all the lessons in the help
> docs, as well as
> > read a lot of other things in there. I'm designing
> a "Team Page" - a
> > site that shows people of the business unit as
> individual "cards" -
> > like baseball cards. Each card will have elements
> like a photo of
> > the person, a description of skillsets, and
> buttons to expand and
> > change to a different state. Making that is easy
> with a custom
> > component, but I'm having some struggle with the
> dynamic data part
> > as it relates to the custom component - in other
> words, making the
> > components generic and then settings the data for
> them later in my
> > application.
> >
> > I thought I would make a generic "person card"
> with a placeholder
> > for the photo and data - that would be a single
> component, and then
> > in another main application MXML I would repeat
> that component over
> > and over based on some XML data. Easy enough so
> far - the XML data
> > isn't the problem. In Flex, I'm not sure how to
> add the image
> > dynamically, or change the value of the image file
> reference for
> > each component repeated - I can add an image tag
> easily enough in
> > the component, but having a hard time not
> hard-coding the image
> > reference. So I guess I have a few questions:
> >
> > 1. What's the best way to set up a generic image
> "container" for the
> > image file be in the "person card" component and
> how would I set
> > that in the main application MXML repeat region?
> Or is making
> > the "person card" as a component not a good
> approach? Should I just
> > describe the person card within the repeat region
> and not make it a
> > custom component?
> >
> > 2. How do i set other variables in the custom
> components like label
> > values?
> >
> > 3. Overall, what would be a good way to architect
> a site like this?
> > I know how to create and change states, but unsure
> what should be a
> > component and what should just described right in
> the main MXML.
> >
> > Thanks,
> >
> > Jason Merrill
> > Bank of America Learning & Organizational
> Effectiveness
> > Multimedia / eTools Team
> >
> >  
> >
> 
> 
> 
> -- 
> Ralf Bokelberg <[EMAIL PROTECTED]>
> Flex & Flash Consultant based in Cologne/Germany
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to