Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var imgURLArray:Array = new Array("http...com/img1.jpg", "...", "...");
for(i = 0; i<imgURLArray.length; i++) {
a = this.attachMovie("MC_Template", "movie"+1, this.getNextHighestDepth());
//You can change properties now by referencing the MC using 'a'
a._x = 50;
a._y = 50;
a._alpha = 50;
}
for(i = 0; i<imgURLArray.length; i++) {
a = this.attachMovie("MC_Template", "movie"+1, this.getNextHighestDepth());
//You can change properties now by
//referencing the MC using 'a'
a._x = 50;
a._y = 50;
a._alpha = 50;
//You can create a movieclip that doesn't replace
//the instance created above:
a.createEmptyMovieClip("container", "depth of movieclip");
container.loadMovie(imgURLArray[i]);
//Above, the empty movie clip "container"
//is replaced with the img from the array "imgURLArray".
//you can also use loadMovie() on "a",
//but that will replace the instance of
//MC_Template with the img at the URL you
//put in loadMovie like:
a.loadMovie("[URL unfurl="true"]http://www.google.com/intl/en/images/logo.gif");[/URL]
//Before you can test this, you will probably
//need to save it. Also I think that
//if "[URL unfurl="true"]http://"[/URL] is not used, flash will
//think the url is relative.
}
/*
remember to use "[URL unfurl="true"]http://"[/URL] in the links
*/
var imgArray:Array = new Array("link1", "link2", ...);
for(i = 0; i<imgArray.length; i++) {
a = this.attachMovie("MC_Template", "movie"+i; this.getNextHighestDepth());
a.loadMovie(imgArray[i]);
//if you want to adjust movie clip properties
//like x, y, and alpha; you can do it in the attachMovie()
//or by referencing the object with 'a' lets say that I'm
//going to offset these by 50 more units each time and
//they get less and less transparent
a._x = 50*i;
a._y = 50*i;
a._alpha = (5*i)+25;
}
//Only code you need. Insert in main timeline.
//You do not need any code in the movieclip time line
//that code is taken care of here.
img1 = "[URL unfurl="true"]http://www.someURL.com/123.jpg";[/URL]
img2 = "[URL unfurl="true"]http://www.someURL.com/456.jpg";[/URL]
img3 = "[URL unfurl="true"]http://www.someURL.com/789.jpg";[/URL]
img4 = "[URL unfurl="true"]http://www.someURL.com/abc.jpg";[/URL]
var imgURLArray:Array = new Array(img1, img2, img3, img4);
for(i = 0; i<_root.imgURLArray.length; i++) {
this.attachMovie("mc1", "m"+i, this.getNextHighestDepth(), {_x:0, _y:i*110, _xscale: 50, _yscale: 50});
this["m"+i].createEmptyMovieClip("container", 1); //this["m"+i] is like using eval()
this["m"+i].container.loadMovie(_root.imgURLArray[i]);
this["m"+i].urlRef = _root.imgURLArray[i];
this["m"+i].imgMCReference = "";
this["m"+i].onRollOver = function() {
imgMCReference = this._parent.attachMovie("mc1", "FullSize"+i, this._parent.getNextHighestDepth(), {_x:200, _y:0});
imgMCReference.loadMovie(this.urlRef);
};
this["m"+i].onRollOut = function() {
removeMovieClip(imgMCReference);
};
}