-
Slideshow buttons
Okay,so..
I made this slideshow that plays 5 pics with one mc that loads count+".jpg" picture and i have this code in frames:
Frame1:
var count = "1";
Frame3:
Code:
stop();
onEnterFrame = function() {
_root.mc._alpha += 10 ;
if(this.mc._alpha > 100){
gotoAndStop(4);
}
}
Frame4:
Code:
stop();
setTimeout(myFunction, 500);
function myFunction()
{
onEnterFrame = function() {
_root.mc._alpha -= 10 ;
if(this.mc._alpha < 0){
count++;
if(count > 5) {
count = 1;
}
gotoAndPlay(3);
}
}
}
It works perfectly but when i try to add a button or mc that will change the var count (load a pic of my choice) it gets all buggy...
SWF
FLA
Can anyone help me add the 5 buttons witch will change the pic?
Thanks
-
Designer, Programmer, Musician
Working on it. I just can't stop/delete the onEnterFrame of the alpha animation. But i know if i keep working on it i will make it.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
.
Hi,
Saw your thread thought i'd help out.
Attachment 73919 : swf and fla(CS 6)
No onEnterFrames, when a button is clicked it will fade out the exisiting image and load the new one, has image loader built in.
Buttons are created based on the image amount.
You will obviously need to have your images in the same directory.
Fruity
-
The thing is that i'm using flash 8 :S
-
Okay installed flash cs6,yeah it does what it should do just can i change the speed of fading and time of switching pictures?
AngelHDZ did you manage to do something?
Thanks for helping
-
.
Hi,
you can control the speeds from the first frame, changing the time the image is shown for is as easy as adding frames between the gap, if you are capable you could add a setInterval instead.
-
Designer, Programmer, Musician
Morsus, i tried it but i didn't get it to work. What fruitbeard made is even better, but it still have a bug, and it is when you click the buttons not always the corresponding image is shown, sometimes it shows the first image. I think that is surely due to the function timeout. We need to manage to stop or delete it on buttons press. I tried clearTimeout , delete myFunction;, delete _root.onEnterFrame;, but nothing.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
.
Hi,
You were right Angel, it was a tad buggy, so yet again, here it is fixed.
my hobby
-
Works like a charm. Even if i do not really understand the code...but nvm xD
Thanks a bunch guys
-
Designer, Programmer, Musician
Good job fruitbeard, he will love it. And very well played hehe, no need for use setTimeout function, using frames instead. It's a pain trying to stop or delete the the setTimeout function or the onEnterFrame within it.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|