That brings up a very interesting point. I am not sure how much work this is,
but it would be extremely helpful to developers looking at the source code to
have methods with compiler-based mixins (or whatever you want to call them) be
indicated as such in framework code comments, so we don't have do this sort of
"mystery meat" guesswork whilst debugging.

Such as:

/**
 * The return value of this method will be overwritten in the compiler.
 **/
protected function get skinParts():Object
{
    return null;
}

I know you can find what code the compiler outputs by using the
"keep-generated-actionscript" and doing a diff with the uncompiled code, but
that's just such a pain to look up something which should take 2 seconds to 
find.


_______________________________________________________________________

Joseph Balderson, Flex & Flash Platform Developer :: http://joeflash.ca
Author, Professional Flex 3 :: http://tinyurl.com/proflex3book

Michael A. Labriola wrote:
>> Anyone have a clue where skinParts is getting populated from? Its not 
>> overridden in a derived class, so really not sure how/whats populating it?
> 
> It's compiler magic. The compiler creates a static variable called _skinParts 
> on each class with the skin parts for the class in it. It then overrides the 
> getter to return the static var, so:
> 
> So, if I added this to my application:
> 
>         [SkinPart(required="false")]
>         public var thingies:BitmapImage;
> 
> The compiler would generate this:
> 
> private static var _skinParts:Object = {contentGroup:false, thingies:false, 
> controlBarGroup:false};
> 
> override protected function get skinParts() : Object
> {
>     return _skinParts;
> }// end function
> 
> Mike
> 
> 

Reply via email to