加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex(4.0)滚动字幕,底部文字显示不全的问题

发布时间:2020-12-15 03:57:13 所属栏目:百科 来源:网络整理
导读:?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是为
    <?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>  

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读