Would anyone be able to help me with how to create a routine for a movieclip.
What i mean by routine is the things a mc has to do before its finished. I can code this by doing it step by step but that will take ages. What i want is. For the mc to move from side to side.
Eg
step1 = move right till its at a certain point.
step2 = wait here.
step3 = move left till its at a certian point.
step4 = move right till its at a certian point.
step5 = wait here.
step6 = move right till its at a certian point.
And so on. So what i want to know is how would i do this. I have considered a function. to move the mc. Which calls its next destination from an array. But i wouldnt know how to write it properly.
My thoughts are the in the arry have to _x cordinantes for each move.
eg (205, 400, 21, 16) ...
and in the function
function move(){
// call the co-ordinates.And move the mc to that co-ordinante.
}
ThankS In AdvancE
Last edited by hooligan2001; 01-29-2003 at 05:56 AM.
There are probably a thousand and one soloutions to this, ranging from multidimensional arrays to OO-arrays, and some soloutions might even include a dash of black-magic . But my first qad (Quick And Dirty) thought is:
An array for "actions" 1=move to x,y 2=wait for n frames/secs/whatever
Another array for values; If "action"=1 move to x,y over an animation sequence have a function perform the action over the amount of frames/secs/whatever it will take, when that action is done, go on read the next value from the "action" array and so forth...
HTH
Last edited by mastermute; 01-29-2003 at 08:25 AM.
So what i want is a function that can tell wether the old loc is > or < then the new loc and either + the X or minus. once it has done this retrieve the next co-ordinants
Last edited by hooligan2001; 01-29-2003 at 09:18 AM.
Originally posted by hooligan2001 So what i want is a function that can tell wether the old loc is > or < then the new loc and either + the X or minus. once it has done this retrieve the next co-ordinants