Advanced AntiAliasType in TabBar
- Is there a way to set the AntiAliasType to ADVANCED for a TabBar without modifying the astra classes?
Adding the following to the end of drawTextFormat() in TabButton.as does what I need:
this.textField.antiAliasType = AntiAliasType.ADVANCED;
If there is no other way to set it, I hope this will be added in the next release! (BTW, thanks for getting embedFonts working in this release!)
- Looking at Adobe's Flash CS4 docs, I don't think any of the core fl.*
controls have an explicit way to set the antiAliasType. It looks like
Button and other controls expose their internal TextFields publicly,
which is interesting, and that certainly allows antiAliasType to be
If TabBar exposed an Array of its tabs, or maybe a method to get a
specific tab, the same would be possible. I'm not sure if that's good
for encapsulation, but obviously there's precedent. List has
itemToCellRenderer(), but that doesn't really allow looping because it
doesn't create a renderer for every item, so it has a different
use-case than TabBar. Still, that's sort of what I'm talking about.
Personally, I'd consider creating a method on TabBar that looks
something like this:
public function getTabAt(index:int):TabButton
Developers would be able to get the number of tabs from the length of
the DataProvider, and it would be easy to use in loops.
For now, you don't really have to edit the TabButton class to change
antiAliasType. Just crawl the display list to get the tabs.
for(var i:int = 0; i < tabBar.numChildren; i++)
var tab:TabButton = tabBar.getChildAt(i) as TabButton;
tab.textField.antiAliasType = AntiAliasType.ADVANCED;
On Fri, May 1, 2009 at 3:58 PM, Nathaniel <njdoor@...> wrote:
> Is there a way to set the AntiAliasType to ADVANCED for a TabBar without
> modifying the astra classes?
> Adding the following to the end of drawTextFormat() in TabButton.as does
> what I need:
> this.textField.antiAliasType = AntiAliasType.ADVANCED;
> If there is no other way to set it, I hope this will be added in the next
> release! (BTW, thanks for getting embedFonts working in this release!)