Ok a second shot at this.
I need to set up an interval..then I need to use that interval to move a movieclip across the screen to a set x coordinate. I am using the interval because a straight for loop doesn't scroll...it just jumps.
Here is the button code:
Here is the function that is called:
Kenneth has tried to help in another thread, but I can't get his code to work at all on my Flash 8...it just does nothing...not even an error.
I have continued to struggle with this for more days that I wish to admit, and this functionality will end up in a project for work...and I really really need to move on to the sounds and get this done.
In the above code I have two functions...I can trace all the variables from the first in the second...no problem, but the minute I try to use the ["mcBox"+o]._x....I get undefined. I need that number!!!
Actually, I can even trace (this["mcBox+o"])...that works. But the minute I try to get the x coord...it dies.
GAH!!!!!
Please save me!
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt
I need to set up an interval..then I need to use that interval to move a movieclip across the screen to a set x coordinate. I am using the interval because a straight for loop doesn't scroll...it just jumps.
Here is the button code:
Code:
btMove.onRelease = function(){
moveMovie(200,1,5);
}
btMove2.onRelease = function (){
moveMovie (200,2,5);
}
Here is the function that is called:
Code:
function moveMovie (r,o,c){
var q:Number = (this["mcBox"+o]._x);
var m:Number = (q - r);
//this will set an interval to slide the movie along
var myInterval = setInterval (moveSlowly, 100)
function moveSlowly(){
trace (this["mcBox"+o]._x);
if (this["mcBox"+o]._x >= r){
q -= c;
this["mcBox"+o]._x = q;
updateAfterEvent();
}
else if (["mcBox"+o]._x <= r){
q += c;
this["mcBox"+o]._x = q;
trace (q);
}
else {
clearInterval (myInterval);
}
}
}
Kenneth has tried to help in another thread, but I can't get his code to work at all on my Flash 8...it just does nothing...not even an error.
I have continued to struggle with this for more days that I wish to admit, and this functionality will end up in a project for work...and I really really need to move on to the sounds and get this done.
In the above code I have two functions...I can trace all the variables from the first in the second...no problem, but the minute I try to use the ["mcBox"+o]._x....I get undefined. I need that number!!!
Actually, I can even trace (this["mcBox+o"])...that works. But the minute I try to get the x coord...it dies.
GAH!!!!!
Please save me!
Dave
"Credit belongs to the man who is actually in the arena - T.Roosevelt