Hi Brian,

not directly, but you could solve it this way:

1) Define a MXML component that describes the layout etc.
(MyComponent.mxml)
2) Create your a Mediator (or Helper) class in ActionScript
(MyComponentHelper.as)
3) define a public var view of type MyComponent inside MyComponentHelper
(or use interfaces to make it more generic)
3) instantiate MyComponentHelper inside MyComponent and pass a reference
to MyComponent to it
  
  <-- pseudo code for MyComponent -->
  <mx:HBox>

    <helper:MyComponentHelper view="{this}" />

    <mx:Button id="button" label="Hello"/>
    ...

  </mx:HBox>

4) because view is just a reference to MyComponent you are save to do
view.button.label = "Yo!" from inside MyComponentHelper

Dirk.

> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Brian Lesser
> Sent: Thursday, February 02, 2006 1:48 PM
> To: [email protected]
> Subject: [flexcoders] Flex / OOP custom component coding question
> 
> Hi,
> In Flash I can create a class that is associated with a Movie 
> Clip in the library. The clip can contain UI Components and 
> acts as a "form" 
> within the application. To refer to the form elements within 
> the clip I just need to declare them in the class.  It seems 
> cleaner than placing functions on the clip's timeline. When I 
> create a new form-like component in Flex is there a way to do 
> something similar without including all the code in a script 
> tag AND still get the benefit of using MXML to provide all 
> the subcomponents like TextInputs and Buttons?
> Primarily, I want the class to play the role of Mediator 
> within the form. (Mediator pattern.) My apologies if this is 
> in the docs or I missed it looking back through the mailing 
> list posts.
> Yours truly,
> -Brian
> 
> --
> ______________________________________________________________________
> Brian Lesser
> Assistant Director, Teaching and Technology Support Computing 
> and Communications Services Ryerson University 350 Victoria St.
> Toronto, Ontario                   Phone: (416) 979-5000 ext. 6835
> M5B 2K3                            Fax: (416) 979-5220
> Office: AB48D                      E-mail: [EMAIL PROTECTED]
> (Enter through LB66)               Web: http://www.ryerson.ca/~blesser
> ______________________________________________________________________
> 
> 
> 
> --
> 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
> 
> 
> 
>  
> 
> 
> 


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