Skip to main content
Inspiring
September 1, 2006
Question

I WILL PAY FOR HELP!!!

  • September 1, 2006
  • 1 reply
  • 185 views
Ok,

I've been working on this way too long and I don't understand scripting well enough to make this work. I need to make the following script flip (not crossfade) 17 images in a sequence. I also need the same script to work in multiple movie clips that are contained within the same master swf. Here is the code:

//-----------------<image crossfade - Mov1>-----------------\\
var dyArray1:Array = new Array(17);
dyArray1[0] = "image0.jpg";
dyArray1[1] = "image1.jpg";
dyArray1[2] = "image2.jpg";
dyArray1[3] = "image3.jpg";
dyArray1[4] = "image4.jpg";
dyArray1[5] = "image5.jpg";
dyArray1[6] = "image6.jpg";
dyArray1[7] = "image7.jpg";
dyArray1[8] = "image8.jpg";
dyArray1[9] = "image9.jpg";
dyArray1[10] = "image10.jpg";
dyArray1[11] = "image11.jpg";
dyArray1[12] = "image12.jpg";
dyArray1[13] = "image13.jpg";
dyArray1[14] = "image14.jpg";
dyArray1[15] = "image15.jpg";
dyArray1[16] = "image16.jpg";


// Script to load two pictures and cycle them with a fading effect.
// Note: this looks a lot better with 30 frames/second.
var showTime:Number = 500 // milliseconds the picture shows at 100% alpha.

for(var i:Number=0; i<17; i++){
var mc1 = this.createEmptyMovieClip("mc_Img"+i, i);
mc1.loadMovie("images/home/Mon1/image"+i+".jpg");
mc1._alpha = 0;
}

var duration:Number = 21; // milliseconds per alpha change (framerate).
var count:Number = 0;
var alphaPhase:Number = 1;
var alphaCount:Number = 0;

var imgIndex = 0;
function picSwap1():Void {
count++;
if(count >= (showTime/duration)) {
alphaCount += alphaPhase;
// fade the current image out
this["mc_Img"+imgIndex]._alpha = 100-alphaCount;
// fade the next image in, modular division is used with the array length
// to keep the indices within bounds of the array
this["mc_Img"+(imgIndex+1)%dyArray1.length]._alpha = alphaCount;
if(alphaCount >= 100 || alphaCount <= 0) {
count = 0;
//alphaPhase *= -1;
// instead of reversing alpha phase, step along to the next image
//and reset alphaCount
imgIndex = (imgIndex+1)%dyArray1.length;
alphaCount = 0;
}
}
}

this.mc_Img0._alpha = 100;
var intervalId:Number = setInterval(picSwap1, duration);
//-----------------</image crossfade - Mov2>-----------------\\


This works great by itself (in a single movie clip) and if I want it to cross fade. As soon as I try to apply it to the other 8 movie clips...with a different set of images in a different folder and changing the name of the array etc...the timing on the sequences syncs with the other sequences and ignores the duration/showtime. I would like to lose the crossfade and also have independant control on the duration/showtime over multiple movie clips contained in one master swf.

PLEASE PLEASE someone...anyone...if you know how to do what I am trying to do please let me know...when finished...i can pay the person a reasonable amount for sorting this out for me.

Thank you in advance,

Kyle
This topic has been closed for replies.

1 reply

Inspiring
September 1, 2006
What does your code look like for the movie clips?


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com
*Must Read* http://www.smithmediafusion.com/blog


"kypsul" <webforumsuser@macromedia.com> wrote in message
news:ed9uj8$jb8$1@forums.macromedia.com...
> Ok,
>
> I've been working on this way too long and I don't understand scripting
> well
> enough to make this work. I need to make the following script flip (not
> crossfade) 17 images in a sequence. I also need the same script to work in
> multiple movie clips that are contained within the same master swf. Here
> is the
> code:
>
> //-----------------<image crossfade - Mov1>-----------------\\
> var dyArray1:Array = new Array(17);
> dyArray1[0] = "image0.jpg";
> dyArray1[1] = "image1.jpg";
> dyArray1[2] = "image2.jpg";
> dyArray1[3] = "image3.jpg";
> dyArray1[4] = "image4.jpg";
> dyArray1[5] = "image5.jpg";
> dyArray1[6] = "image6.jpg";
> dyArray1[7] = "image7.jpg";
> dyArray1[8] = "image8.jpg";
> dyArray1[9] = "image9.jpg";
> dyArray1[10] = "image10.jpg";
> dyArray1[11] = "image11.jpg";
> dyArray1[12] = "image12.jpg";
> dyArray1[13] = "image13.jpg";
> dyArray1[14] = "image14.jpg";
> dyArray1[15] = "image15.jpg";
> dyArray1[16] = "image16.jpg";
>
>
> // Script to load two pictures and cycle them with a fading effect.
> // Note: this looks a lot better with 30 frames/second.
> var showTime:Number = 500 // milliseconds the picture shows at 100% alpha.
>
> for(var i:Number=0; i<17; i++){
> var mc1 = this.createEmptyMovieClip("mc_Img"+i, i);
> mc1.loadMovie("images/home/Mon1/image"+i+".jpg");
> mc1._alpha = 0;
> }
>
> var duration:Number = 21; // milliseconds per alpha change (framerate).
> var count:Number = 0;
> var alphaPhase:Number = 1;
> var alphaCount:Number = 0;
>
> var imgIndex = 0;
> function picSwap1():Void {
> count++;
> if(count >= (showTime/duration)) {
> alphaCount += alphaPhase;
> // fade the current image out
> this["mc_Img"+imgIndex]._alpha = 100-alphaCount;
> // fade the next image in, modular division is used with the array length
> // to keep the indices within bounds of the array
> this["mc_Img"+(imgIndex+1)%dyArray1.length]._alpha = alphaCount;
> if(alphaCount >= 100 || alphaCount <= 0) {
> count = 0;
> //alphaPhase *= -1;
> // instead of reversing alpha phase, step along to the next image
> //and reset alphaCount
> imgIndex = (imgIndex+1)%dyArray1.length;
> alphaCount = 0;
> }
> }
> }
>
> this.mc_Img0._alpha = 100;
> var intervalId:Number = setInterval(picSwap1, duration);
> //-----------------</image crossfade - Mov2>-----------------\\
>
>
> This works great by itself (in a single movie clip) and if I want it to
> cross
> fade. As soon as I try to apply it to the other 8 movie clips...with a
> different set of images in a different folder and changing the name of the
> array etc...the timing on the sequences syncs with the other sequences and
> ignores the duration/showtime. I would like to lose the crossfade and also
> have
> independant control on the duration/showtime over multiple movie clips
> contained in one master swf.
>
> PLEASE PLEASE someone...anyone...if you know how to do what I am trying to
> do
> please let me know...when finished...i can pay the person a reasonable
> amount
> for sorting this out for me.
>
> Thank you in advance,
>
> Kyle
>