chrisiek
chrisiek

Reputation: 97

How to access the inner container inside the Scroller?

I have a container

<s:Group visible="true" x="100" y="0" width="582" height="300" 
    id="debugGroup" name="debugGroupName" >
        <comps:circle id="rect2" />
        <s:Rect width="100" height="100">
            <s:fill><s:SolidColor /></s:fill>
        </s:Rect>
</s:Group>

So far I accessed it from my other class like this:

FlexGlobals.topLevelApplication.debugGroup.addElement(comp_green_new_component);

I wanted to scroll my debugGroup container so I added a Scroller.

<s:Scroller width="100%" height="100%" id="scrollerDebug">
    <s:Group visible="true" x="100" y="0" width="582" height="300" 
    id="debugGroup" name="debugGroupName" >
        <comps:circle id="rect1" />
        <comps:circle id="rect2" />
        <s:Rect width="100" height="100">
            <s:fill><s:SolidColor /></s:fill>
        </s:Rect>
</s:Group>
</s:Scroller

Now I can't access my debugGroup from my other class like this:

FlexGlobals.topLevelApplication.scrollerDebug.debugGroup.addElement(comp_green);

Why is this? How to access correctly my inner container debugGroup from actionscript?

Upvotes: 0

Views: 31

Answers (1)

Pascal Le Merrer
Pascal Le Merrer

Reputation: 5981

You don't need to give the full path to the element, if you have its id

So replace

FlexGlobals.topLevelApplication.scrollerDebug.debugGroup.addElement(comp_green);

with

FlexGlobals.topLevelApplication.debugGroup.addElement(comp_green);

Upvotes: 1

Related Questions