I copied a slideshow, it uses xml. How can I change the script and make the slides fade in/fade out? I know nothing about xml. Have enough trouble trying to learn AS! Anyone can help?
As a newbie, I think these forums are great. BUT!!!!
It's so easy to just copy codes and move on. Your movie works, but you don't understand sh*t what you've done....
I think tutorials are a good way of learning,
so guys at Flash Kit. PUT SOME MóRE TUTS ON THIS WEBSITE!!!
I don't go into details of this code because it is a different chapter:
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
To fade in something you have to first make it invisible by setting the alpha value to 0. The holder for your pics is targetClip and so you write this line:
targetClip._alpha = 0;
then you load your movie, pic or whatever into targetClip:
loadMovie(imagePath, targetClip);
now comes the fade in function, which we can do in different ways but I think it is clean AS to use the interval object. So we create a new object:
myAlpha = new Object();
Now the object will be filled with a function:
myAlpha.intervall = function(){
The next lines mean in other words that if the alpha of targetclip is smaller than maximum (100) then continously increment the alpha value starting from 0 by a value of 5. You can add other values here of course.
if (targetClip._alpha <100){
targetClip._alpha +=5;
if 100 is reached
} else {
targetClip._alpha = 100;
we stop the function
clearInterval(myTimer);
}
}
here we set the function with all the arguments and give a function name. The last number are the milliseconds interval the function is called. You can also change this value. When the value is higher the function will be called in less frequent intervals. Now whenever the function is called the alpha value of targetclip will increase by 5 or the value you enter until we stop it with clearInterval.
myTimer = setInterval(myAlpha,"intervall",50);
}
Hope this helps. But there are many tutorials here on Flashkit where you find explanations for what you are looking for. Also since this question is not really related to xml you should have gone to a different forum.
Last edited by cancerinform; 09-06-2003 at 07:39 PM.
- The right of the People to create Flash movies shall not be infringed. -
The reason I posted this was to cause a reaction. I got more reply's on this than of the initial post!
Anyway, for a newbie like me, some of these codes look a lot like math. And that wasn't my favourite subject at school!
But, than again, it's cool people wanna help eachother out.
I started using Flash 4 weeks ago, and I'm improving!
Still, I'm actualy a painter...