HAccordion and right aligned tree items

Flex / AIR Add comments

Tree with right-aligned item text

We are doing some work with FlexLib, making use of the HAccordion class.  Strangely enough, all my tree items were screwed up.  The alignment of the items was right justified.

In order to get the text on the accordians up to the top corner, they have their textAlign set to right.  For whatever reason, this inherits through to the tree component, but the other components are unaffected.  By explicitly setting the textAlign property of the HAccordian's children back to left, I was able to reverse the effect.

<?xml version="1.0" encoding="utf-8"?>
<mx:Box width="100%" height="100%"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:flexlib="http://code.google.com/p/flexlib/"
xmlns:view="view.*"
creationComplete="init()" xmlns:objectModel="com.echoeleven.echolearning.rulesBuilder.view.objectModel.*">

<mx:Script>
<![CDATA[
private function init():void {
var numRulePleats:int = parentApplication.numRulePleats;
for(var i:int = 0 ; i < numRulePleats ; i++ ) {
var newPleat:RulesContainer = new RulesContainer();
newPleat.isInDLCMode = false;
newPleat.textAlign="left"
newPleat.label = "Branch to DLC " + i.toString();
hAccordion.addChild( newPleat );
}
}
]]>
</mx:Script>

<flexlib:HAccordion width="100%" height="100%" id="hAccordion">
<objectModel:ModelItemChooser horizontalAlign="left" />
</flexlib:HAccordion>
</mx:Box>

5 responses to “HAccordion and right aligned tree items”

  1. David Parks Says:
    Thanks for posting this! Very helpful!
    I found this by accident looking for help on another issue. Then 10 minutes later ran into this exact problem (once my other one was solved). Sure glad I wandered by this one on the way, you saved me a ton of frustration.
  2. fitness trainers gold coast Says:
    I subscribed to your blog when is the next post
  3. business loans Says:
    I propose not to hold off until you get big sum of cash to buy different goods! You can get the loans or just short term loan and feel free
  4. Andralyn Says:
    Free info like this is an apple from the tree of knwolegde. Sinful?
  5. imvqfwyvj Says:
    mXIHYT , [url=http://idtyjfwsgyhn.com/]idtyjfwsgyhn[/url], [link=http://dbfddosewqcr.com/]dbfddosewqcr[/link], http://uhmjmysswfcj.com/

Leave a Reply





Powered by Mango Blog. Design and Icons by N.Design Studio