读书人

各位帮帮忙!

发布时间: 2012-02-21 16:26:23 作者: rapoo

求救,各位帮帮忙!!!

XML code
<mx:SWFLoader  source="@Embed('消息播放.swf')"   width="100%" height="100%"></mx:SWFLoader>


消息播放.swf是word文档转换成的swf文件。
在flex中用SWFLoader播放,用鼠标拖动滚动条查看该文件
现在公司要求做到 该文件自动滚屏,有高手知道怎么实现吗?请帮忙,万分感谢!

[解决办法]
自动滚屏功能,可以用Timer来实现,创建一个Timer,间隔时间也就是滚动速度是个条件,在页面上用户可以自行调整。timer里面通过滚动滚动条就可以实现自动滚动。参考代码:

XML code
<?xml version="1.0"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"                layout="vertical" >    <mx:Script>        <![CDATA[            private var timer:Timer = new Timer(500);                        private function startAutoScoll():void            {                if (timer != null && !timer.running) {                       timer.addEventListener(TimerEvent.TIMER, run);                    timer.start();                }            }            private function run(event:TimerEvent):void            {                box.verticalScrollPosition ++;                trace("33");            }            private function stopAutoScoll():void            {                if (timer != null && timer.running) {                    timer.stop();                       timer.removeEventListener(TimerEvent.TIMER, run);                }            }            private function changeSpeed():void            {                if (timer != null) {                    timer.delay = (10 - speedNumber.value)*100;                }            }        ]]>    </mx:Script>        <mx:Button label="开始自动滚动" click="startAutoScoll()"/>    <mx:Button label="停止自动滚动" click="stopAutoScoll()"/>    <mx:NumericStepper id="speedNumber" minimum="0" maximum="10" value="5" change="changeSpeed()"/>     <mx:VBox id="box" width="80%" height="200" >       <!-- <mx:SWFLoader id="swfLoader" source="@Embed('消息播放.swf')"  scaleContent="false"/>-->       <!-- 注意scaleContent必须为false 一个标志,指示是缩放内容以适应控件大小还是调整控件大小使其适应内容大小。如果为 true,则会缩放内容以适应 SWFLoader 控件。如果为 false,则会缩放 SWFLoader 控件以适应内容。 -->       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>       <mx:TextArea text="啊都是"/>    </mx:VBox></mx:Application>
[解决办法]
消息播放.swf word文档转换成的swf文件。里面是什么啊?没弄过,这里面有没有方法或函数换页之类的啊?
如果只是测试文件,发给我信箱一份,我帮你看下。
huangxin5257@163.com

读书人网 >flex

热点推荐