Hi,

Bump, in case someone who has an answer has missed the topic.

Thanks,
-- 
Sébastien

2009/11/1 Sébastien Tromp <sebastien.tr...@gmail.com>

> Hello,
>
> I have an MXML TitleWindow component that contains the following:
>
> <popup:MajorImprovementClickableBoard id = "board" player = "{player}"
>         majorImprovements =
> "{AgricolaModelLocator.getInstance().game.majorImprovements}"/>
> <view:AlternativeCostComponent id = "alternativeCostsComponent" visible =
> "{board.multipleCosts}"
>         includeInLayout = "{board.multipleCosts}" selectedImprovement =
> "{board.selectedImprovement}"
>         player = "{player}" width="100%"/>
>
> where at initialization time, board.multipleCosts = false, which means the
> AlternativeCostComponent is not displayed.
> When the TileWindow is first created, it is automatically scaled so that
> the MajorImprovementClickableBoard fits exactly.
>
> However, when the board.multipleCosts becomes true, the
> AlternativeCostComponent becomes visible, but the TileWindow is not
> refreshed; as a result, a scrollbar appears.
>
> What I would like to do is to have the TileWindow be automatically
> redrawned / rescaled / whatever, so that the content (MajorImprovement +
> AlternativeCost) fits exactly.
>
> I have tried to listen to the includeInLayoutChanged, but this did not
> achieve anything
>
>             private function addEventListeners():void
>             {
>
> alternativeCostsComponent.addEventListener("includeInLayoutChanged",
> onLayoutChange);
>             }
>
>             private function onLayoutChange(event:Event):void
>             {
>                 trace("On layout change");  // This is printed to the
> console
>                 invalidateDisplayList();  // This does nothing, I still
> have the scroll bar
>             }
>
> I have tried to google it, but without much success.
>
> Would you happen to have advises on how I could solve my problem?
>
> Thanks a lot,
> --
> Sébastien
>

Reply via email to