PDA

View Full Version : doing some action one at a time


kellykamay
01-22-2005, 04:27 AM
hi all,


check out my code...as u can see there im trying to delay the circle MC's action, meaning the circle MC will fade in after the box MC is done in resizing itself...and looping this 4 times...i already tried putting a second setInterval in my main function...but on the next loop both MCs are now working simultaneously and thats not what i want...could pls help me?..

thanks in advance...Godspeed

cannon303
01-22-2005, 09:36 PM
did you want the circle to come in right at the end of the box doing 4 resizes?

var i:Number = 1
num = 0;
xtarget = 300;
ytarget = 400;
bb._alpha = 0;
fadetar = 100;
sq = function () {
sq_mc.onEnterFrame = function() {
difX = sq_mc._xscale-xtarget;
difY = sq_mc._yscale-ytarget;
sq_mc._xscale = sq_mc._xscale-(difX/3);
sq_mc._yscale = sq_mc._yscale-(difY/3);
i +=1
};
};
onEnterFrame = function() {
if (i == 138) {
fade = function () {
bb.onEnterFrame = function() {
alp = bb._alpha-fadetar;
bb._alpha = bb._alpha-(alp/6);
clearInterval(fadeinter);
};
};
}
}
showko = function () {
if (num != 4) {
trace(i);
sq();
fadeinter = setInterval(fade, 2000);
bb._alpha = 0;
xtarget = xtarget+(Math.random()*500);
ytarget = ytarget-(Math.random()*200);
num++;
} else {
clearInterval(intIndex);
}
};
intIndex = setInterval(showko, 4000);

kellykamay
01-23-2005, 01:55 AM
cannon

first, thank u for ur reply.. no dude..each time the box resize itself..the circle will appear...basically its like the www.twinphotographie.com's navigation effect...

white box will resize then image will appear...before the box do another resizes,image will be gone again...then appear again after the resize

coz im trying to make a slide show..loading a 200 pics from my hardisk,using
twinphotographie's navigation..but instead of using a button to change pictures,i use a timer...

sorry for the confusing question..hope u can help me again


thanks

kellykamay
01-30-2005, 11:24 AM
i,ve done it..i solved this problem..by using if statement....if boxmx is equal to target width and height...then circlemc will appear..hehehe..simple as that..thank u all..