1 Attachment(s)
12 lines of code - what's wrong?
Absolute newbee I'm afraid - at the "knows a bit of AS but really know less than nothing" stage.
Want a dynamic text box to count down from 4 to zero when a black circle is dragged on to a green static box.
I want the dynamic text box to then say "Fail!" when when the four hits on the green box take place.
You've probably guessed I'm after the principle of the coding not a final piece. I've attached the fla for all to laugh at.
Any help welcomed
Huw.
Code here if you need:
var number:Number = 4;
onEnterFrame = function () {
countdown.text = number;
};
ball.onPress = function() {
startDrag(this);
};
ball.onRelease = function() {
stopDrag();
};
if (ball.hitTest(green)) {
countdown.text = number-1;
};
if (number<1) {
countdown.text = "Fail!";
};