繁体   English   中英

Flex4:如何在AS中将子代添加到Spark Scroller

[英]Flex4: How to add a child to spark Scroller in AS

我想将以下代码转换为ActionScript(mxml可以正常工作):

<mx:Panel title="Some Title" width="400" height="300">
  <s:Scroller width="100%" height="100%"/>
    <mx:ColumnChart id="myChart" attribute="..." />

这是行不通的:

setupChart(); //setup myChart

var scroll:Scroller = new Scroller();
scroll.percentWidth = 100;
scroll.percentHeight = 100;
scroll.viewport = myChart;

首先添加一个组对我有用

setupChart();

var grp:Group = new Group();
grp.percentWidth = 100;
grp.percentHeight = 100;
grp.addElement( myChart );

var scroll:Scroller = new Scroller();
scroll.percentWidth = 100;
scroll.viewport = grp;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM