Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Actionscript 3 question

Options
  • 19-03-2011 8:56pm
    #1
    Registered Users Posts: 1,155 ✭✭✭


    Hi,

    I game across the following tutorial to make a Flash memory game: http://www.emanueleferonato.com/2008/05/02/creation-of-a-matching-game-with-flash-and-as3/ . In the game there are 16 blank cards, when users click a card, a colour is revealed, if you match two colours the cards disappear.

    Anyway the problem I'm having is that the tiles are too big for what I need them for. I thought it would be a simple process of changing the values in the nested loops (lines 19 & 20):
    tile.x = (x-1)*82;
    tile.y = (y-1)*82;

    However this will only change the size of the first 3 rows and columns. The last row and column are a different size. It's as if the nested loops calculate the first 3 rows and column and the last row and column fills up the remaining space.

    Could anyone help me resize these tiles?


Comments

  • Registered Users Posts: 105 ✭✭damoth


    I think the lines tile.x = (x-1)*82; and tile.y = (y-1)*82; just set the position of the objects so the 82 is just the distance from start of one square to the start of the next.

    I'd say try modify the width and height of the object in the .fla file - I'm guessing it's 80 because the lines above are leaving a gap of 82 between each square.

    Otherwise you could try tile.width = 50; tile.height = 50; to make them smaller programmatically. This might help: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7df3.html


Advertisement