Hi scott,
 
as a matter of course, I have subclassed all the tags.
That way, when any defaults or behaviours irritate me, I have a place to fix them.
 


From: Scott Barnes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 22, 2005 1:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AutoWidth/AutoHeight?

I've found that i've been constantly typing width="100%" height="100%"
and so on for containers within containers and what not, and have
found it to be tedious task.

The thing is though, sometimes i want width="100%" but height to be
default (ie whatever the height of the movieclip in question)

but most of the time i've wanted 100% for both metrics for a typical container.

To combat this i put together a buch of custom MXML components that
simply use the MX built-in ones, but on initialize they simply setup
some default settings (margins, width/height etc)

At the same time i have an attribute like autoHeight=false|true which
will set the height to 100% or don't automatically define the height

so the code looks like:

public var autoHeight:Boolean = true;

function autoLayout() {
        if(autoHeight) {
            height = height || "100%";
        }

}

then when i want to use an autoLayout container i would do this:

<inco:VBox>
//... Stuff here.

</inco:VBox>

Now, does anyone else do something similiar? or have found it a
repetitive task? have i overlooked an attribute setting somewhere - (I
had thought of using CSS but thats not as agile as my autoLayout
capabilities)



--
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com (Coming Soon)


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to