PDA

View Full Version : what is wrong with this code?


golffor1
03-21-2010, 02:17 AM
I am trying to teach myself flash....

I have the following code

function moveBox() {

box_mc._x += 10;
varText.text = "output value"; // ?
while (box_mc.x < 5){
trace ("Hello");
i++;
varText.text = "output value"; // ?
}
if (box_mc._x>300) {
clearInterval(myInterval);
}

}

box_mc.onRelease = function() {

box_mc._x = 0;
myInterval = setInterval(moveBox, 500);
};



I have two items on my frame. One being a dynamic text box called varText and another box called box_mc. I am trying to get the the text box to display a dynamic amount.

Is it true that box_mc should increment? Then varText would display the information for the box?

If this is nto true can you help me out with my learning curve?

golffor1
03-21-2010, 04:31 AM
Found it...it was the wrong variable that is being called.

eu4ria
03-22-2010, 05:02 PM
I know you found your error so may not check back here. But if you are just learning Flash it may be better to start with AS3 rather than AS2. It will save relearning actionscript for AS3 which is a LOT different to AS2.