广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    Flash中图片不停循环播放,可改变左右方向

    来源:网络收集  点击:  时间:2024-03-07
    【导读】:
    在Flash中制作图片循环播放(非补间动画),可通过按钮改变左右方向工具/原料moreFlash8.0,AS2.0步骤/方法1/8分步阅读导入图片(这里以8张图片为例,且例子中图片为临时绘制的矩形,实际中可导入自己想要的图片),每导入一张都将其转换为影片剪辑(图片上点右键-转换为元件-影片剪辑),共8个影片剪辑。(从图片1至图片8)2/8在图层1,将8个影片剪辑都放入场景,并将它们之间间隔的距离设置成相同,第1张图片与场景左边的距离与它们之间间隔的距离也相同。3/8从图片1开始,依次为每个影片剪辑都设置实例名称(属性-实例名称,依次为mc1、mc2、...、mc8)......4/8图层2,画一个矩形,长度比场景的宽度短一些,可以将左右两个按钮显现出来。5/8在图层2上设置遮罩6/8新建图层3,添加两个按钮进来,放在场景的左右两边。7/8给两个按钮分别设置实例名称为:an1、an28/8再新建图层4,在这一帧设置帧动作:kk = mc8._x+mc8._width;for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x -= 5;if (this._x+this._width=0) {this._x = kk-this._width;}};_root.onRollOver = function() {for (j=1; j=8; j++) {delete _root.onEnterFrame;}};_root.onRollOut = function() {for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x -= 5;if (this._x+this._width=0) {this._x = kk-this._width;}};}};}an1.onRollOver = function() {//向左的按钮动作for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x -= 5;if (this._x+this._width=0) {this._x = kk-this._width;}};_root.onRollOver = function() {for (j=1; j=8; j++) {delete _root.onEnterFrame;}};_root.onRollOut = function() {for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x -= 5;if (this._x+this._width=0) {this._x = kk-this._width;}};}};}};an2.onRollOver = function() {//向右的按钮动作for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x += 5;if (this._x+this._width=kk) {this._x = 0-this._width;}};_root.onRollOver = function() {for (j=1; j=8; j++) {delete _root.onEnterFrame;}};_root.onRollOut = function() {for (i=1; i=8; i++) {_root.onEnterFrame = function() {this._x += 5;if (this._x+this._width=kk) {this._x = 0-this._width;}};}};}};注意事项

    8张图片的间距要设置相同,第1张图片与场景左边的距离要和这些间距一样。

    flash循环改变
    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_286068.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-07 06:50:34  耗时:0.026
    0.0259s