1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| var totalImage:Number = 35;
var positionImage:Array = [
{x:241, y:11}, // P01
...
{x:381, y:1204}
];
function load(aIndex:Number) {
var tmp:MovieClip = this.createEmptyMovieClip("conteneur_"+aIndex, this.getNextHighestDepth());
tmp._x = positionImage[aIndex].x;
tmp._y = positionImage[aIndex].y;
var listener:Object = new Object();
listener.onLoadInit = initialisation;
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(listener);
var fileName:String = "images/img_"+("00").substr(0, 2-aIndex.toString().length)+aIndex+".jpg";
mcl.loadClip(fileName, tmp);
}
function initialisation(aTarget:MovieClip) {
var currentIndex:Number = Number(aTarget._name.split("_")[1]);
if (currentIndex+1<totalImage) {
load(currentIndex+1)
}
aTarget._width = aTarget._height = 48;
var clip = _level0.Scroller.Scrolling_Page["conteneur_"+currentIndex];
clip.indice = currentIndex;
}
load(0);
clip.onRelease = function() {
trace(clip.indice)
} |
Partager