佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 891|回复: 2

How to reset?

[复制链接]
dunecherng 该用户已被删除
发表于 9-2-2006 09:12 AM | 显示全部楼层 |阅读模式
I've make an automatic picture viewer using flash to view a series of picture by using 'setInterval' and with the count up number after the file name. But the problem is how do I exit the loop and repeat the number?
For example, if I only want to view 30 pictures, how to make the 'count' back to 1 after 30?
The code is as below. Thanks.

setInterval(
        function(){
        photo.loadMovie(folder.text + "\/" + "picture" + " " + "(" + count + ")" + ".jpg")
        ,count++}
        , 250);

[ 本帖最后由 dunecherng 于 9-2-2006 12:34 PM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 10-2-2006 05:44 AM | 显示全部楼层
//載入圖片函數
loadImage = function(){
      photo.loadMovie(folder.text + "\/" + "picture" + " " + "(" + count + ")" + ".jpg");
      count = (count > 30) ? count = 1 : count++; //大於30就回到1,否則繼續遞增
}
var image = setInterval(loadImage,250);  //設定每250毫秒執行載入圖片函數


clearInterval(image);  //停止interval的循環

[ 本帖最后由 super-tomato 于 10-2-2006 05:45 AM 编辑 ]
回复

使用道具 举报

发表于 12-2-2006 02:32 AM | 显示全部楼层
原帖由 dunecherng 于 9-2-2006 09:12 AM 发表
I've make an automatic picture viewer using flash to view a series of picture by using 'setInterval' and with the count up number after the file name. But the problem is how do I exit the loop and  ...



樓主這裡是華語論壇請多用中文發表
謝謝合作。
回复

使用道具 举报

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

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 21-9-2024 08:35 PM , Processed in 0.094874 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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