Hi
I am having trouble when adding dynamic graphics content to a
container in getting the container to scroll/recognise this content
as a child.
So in a nutshell, I have some AS adding graphics/lineTo
content to a sprite class and then adding that as a child to a
UIComponent, then adding to a mxml declared container (tried
variations Panel, HBox, Canvas etc). The lines are being drawn
however as the drawn conent is larger than the visible container
are I would have thought the scrollbars for the target container
would kick in as the UIComponent is a child of the container.
Anyone from Adobe have a comment?
Sample:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="initApp()">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
private var UICLine:UIComponent = new UIComponent();
private var lineSprite:Sprite = new Sprite();
//
private function initApp():void{
lineSprite.graphics.lineStyle(2,0xFF0000,100);
lineSprite.graphics.moveTo(100,100);
lineSprite.graphics.lineTo(100,800);
UICLine.addChild(lineSprite);
// target container, currently a HBox
con.addChild(UICLine);
}
]]>
</mx:Script>
<mx:Panel width="100%" height="100%">
<mx:HBox width="100%" height="50%" id="con"
backgroundColor="#FFFF99">
</mx:HBox>
<mx:Canvas width="100%" height="50%">
</mx:Canvas>
</mx:Panel>
</mx:Application>
Thanks
Wayne
