Grow your CSS skills. Land your dream job.

Anyone dabble with ActionScript 3.0? Got a beginner question.

  • # May 15, 2012 at 12:44 pm

    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!

    # May 15, 2012 at 2:09 pm

    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?

    # May 15, 2012 at 8:50 pm

    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?

    # May 16, 2012 at 9:33 am

    Ah, you need to use hitTest();

    Would be something like:


    if ( hitTest(ball, paddle) ) {
    code...
    }
    # May 16, 2012 at 3:15 pm

    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.

    # May 16, 2012 at 4:06 pm

    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.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".