Hello all,
I am having a bit of trouble getting my for loop to stop, and am hoping that y’all might be able to help me out. Please bear with me as I am pretty new to the whole actionscript thing, I have only done minor things with it in the past. Also if anyone has a more efficient way of writing this code please let me know as I am trying to get better all the time!
What I want to happen is when a button is rolled over it gets a movieclip from the library (not on the stage previous to rollover) move it the height of the movieclip up on the y axis as well as fade in and stop on roll out do the opposite, except if you rollover and rollout to quickly I don’t want to mc to show at all. I haven’t got to the rollout part yet but if you have any direction I should go that would be much appreceated. Maybe a time thing if the mouse isn’t over the button for x length of time then the mc won’t display. Am I on the right track or is there an easier way?
Anyway here is my script:
// This is so when the button is rolled over it calls this function
function butXpos() {
butX = getProperty(_root.button1, _x);
butY = getProperty(_root.button1, _y);
}
function mcHeight() {
_root.attachMovie("mc1", "mc1", 1);
mc1._x = butX;
mc1._y = butY;
mc1._alpha = 0;
}
function mcAnimate() {
mc1.onEnterFrame = function() {
mcH = getProperty(_root.mc1, _height);
mcY = getProperty(_root.mc1, _y);
mcRise = (mcY+mcH);
mcA = mc1._alpha;
if (mcY != mcRise) {
mc1._y-=5;
trace("Not equal");
} else {
trace("Equal");
}
if (mcA<=100) {
mc1._alpha += 10;
}
};
}
The alpha fade works great :thumb: then again everything works except the stopping of the loop:h:
BTW I cannot get the y coordinate to equal the y coord + height in the trace action
Thank you in advance for your help!