|
谁来救救我。。。dynamic image (xml generate path)
[复制链接]
|
|
发表于 30-3-2007 02:51 PM
|
显示全部楼层
這樣看程式碼太麻煩了, 而且你的做法是怎樣不清楚, 最好上傳你的文件和圖片等 |
|
|
|
|
|
|
|

楼主 |
发表于 20-4-2007 12:56 PM
|
显示全部楼层
已好了,最近比较不得空,所以没上来,等一下我找到了,贴上来和大家分享 |
|
|
|
|
|
|
|

楼主 |
发表于 20-4-2007 07:16 PM
|
显示全部楼层
var thumbPic:Number;
var row:Number = 7; //num pic per row
var kerning:Number = 5;
var locateX:Number = 1;
var locateY:Number = 1;
var maxScale:Number = 200;
var minScale:Number = 100;
var speed:Number = .7;
///////////////////////////////////////////////////////////////////////////////////////////
MovieClip.prototype.elastricity = function(num:Boolean) {
this.onEnterFrame = function() {
if (num) {
this._xscale += (maxScale-this._xscale)*speed;
this._yscale += (maxScale-this._yscale)*speed;
if (this._xscale == maxScale) {
delete this.onEnterFrame;
}
} else {
this._xscale += (minScale-this._xscale)*speed;
this._yscale += (minScale-this._yscale)*speed;
if (this._xscale == minScale) {
delete this.onEnterFrame;
}
}
};
};
MovieClip.prototype.loadImage = function() {
var MCLoader:MovieClipLoader = new MovieClipLoader();
MCLoader.loadClip(this.thumb, this);
}
function startImages() {
thumbPic = xmlData.firstChild.childNodes.length;
for (i=1; i<thumbPic; i++) {
picture.duplicateMovieClip("picture"+i, i);
//trace("get mc "+i);
var node = xmlData.firstChild.childNodes;
//--------load xml in each movie clip
//this["picture"+i].image = xmlData.firstChild.childNodes[ i].childNodes[0].nodeValue;
this["picture"+i].sost.thumb = node[ i].childNodes[0].firstChild.nodeValue;
this["picture"+i]._x = (picture._width+kerning)*locateX;
this["picture"+i]._y = (picture._height+kerning)*locateY;
this["picture"+i].depth = i;
this["picture"+i].onRollOver = function() {
this.swapDepths(1000);
this.elastricity(1);
//desc_txt.text = desc[0];
};
this["picture"+i].onRollOut = function() {
this.swapDepths(this.depth);
this.elastricity(0);
};
this["picture"+i].onPress = function() {
trace ("1x1");
details._visible=true;
details._x=200;
details._y=100;
};
if (i%row == 0) {
locateX = 0;
locateY++;
}
locateX++;
this["picture"+i].sost.loadImage();
if (i>=10){
index_up._visible=true;
index_down._visible=true;
}else{
index_up._visible=false;
index_down._visible=false;
}
}
picture._visible = false;
}; |
|
|
|
|
|
|
| |
本周最热论坛帖子
|