The best way is to allow the View to expose those things, or provide ways to 
interact with itself.  This keeps it encapsulated and protected from outside 
forces screwing it up.  With binding, this is even easier.

So:

<view>
    <mx:Script>
         <![CDATA[

            [Bindable]
            public var myViewData:ArrayCollection;

        ]]>
    </mx:Script>
    <mx:DataGrid dataProvider="{myViewData}" />

</view>

An outside View using the above would go like:

<view myViewData="{someArrayCollection}" />

Make sense?

----- Original Message ----- 
From: "flxcoder" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, July 14, 2006 10:55 PM
Subject: [flexcoders] Setting a value in a component from a actionScript 
file


Say I have these 2 files as/script.as and view/list.mxml.

list.mxml has a datagrid with id="dg".

Is it possible to set dg.dataProvider from script.as? How can I do
that?

Thanks.







--
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








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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

<*> 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/
 


Reply via email to