Hi guys!
I have two doubts (intermediate level), here they are:
ONE
I know how to create and name a function and understand the way they work, however, is there any way for me to call a function and make it execute onEnterFrame?
I’ve tried a bunch of different ways to make the syntax work and although Flash tells me that the script contains no errors It doesn’t behave the way I expect.
TWO
I’ve been trying to create a motion tweenless slideshow using only ActionScript, nothing fancy, just a little time saver.
My question is, I want Flash to understand what image is current and what image is next and apply the actionscript fade in/out to the desired and dynamic movieclip.
The thing is, whenever I try to combine a string (ex: “img”) with a variable (currentImage) Flash (although is trace’s the correct value in the output panel) doesn’t seem to recognize what I want to do. What I am doing wrong?
I’ll give you a pratical example:
Let’s say I have a bunch of movieclips named ball1, ball2, ball3 and so on.
I want to do something to ball1 and when it finishes I want Flash to increment the number and do the same to ball2 without me having to type more code, so it would make something like this:
[SIZE=“1”][COLOR=“Blue”]var dynamicNumber = 1;
changeAlpha = function () {
(“ball” + dynamicNumber)._alpha = 50; //which equals ball1 I would expect.
};
onEnterFrame = function(){
if ((“ball” + dynamicNumber)._alpha == 50) {
dynamicNumber += 1;
changeAlpha; //which now the value would be ball2.
}
}[/COLOR][/SIZE]
So, he would increment the dynamicNumber variable and when the movieclip with that value had it’s alpha set to 50 it would just move on to the next, thus being dynamic and avoiding me to type the code for 40 movieclips.
Don’t know if I was able to explain it but I took a shot.
Thx in advance and sorry for the looong post :huh: