PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Need help whit tile movement.
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Need help whit tile movement.

  1. #1
    Junior Member
    Join Date
    Jul 2010

    resolved [RESOLVED] Need help whit tile movement.

    Hey, I have this problem:

    I got a "square" that is following my mouse around on the screen its size is 20x20. but what i am after is so that the square will follow my mouse, but only move 20 pix at a time. for example if i have my mouse at the top corner of the flash movie the square will be located at 0x,0y. and when i move my mouse more that 20 pix down(lets use y cord for this). the "square" will jump to 0x 20y then 40y 60y etc. Basiacally i want this square to move in a title/"snap to grid" way, but i dont want to make a full titlemap. Any way to do this whitout making alot of titleboxes that fill the whole flashmovie?

    Thanks for help.

  2. #2
    Junior Member
    Join Date
    Jul 2010
    I ended up doing it whit a title map. Im gona post the code if anyone would need help with this in the future.

    the object "Box" in this case is a 20x20 pix movieclip.
    the object "follow" in this case is a 40x40 pix movieclip that i wanted to follow my mouse in a boxmoving way.

    The stage is 800x600 pix therefore i make 40 boxes in 30 rows.
    Actionscript Code:
    var i:int=0;
    var b:int=0;
    while (i<40) {
        var tBox:Box=new Box;

        if (i==40 && b<29) {
        tBox.addEventListener(MouseEvent.MOUSE_OVER, Cord);
    function Cord(e:MouseEvent) {
        var corden=e.currentTarget;

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