A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 12 lines of code - what's wrong?

Threaded View

  1. #1
    Member
    Join Date
    Jan 2007
    Posts
    56

    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!";
    };
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center