flash mx 2004 自定义滚动条代码
来源:互联网 发布:国际清算银行数据 编辑:程序博客网 时间:2024/04/29 23:12
//定义scroll的总长
var totalDist = Math.floor((myText._height-myText._y)-down_btn._height-scrollBar_mc._height);
var target = "text.txt";
var target1="aa.htm";
//设置按钮和滑块的位置
up_btn._x = myText._x+myText._width;
up_btn._y = myText._y+up_btn._height;
down_btn._x = myText._x+myText._width;
down_btn._y = myText._y+myText._height-down_btn._height;
scrollBar_mc._x = myText._x+myText._width;
scrollBar_mc._y = myText._y+up_btn._height;
//绘制边
drawBorder = function (depth, pos_x, pos_y, par1, par2) {
border = createEmptyMovieClip("border", depth);
with (border) {
lineStyle(1, 0xcccccc, 100);
moveTo(pos_x, pos_y);
lineTo(pos_x+par1, pos_y);
lineTo(pos_x+par1, pos_y+par2);
//lineTo(pos_x, pos_y+par2);
//lineTo(pos_x, pos_y);
trace(pos_x);
trace(pos_y);
}
};
//创建scroll函数
startScroll = function (texto, direction) {
this.createEmptyMovieClip("loop", this.getNextHighestDepth());
loop.onEnterFrame = function() {
myText.scroll += direction;
var percent = Math.floor((myText.scroll/myText.maxscroll)*100);
var position = Math.floor((totalDist/100)*percent);
scrollBar_mc.txte.percenty=percent+"%";
if (myText.scroll == 1) {
scrollBar_mc._y = myText._y+up_btn._height;
scrollBar_mc.txte._visible=false;
} else {
scrollBar_mc.txte._visible=true;
scrollBar_mc._y = position;
}
};
};
//停止SCROLL
stopScroll = function () {
delete loop.onEnterFrame;
};
down_btn.onPress = function() {
startScroll(texto, 1);
};
up_btn.onPress = function() {
startScroll(texto, -1);
};
down_btn.onRelease = down_btn.onReleaseOutside=function () {
stopScroll();
};
up_btn.onRelease = up_btn.onReleaseOutside=function () {
stopScroll();
};
var myLoadText = new LoadVars();
myLoadText.onLoad = function(success) {
if (success) {
myText.html = true;
myText.htmlText=myLoadText.texto;
drawBorder(100, myText._x, myText._y, myText._width, myText._height);
scrollBar_mc.txte._visible=false;
if (myText.maxscroll == 1) {
up_btn._visible = false;
down_btn._visible = false;
scrollBar_mc._visible = false;
} else {
drawBorder(200, myText._x+myText._width, myText._y, 15, myText._height);
}
} else {
myText.html = "不能载入文本";
}
};
myLoadText.load(target);
- flash mx 2004 自定义滚动条代码
- flash 滚动条代码
- webkit浏览器自定义滚动条样式代码
- webkit浏览器自定义滚动条样式代码
- flash滚动条制作
- Flash MX游戏制作常用代码解析
- 自定义BODY滚动条
- 自定义滚动条
- 自定义datagridview滚动条
- 自定义滚动条
- JPanel自定义滚动条
- 自定义网页滚动条
- 自定义滚动条
- 自定义滚动条插件
- 自定义滚动条
- 自定义滚动条
- css3 自定义滚动条
- 滚动条的自定义
- 常用查找算法
- 个人在www.j2medev.com上搜集的一些技术资料
- 细数微软Windows live战略背后的领军人物
- C#代码转成VB代码
- 计算机英语翻译--题目八
- flash mx 2004 自定义滚动条代码
- 想女孩,你活该!
- The Best of Both Worlds: Integrating JSF with Struts in Your J2EE Applications
- The Best of Both Worlds: Integrating JSF with Struts in Your J2EE Applications
- The Best of Both Worlds: Integrating JSF with Struts in Your J2EE Applications
- 什么是 Caché?
- Ajax原理详细说明(转自ibm开发者网站)
- 破解Genuine Advantage正版验证+重关联VBS
- Databases in Dreamweaver MX