Hello,
I am in need of a little help to put me towards the right direction - I thank anyone that can help me!
What Im trying to do is create a Dynamic slideshow. So far I’ve told flash to create a blank MC image folder and pull out the next image. Once that blank MC has an image in it I create a new one.
So say I had 4 images I would have 4 MC’s containing the images inside another MC. Here is the code if I’ve confused anyone.
function loadImages(blankMC, amount:Number):Void {
blankMC.onLoadInit = function(mcTarget:MovieClip) {
};
for (var i = 0; i<amount; i++) {
var mc:MovieClip = blankMC.createEmptyMovieClip("img_"+i, blankMC.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(blankMC);
var sURL:String = "images/0"+i+".jpg";
mcLoader.loadClip(sURL, blankMC["img_"+i]);
trace("this is varMC " + mc)
}
}
this.createEmptyMovieClip("blank", this.getNextHighestDepth());
blank._x = 10;
blank._y = 10;
loadImages(blank, 4);
Now this is where I am hopefully stuck and confused!
Im wanting to create a transition between each one, fading the alpha of one and show the next. Any ideas where to start?
Thanks
UPDATE
Ive started working with a fade but something is messing up… could someone take a look.
Heres all the code all you have to do is copy it into your movie and create an images folder.
function loadImages(blankMC, amount:Number):Void {
blankMC.onLoadInit = function(mcTarget:MovieClip) {
};
for (var i = 0; i<amount; i++) {
var mc:MovieClip = blankMC.createEmptyMovieClip("img_"+i, blankMC.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(blankMC);
var sURL:String = "images/0"+i+".jpg";
mcLoader.loadClip(sURL, blankMC["img_"+i]);
trace("this is varMC "+mc);
}
}
this.createEmptyMovieClip("blank", this.getNextHighestDepth());
blank._x = 10;
blank._y = 10;
loadImages(blank, 11);
function fade(MC:MovieClip) {
onEnterFrame = function (load) {
MC._alpha = random(100);
MC.a_count = MC._alpha;
MC.targetA = random(100);
onEnterFrame = function () {
ca = _alpha;
a_diff = MC._alpha-this.targetA;
MC.a_count -= a_diff*.1;
MC._alpha = this.a_count;
if (Math.abs(a_diff)<1) {
MC.targetA = random(100);
MC.a_count = MC._alpha;
}
};
};
}
fade(blank.img_00)
fade(blank.img_01)
fade(blank.img_02)
fade(blank.img_03)
fade(blank.img_04)
fade(blank.img_05)
fade(blank.img_06)
fade(blank.img_07)
fade(blank.img_08)
fade(blank.img_09)
fade(blank.img_10)