找回密码
 注-册

QQ登录

只需一步,快速开始

查看: 1428|回复: 0

picturescroll 鼠标滚动图片

[复制链接]
Leya 发表于 2008-3-28 10:11:02 | 显示全部楼层 |阅读模式
picturescroll 鼠标滚动图片

使用鼠标移动感应移动图片,做网站的朋友兴许可以用的上.以前做过N多个,兴许这么做简单一些.
  1. 在第一帧上加入如下代码.picture为图片剪辑,dragControl为一个空的影片剪辑参照.

  2. stop();
  3. var widthx=400;
  4. var heighx=300;
  5. onEnterFrame=function(){
  6. onMouseMove=function(){
  7. startDrag("dragControl", true);
  8. }

  9. trace(_root.dragControl._x);
  10. picture._x+=(dragControl._x*(-1)-picture._x)*0.2;
  11. if (dragControl._x>=widthx) {
  12. picture._x=-picture._width;

  13. }
  14. if (dragControl._x< =-1) {
  15. picture._x=-1;
  16. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注-册

本版积分规则

Archiver|手机版|小黑屋|DoDVip ( 桂ICP备14000730号 )

GMT+8, 2024-5-19 10:46 , Processed in 0.054584 second(s), 21 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表