Ask Experts Questions for FREE Help !
Ask
    cool_dina's Avatar
    cool_dina Posts: 1, Reputation: 1
    New Member
     
    #1

    Jul 29, 2006, 03:24 AM
    For actionscript pro.
    I despretly need help
    I'm trying to make a crossword game in flash and I can't!! Because I need the actionscript code so...

    If any body can give me a sample or give me a website that has one I'll be so grateful

    Thank you
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #2

    Aug 1, 2006, 08:47 AM
    General Flash/ActionScript help:

    http://www.flashkit.com/
    http://www.actionscript.org/


    I couldn't find a good crossword tutorial so I will log on tonight and write some thoughts on how I would do it. It won't be the best way but it should help get you started.
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #3

    Aug 1, 2006, 02:48 PM
    OK, some ideas on creating a crossword game in Flash/ActionScript:

    The Playing Area

    First thing to do is to create a square for your puzzle. Create a white square with a black border. Put a text box in this square and set it to be dynamic text. Select this square and text box and convert it to a movie clip symbol (F8). Double click on this symbol to edit it. Create a new frame for the symbol and fill the square in black. So you now should have an embedded movie clip with two frames - a white square and a black square.

    Now you want to copy & paste this symbol 99 times (or less depending on your grid size) and put them in a 10 x 10 grid. Each time you paste a new symbol, give it a new instance name relating to it's position in the grid (e.g. x1y1, x1y2 etc.)

    From this you should be able to programmatically set if a square is white or black by calling something like:
    Code:
    x1y7.gotoAndStop(2);
    . Try labelling your frames to make this code even easier to read.

    Representing the grid
    I would represent my crossword puzzle using a 2D array. Something like below:
    Code:
    var answerGrid = [
       ['#', 'H', '#', 'T', 'O'],
       ['#', 'E', '#', 'H', '#'],
       ['#', 'L', '#', 'E', '#'],
       ['#', 'L', 'I', 'F', 'E'],
       ['#', 'O', '#', 'T', '#'],
    ];
    Something like that - a # representing a black square, a letter representing what should be in that square.

    Then it's a case of using the onClick method of the symbol you created earlier to check it's position in the grid, check what the user answered against what's in the square in the answer grid and acting apropriately.


    I know all that isn't much help but it would take me a fair while to write a concise tutorial about creating a crossword game.

    Lee,

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Flash ActionScript [ 2 Answers ]

I am building a flash movie. So far I'm able to create the buttons and play the sceens. Unfortunately, I need the user to click on the button which takes me to frame 2, but I need it to stop on frame 15, yet it keeps playing the scene until frame 85 which is the last frame. I have some course...


View more questions Search