关于flash XML加载图片,怎么样可以在图片上加超链接 80
flashas源码如下stop();varcurPage_num:Number=0;varsizPage_num:Number=16;varpai_num:Number=...
flash as源码如下
stop();var curPage_num:Number = 0;
var sizPage_num:Number = 16;
var pai_num:Number = 4;
var width_num:Number =130;
var height_num:Number = 110;
var jia_num:Number = 15;
var url_array:Array = new Array();
this.pagedown_btn._visible = false;
this.pageup_btn._visible = false;
function alpha_func(_mc:MovieClip) {
_mc._alpha = 5;
_mc.onEnterFrame = function() {
this._alpha += 5;
this._alpha>=95 ? delete this.onEnterFrame : };}
var _mcl:MovieClipLoader = new MovieClipLoader();
this.onLoadInit = function(_mc:MovieClip) {
_mc._txt.removeTextField();
_mc._width = 130;
_mc._height = 110;
alpha_func(_mc);
};
this.onLoadProgress = function(_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
_mc.createTextField("_txt", 200, 20, 10, 60, 30);
_mc._txt.textColor = 0xff0000;
_mc._txt.text = Math.floor((bytesLoaded/bytesTotal*10000)/100)+"%";
};
this.onLoadError = function(_mc:MovieClip) {
_mc.createTextField("_txt", 200, 20, 10, 60, 30);
_mc._txt.textColor = 0xff0000;
_mc._txt.text = "加载失败!";
};
_mcl.addListener(this);
var url_xml:XML = new XML();
url_xml.ignoreWhite = true;
url_xml.onLoad = function(success) {
if (success) {
for (var d:Number = 0; d<this.firstChild.childNodes.length; d++) {
url_array.push(this.firstChild.childNodes[d].attributes.name);
}
enabled_func();
} else {
trace("xml文档加载失败!");
}
};
url_xml.load("../new_txt/img.xml");
var show_func:Function = function (_page:Number) {
if (_page<1 && _page>=Math.ceil((url_array.length-1)/sizPage_num)-1) {
this.pageup_btn.enabled = false;
this.pagedown_btn.enabled = false;
} else if (_page<1) {
this.pageup_btn.enabled = false;
this.pagedown_btn.enabled = true;
} else if (_page>=Math.ceil((url_array.length-1)/sizPage_num)-1) {
this.pagedown_btn.enabled = false;
this.pageup_btn.enabled = true;
} else {
this.pageup_btn.enabled = true;
this.pagedown_btn.enabled = true;
}
for (var d:Number = 0; d<sizPage_num; d++) {
//attachMovie("pic_mc", "pic_mc"+d, d+1000, {_x:20+Math.floor(d/Math.floor(Math.sqrt(sizPage_num)))*100, _y:20+d%Math.floor(Math.sqrt(sizPage_num))*100});
attachMovie("pic_mc", "pic_mc"+d, d+1000, {_x:300+d%pai_num*(width_num+jia_num), _y:43+Math.floor(d/pai_num)*(height_num+jia_num)});
}
for (var d:Number = 0; d<sizPage_num; d++) {
if (_page*sizPage_num+d>=url_array.length) {
break;
}
_mcl.loadClip(url_array[_page*sizPage_num+d], this["pic_mc"+d]); }};
}
function enabled_func() {
this.pagedown_btn._visible = true;
this.pageup_btn._visible = true;
show_func(curPage_num);
this.pagedown_btn.onRelease = function() {
if (curPage_num<Math.floor(url_array.length/sizPage_num)) {
curPage_num++;
show_func(curPage_num);
}
};
this.pageup_btn.onRelease = function() {
if (curPage_num>0) {
curPage_num--;
show_func(curPage_num);
}
};
}
高手帮帮忙,不胜感谢! 展开
stop();var curPage_num:Number = 0;
var sizPage_num:Number = 16;
var pai_num:Number = 4;
var width_num:Number =130;
var height_num:Number = 110;
var jia_num:Number = 15;
var url_array:Array = new Array();
this.pagedown_btn._visible = false;
this.pageup_btn._visible = false;
function alpha_func(_mc:MovieClip) {
_mc._alpha = 5;
_mc.onEnterFrame = function() {
this._alpha += 5;
this._alpha>=95 ? delete this.onEnterFrame : };}
var _mcl:MovieClipLoader = new MovieClipLoader();
this.onLoadInit = function(_mc:MovieClip) {
_mc._txt.removeTextField();
_mc._width = 130;
_mc._height = 110;
alpha_func(_mc);
};
this.onLoadProgress = function(_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
_mc.createTextField("_txt", 200, 20, 10, 60, 30);
_mc._txt.textColor = 0xff0000;
_mc._txt.text = Math.floor((bytesLoaded/bytesTotal*10000)/100)+"%";
};
this.onLoadError = function(_mc:MovieClip) {
_mc.createTextField("_txt", 200, 20, 10, 60, 30);
_mc._txt.textColor = 0xff0000;
_mc._txt.text = "加载失败!";
};
_mcl.addListener(this);
var url_xml:XML = new XML();
url_xml.ignoreWhite = true;
url_xml.onLoad = function(success) {
if (success) {
for (var d:Number = 0; d<this.firstChild.childNodes.length; d++) {
url_array.push(this.firstChild.childNodes[d].attributes.name);
}
enabled_func();
} else {
trace("xml文档加载失败!");
}
};
url_xml.load("../new_txt/img.xml");
var show_func:Function = function (_page:Number) {
if (_page<1 && _page>=Math.ceil((url_array.length-1)/sizPage_num)-1) {
this.pageup_btn.enabled = false;
this.pagedown_btn.enabled = false;
} else if (_page<1) {
this.pageup_btn.enabled = false;
this.pagedown_btn.enabled = true;
} else if (_page>=Math.ceil((url_array.length-1)/sizPage_num)-1) {
this.pagedown_btn.enabled = false;
this.pageup_btn.enabled = true;
} else {
this.pageup_btn.enabled = true;
this.pagedown_btn.enabled = true;
}
for (var d:Number = 0; d<sizPage_num; d++) {
//attachMovie("pic_mc", "pic_mc"+d, d+1000, {_x:20+Math.floor(d/Math.floor(Math.sqrt(sizPage_num)))*100, _y:20+d%Math.floor(Math.sqrt(sizPage_num))*100});
attachMovie("pic_mc", "pic_mc"+d, d+1000, {_x:300+d%pai_num*(width_num+jia_num), _y:43+Math.floor(d/pai_num)*(height_num+jia_num)});
}
for (var d:Number = 0; d<sizPage_num; d++) {
if (_page*sizPage_num+d>=url_array.length) {
break;
}
_mcl.loadClip(url_array[_page*sizPage_num+d], this["pic_mc"+d]); }};
}
function enabled_func() {
this.pagedown_btn._visible = true;
this.pageup_btn._visible = true;
show_func(curPage_num);
this.pagedown_btn.onRelease = function() {
if (curPage_num<Math.floor(url_array.length/sizPage_num)) {
curPage_num++;
show_func(curPage_num);
}
};
this.pageup_btn.onRelease = function() {
if (curPage_num>0) {
curPage_num--;
show_func(curPage_num);
}
};
}
高手帮帮忙,不胜感谢! 展开
展开全部
<?xml version="1.0" encoding="UTF-8" ?>
<imgs>
<pic name="images/01.jpg" url="www.baidu.com" />
<pic name="images/02.jpg" url="www.qq.com"/>
<pic name="images/03.jpg" url="www.163.com" />
<pic name="images/04.jpg" url="www.hao123.com" />
</imgs>
<imgs>
<pic name="images/01.jpg" url="www.baidu.com" />
<pic name="images/02.jpg" url="www.qq.com"/>
<pic name="images/03.jpg" url="www.163.com" />
<pic name="images/04.jpg" url="www.hao123.com" />
</imgs>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询