treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Anyone dabble with ActionScript 3.0? Got a beginner question.

  • So, part of our college curriculum for computer programming is to take ActionScript (similar to Java). I have already made a few games so i know my way around enough. But what i want to know, is it possible to change the x and y dimensions (size) of the cursor?

    I have created my own cursor but i want to make the size of the click larger if its possible.
    My created cursor

    NewCursor.startDrag("true");
    Mouse.hide();

    Simple enough, no biggie, but i just want the 'mouse pointer' to be bigger, lets say 50px by 50px.

    If anyone knows a good resource for this or anything from personal experiences please let me know. I havent been able to locate anything in our book so im not sure if my goal is over the top or just not 'beginner'.

    Thanks!
  • I'm confused. From the looks of your code, I think all you need to do is increase the scale of your movieClip that you are using as a cursor.

    Do you want the cursor to be bigger for the whole browser/OS or just for over the flash window?

    You want the click area larger?

  • Yes, the click area to be larger. Sorry, explained what i wanted in a junky way. An example is the game brick breaker, you have a ball that you need to keep hitting and it breaks bricks. The object your hitting the ball with, lets call it the paddle, looks like a rectangle. When the ball comes in contact with the paddle it gets hit, any and every part of the paddle hits the ball.

    Does that example help explain what i mean?
  • Ah, you need to use hitTest();

    Would be something like:

    if ( hitTest(ball, paddle) ) {
    code...
    }
  • Awesome, thanks very much. I'm going to investigate that now, seems to be exactly what i need. You every down to critique some beginner flash AS3? lol... Let me know, i would love some advice.
  • My syntax may be incorrect, it has been a at least a year since I coded as3.

    I'm thinking it might be:

    ball.hitTest(paddle);


    either way, it would be best to put the test on the 'ball' so if you had multiple instances each will have a test for the paddle.