I asked the same question as point four:
 
> These classes are not included in the FlexForFlash.zip file while they can be valuable to the development of good UI components. Does any1 know why?
 
The Macromedia answer was that FlexForFlash.zip was included for backward compatibility with version 1 where the components were heavily based on Flash skins, whereas v1.5 is heavily based on AS skins.
 
I think this issue will be resolved with version 2. Hopefully the documentation for the components in version 2 will be a lot clearer with detailed explanations of what a method does and what it returns under all circumstances etc., and with more detailed explanations of the properties and how they relate to other components - especially for the more complicated components such as the DataGrid and Tree components. The amount of time that I've wasted trying to work out these component when the answers should be in the docs is pretty annoying and has literally cost me in time/money.
 
Matt Chotin kindly pointed me in the direction of a sneaky way to get the ACTUAL component code ( the AS code in the FlashForFlex.zip file is very different to the actual component code used in v1.5 ). Here's how:
 
Run FDB and your mxml using the ?debug=true query (obviously your Flex config needs setting correctly for this). When the Flex App is connected to the FDB run as usual, but instead of continuing, type "list mx.controls.List" to get the actual code for the list component. It lists 10 lines at a time and copying and pasting into an editor is tedious and the line numbers need removing ( I have a saved Find/Replace setup for FlexBuilder if anyone wants it ).
 
Its not pretty but it works, so if anyone has a better/easier way of doing this, I would be pleased to know it.
 
Regards,
Simon

 
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]On Behalf Of Manish Jethani
Sent: 16 May 2005 17:52
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Development of components with AS

On 5/13/05, Erik Westra <[EMAIL PROTECTED]> wrote:
> Hello, some questions :)

Answers inline...

> 1:
> _measuredWidth
> _measuredHeight
> _measuredPreferredWidth
> _measuredPreferredHeight
> __width
> __height
> etc.
>
> Is there anywhere a list of these kind of properties that can be used
> with the development of a custom component in actionscript. I would be
> interested in knowing wich properties are available and what effect they
> have in the framework.

I searched Google for "_measuredPreferredWidth" and unfortunately
found only a single page of results. :(
http://www.google.com/search?q=_measuredPreferredWidth
http://search.yahoo.com/search?p=_measuredPreferredWidth

Anyway, here's a nice article about how to create components:
http://www.macromedia.com/support/documentation/en/flex/1_5/createcomponents/

> 2:
>
> <MyCustomComponent>
>         <mx:TextArea />
> </MyCustomComponent>
>
> The above piece of xml creates a child on the MyCustomComponent. Im
> wondering what code is used to determine wich childs must be created. If
> u extend container, either the container createChildren function or the
> View container function takes care of this creation. But how does it
> work?

When the MXML is compiled to ActionScript internally, the container
(MyCustomComponent) gets a bunch of object descriptors specifying what
children it must contain and what properties and styles the children
must have.  Then when the container is getting initialized, it looks
at the object descriptors and created its children using createChild()

You can see how the descriptors are set up by setting the following
option in flex-config.xml

        <!-- write xxx-generated.as file to disk -->
        <!-- These files are generated by the compiler during mxml
translation. -->
        <keep-generated-as>true</keep-generated-as>

Then you can open the MyMXMLFile-generated.as file to see the
translated AS code.  Look for "Descriptor" in that file to get an
idea.

> 3:
>
> In (for instance) the accordion class the visibility of childs is
> explicitly set with setVisible(false, true). This is not documented, but
> an importend part of the framework. Im wondering how many of these (for
> component development) usefull functions there exists.

There may be many, but if they are not in the ASDoc then one has to
assume they were not meant for public use.

> 4:
>
> mx.effects.EffectManager
> mx.core.UIObjectDescriptor
> mx.container.Box;
> mx.container.VBox;
> mx.container.HBox;
>
> These classes are not included in the FlexForFlash.zip file while they
> can be valuable to the development of good UI components. Does any1 know
> why?

No idea. :-/

> 5.
>
> Does any1 know how a Box determines the size of its children? I mean
> when u resize a child within a box, the positions of the other childs
> (and sometimes their sizes) are recalculated. How does this process
> exactly work.

When you resize a child in the box, its parent's "layout" needs to be
redone, so Flex remembers this and calls the parent's layoutChildren()
on the next frame.  In the layoutChildren() of the Box container, it
calculates the sizes of its children and lays them out accordindly.

This happens for any Container, not just Box.

> 6.
>
> In the documentation of the V2 architecture I miss the overview. I see a
> lot of examples of parts of the framework, but I don't see a list of
> goals connected to the theory of its implementation. It seems in the
> general documentation everything is ordered by feature and in component
> creation documentation all simple features are included and minimaly
> explained (think init, createChildren, measure, etc.).
>
> Im missing a structured view of how the framework is tied together. From
> concepts all the way down to parts of implementation code in components.

Have you read this book?
http://www.amazon.com/exec/obidos/tg/detail/-/0321255666/qid=1116262210/sr=8-2/ref=pd_csp_2/002-2276896-9552008
I haven't, but I hear it's great.  Some of the chapters are now
becoming available online too.
http://www.macromedia.com/devnet/flex/articles/component_reuse.html


Yahoo! Groups Links

Reply via email to