You can certainly pass parameters to a custom MXML component.  Just 
create your public properties in a script block and they will act just 
like properties in an AS only class. 

 Beyond that, I would probably make your public property a custom 
interface.  That way you can pass in any object that implements that 
interface to help populate the data. 

Penny Laus wrote:
> I've got a custom MXML component called GridView that includes a
> DataGrid and some other display objects, such as a bit of text. The
> component uses one HTTPService to fetch the column definitions and
> another to fetch data for the grid. The idea here is to be able to
> store and configure DataGrid definitions on the server and then buld
> the DataGrid on-the-fly at runtime in the Flash player. Right now,
> this is all working in my simple test case.
>
> In my simple case, the MXML component passes the HTTPService a name
> that specifies what grid settings to download. Imagine:
>
>     url="http://127.0.0.1/GetGridProfile/people.xml";
>
> or
>
>      url="http://127.0.0.1/GetGridProfile/events.xml";
>
> What I want to pass in like a parameter to the MXML component is
> "people" or "events". (Or what have you - there may be any number of
> profiles.) In my test case I've got a specific profile name hard-coded
> in as I wanted to make sure I had the DataGrid working and so on. The
> problem is, I can't sort out a straightforward way to pass parameters
> into the new instance of GridView. I've googled around and see that
> you can't pass parameters to a custom MXML component, so I'm curious
> to know what technique I should try. I can convert the MXML to an AS
> class, but I find it a lot quicker and easier to develop in MXML. So,
> I'm hoping for a technique that lets me use my MXML component.
>
> Any suggestions or links to helpful blogs or articles I've missed
> would be much appreciated!
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>   

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust


Reply via email to