我有Scroller
,在这个卷轴中我有3个swfloader。滚动条滚动时我怎么能检测到(事件,我的)?
//修改
抱歉这些小信息。在滚动条中,我有Group
代码:
<s:Scroller>
<s:Group>
<SWFLoader source="movie1.swf"/>
<SWFLoader source="movie2.swf"/>
<SWFLoader source="movie3.swf"/>
</s:Group>
</s:Scroller>
但Scroller是自定义的(可拖动)。有可能吗?
//
感谢。
答案 0 :(得分:0)
答案 1 :(得分:0)
您可以使用此方法将自定义滚动应用于任何组件。
<?xml version="1.0" encoding="utf-8"?>
protected function button1_clickHandler(event:MouseEvent):void
{
id_Scroller.viewport.verticalScrollPosition = id_Scroller.viewport.verticalScrollPosition + 15;
lbl.text = id_Scroller.viewport.verticalScrollPosition.toString();
}
protected function button2_clickHandler(event:MouseEvent):void
{
id_Scroller.viewport.verticalScrollPosition = id_Scroller.viewport.verticalScrollPosition - 15;
lbl.text = id_Scroller.viewport.verticalScrollPosition.toString();
}
]]>
</fx:Script>
<s:Panel width="600" height="600">
<s:layout>
<s:VerticalLayout />
</s:layout>
<s:Scroller id="id_Scroller" width="100%" height="100%" verticalScrollPolicy="off" >
<s:Group id="id_patientExamArea" width="100%" height="100%" >
<s:Panel width="100%" height="800" backgroundColor="#FFCCFF" title="test Up panel"/>
</s:Group>
</s:Scroller>
<s:HGroup >
<s:Button label="Up" click="button1_clickHandler(event)"/>
<s:Button label="Down" click="button2_clickHandler(event)"/>
</s:HGroup>
</s:Panel>
<s:Label id="lbl" x="774" y="62" />