Prototype not working

Well, this is pretty simple. I was trying to make a prototype by my own, not looking at any code or anything, and finally i did it. Well, “not a big deal”, i know, but something strange is happening, and i don’t know why.
The thing is a fading mc. When i have only one on the stage ig works fine, and i can roll over it as many times as i want and it fades fine. But if i puts more than one mc, if i roll over one once, it stops working … what am I missing??

:-\ :-\ :-\ :-\

Here you have the fla.

If you set a prototype to change the default behaviour of a moviec clip - this will affect all movie clips. Normally because of using the same variables for all mcs.

Also you have _alpha += 20, with no stop limit. So when you rollout and don’t rollover again - the alpha just increases more and more, so when you roll over again - you have to wait for a while for the alpha to reduce.

thanks. i’ll see if i can fix it :stuck_out_tongue:

Make sure you explicit variables.
e.g.
var myvar=…

I don’t think it’s about explicit variables, I think it’s that in the defined function one set of variables is defined for the effect or whatever the prototype is supposed to do, so whenever that variable is called on, it’s called on my all movies which can mess things up. Each clip will need to refer to it’s own defined set of variables.

I just downloaded the .fla
Ok download this fix, see the code and you’ll understand.


sorry my english is not good :bandit:

That’s what I already said to him. He had no way of limiting the alpha fade. It would continue to go below 0 and above 0. It wouldn’t have made difference he had used var fadeoutstart or just fadeoutstart - although using var is good practice - he needed to prevent the alpha from going below 0 and above.

Now that will work for the mc’s he has, but if the creates another mc in that same swf it will start doing the same thing - fade out and fade in.

well, thank u both!! i always miss something like this little details in my codings.:stuck_out_tongue:

oh, and two more things:
joyhost your english is just fine. there is a saying in Spain that say " a buen entendedor pocas palabras bastan" ,that is to say (more or less) that the one who wants to understand needs few words…
=)

and flex…

=) =) =)
i’m a “her” … he, he,… this happens to me all the time.
I said something about nicks somewhere in other thread at the Random forum. This shows i’m right :stuck_out_tongue:

You know I was going to say, or “her” … but hey…