如何应用flash制作一个可以自动变换的图版或者像册 例如讯雷首页 在《今日头条》左边的图框 可以自动按时间间隔变换和选择变换 请大家给

duoduo2008 2007-04-26 11:52:18
如何应用flash制作一个可以自动变换的图版或者像册 例如讯雷首页 在 今日头条 左边的图框 可以自动按时间间隔变换和选择变换 请大家给个方向
...全文
799 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
UltraBejing 2008-05-01
  • 打赏
  • 举报
回复
支持搂主,收藏
HSZZLZL 2007-05-09
  • 打赏
  • 举报
回复
// Action script...

// [onClipEvent of sprite 1 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 2 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 3 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 4 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 5 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 6 in frame 1]
onClipEvent (load)
{
this._alpha = 0;
}

// [onClipEvent of sprite 8 in frame 1]
onClipEvent (load)
{
this._visible = true;
}

// [Action in Frame 1]
function fadeTPl_1(co, no)
{
currPicObj = co;
nextPicObj = no;
fadingLoop = setInterval(function ()
{
if (nextPicObj._alpha >= 100 && currentPic._alpha <= 0)
{
clearInterval(fadingLoop);
currentPic = nextPic;
isFading = false;
return(undefined);
} // end if
currPicObj._alpha = currPicObj._alpha - 10;
nextPicObj._alpha = nextPicObj._alpha + 10;
}, 50);
} // End of the function
function getData()
{
var xmlObj = new XML();
var _l1 = "http://www.xunlei.com/fade.xml?cacheTime=" + new Date();
xmlObj.load(_l1);
xmlObj.ignoreWhite = true;
xmlObj.onLoad = function (success)
{
fixData(xmlObj);
};
} // End of the function
function fixData(o)
{
var i = 0;
while (i < o.firstChild.childNodes.length)
{
arrImg.push(o.firstChild.childNodes[i].childNodes[2].firstChild);
arrUrl.push(o.firstChild.childNodes[i].childNodes[1].firstChild);
arrTitle.push(o.firstChild.childNodes[i].childNodes[0].firstChild);
i++;
} // end while
img1_mc.loadMovie(arrImg[0]);
img2_mc.loadMovie(arrImg[1]);
linkbutton.onRelease = function ()
{
getURL(htmlReplace(arrUrl[0]), "_blank");
flash.external.ExternalInterface.call("fls_onClick", "0");
};
btn1_mc.gotoAndStop(2);
} // End of the function
function preLoadPic(i)
{
if (i == 7)
{
i = 0;
} // end if
if (isLoading[i])
{
return(undefined);
} // end if
i++;
eval("img" + i + "_mc").loadMovie(arrImg[i - 1]);
isLoading[i - 1] = true;
} // End of the function
function checkPicLoad(i, o)
{
o.onEnterFrame = function ()
{
if (int(o.getBytesLoaded() / o.getBytesTotal() * 100) >= 100)
{
eval("btn" + i + "_mc")._visible = true;
delete o["onEnterFrame"];
} // end if
};
} // End of the function
function start()
{
getData();
} // End of the function
function checkFade()
{
var i = 1;
while (i < 8)
{
if (eval("btn" + i + "_mc")._visible == false)
{
return(undefined);
} // end if
i++;
} // end while
clearInterval(picLoadLoop);
startFade();
} // End of the function
function startFade()
{
playerPlay();
} // End of the function
function picFade()
{
nextPic = currentPic == 7 ? (1) : (parseInt(currentPic) + 1);
loadFadeTpl(eval("img" + currentPic + "_mc"), eval("img" + nextPic + "_mc"));
} // End of the function
function loadFadeTpl(co, no)
{
preLoadPic(nextPic);
isFading = true;
linkbutton.onRelease = function ()
{
getURL(htmlReplace(arrUrl[nextPic - 1]), "_blank");
flash.external.ExternalInterface.call("fls_onClick", nextPic - 1);
};
setButtonColor();
fadeTPl_1(co, no);
} // End of the function
function setButtonColor()
{
var i = 1;
while (i < 8)
{
eval("btn" + i + "_mc").gotoAndStop(1);
i++;
} // end while
eval("btn" + nextPic + "_mc").gotoAndStop(2);
} // End of the function
function setCurrPic(cp) //这是切换图片的主函数
{
if (currentPic == cp)
{
return(undefined);
} // end if
if (!isLoading[cp - 1])
{
eval("img" + cp + "_mc").loadMovie(arrImg[cp - 1]);
isLoading[cp - 1] = true;
} // end if
if (isFading == false)
{
playerStop();
nextPic = cp;
loadFadeTpl(eval("img" + currentPic + "_mc"), eval("img" + nextPic + "_mc"));
}
else
{
trace(isFading);
} // end if
} // End of the function
function playPrePic()
{
playerStop();
nextPic = currentPic == 1 ? (7) : (parseInt(currentPic) - 1);
if (!isLoading[nextPic - 1])
{
eval("img" + nextPic + "_mc").loadMovie(arrImg[nextPic - 1]);
isLoading[nextPic - 1] = true;
} // end if
loadFadeTpl(eval("img" + currentPic + "_mc"), eval("img" + nextPic + "_mc"));
} // End of the function
function playNextPic()
{
playerStop();
picFade();
} // End of the function
function playerStop()
{
_root.player_mc.gotoAndStop(1);
clearInterval(fadeLoop);
} // End of the function
function playerPlay()
{
_root.player_mc.gotoAndStop(2);
fadeLoop = setInterval(picFade, 4000);
} // End of the function
function htmlReplace(str)
{
var _l1 = str.toString();
if (_l1.indexOf("&") != -1)
{
_l1 = _l1.split("&");
return(_l1.join("&"));
} // end if
return(_l1);
} // End of the function
stop();
Stage.scaleMode = "noScale";
Stage.showMenu = false;
System.useCodepage = false;
var picLoadLoop;
var fadeLoop;
var currentPic = 1;
var nextPic;
var arrUrl = [];
var arrTitle = [];
var arrImg = [];
var isFading = false;
var isLoading = [true, true, false, false, false, false, false];
var fadingLoop;
var currPicObj;
var nextPicObj;
picLoadLoop = setInterval(checkFade, 500);
start();


这是译出来的的原始as
这类广告切换条一般都是使用函数来调用切换的
shenhua068 2007-05-08
  • 打赏
  • 举报
回复
用php 应该可以做~
b_ying 2007-04-27
  • 打赏
  • 举报
回复
as
懒得去死 2007-04-27
  • 打赏
  • 举报
回复
这个是用JAVASCRIPT实现的。
huangwei8123 2007-04-27
  • 打赏
  • 举报
回复
谢一个计时器,然后load图片

2,275

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计/Flash/Silverlight 开发 Flash流媒体开发
社区管理员
  • Flash流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧