<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="complete()" >
<fx:Script>
<![CDATA[
private function complete():void
{
move_up.xFrom = ca.width - 6; //加6减6是为了首尾连接更加自然"
move_up.xTo = 0 - description.width - 80; //这里加多少减多少视具体情况而定
move_up.repeatCount = 0; //循环
move_up.repeatDelay = 0; //循环间隔时间
move_up.duration = 10000; //滚动一次的时间,单位毫秒
move_up.play();
}
private function move_pause():void
{
move_up.pause();
}
private function move_resume():void
{
move_up.resume();
}
]]>
</fx:Script>
<fx:Declarations>
<mx:Move id="move_up" target="{description}" />
</fx:Declarations>
<skin:CustomPanel width="100%" height="100%" title="西城区停车场简介" textAlign="center" minHeight="10" fontSize="16" skinClass="skin.CustomPanelSkin" dropShadowVisible="false" borderColor="#99bbe8" fontFamily="仿宋" fontWeight="bold">
<mx:Canvas id="ca" width="100%" height="100%" left="0" top="0"
horizontalScrollPolicy="off" verticalScrollPolicy="off" mouseOver="move_pause()" mouseOut="move_resume()>
<mx:Label id="description" horizontalCenter="0" text="{textStr}" width="100%" height="120%"> //如果textStr过长,120%是解决底部文字显示不全的问题
</mx:Label>
</mx:Canvas>
</skin:CustomPanel>
</mx:Application>
Flex(4.0)滚动字幕,底部文字显示不全的问题
最新推荐文章于 2023-07-26 11:14:30 发布