Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Tic Tac Toe help!

New Here ,
Oct 12, 2012 Oct 12, 2012

I'm working with AS2 to build a tic tac toe game learning the language from a book I have, however I have reached a point where its not working and I don't know what to do and why its doing what is it.

I have it setup so that when it reachs the "gamePlay" frame it stops and draws the tile properly but when you play it only changes the last tile. Additionally I can not seem to trace the output for the variables I created in a nested "for loop".

If you can please help!

https://www.dropbox.com/s/brldvn60nx4rmwt/TicTacToe.fla

TOPICS
ActionScript
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 12, 2012 Oct 12, 2012

People generally will not download files in these forums.  You are more likely to get help if you present your case in your posting, including any relevant code, and explain where the problem areas are with it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 12, 2012 Oct 12, 2012

OK I'll try.

I am using a single movie clip for th tiles(blank, x, o), one movie playerX, and one for playerO. I'm using code to draw the tiles and change them accordingly.

My struture is:

function init()

     drawTiles()  //working

     traceTiles()  //not working at all

     clickEachTile()  //not working correctly

function drawTiles()  //I think this is all working...

     -nested loops

     -create tile: attachMovie()

     -position tile

     -make tile start blank

function traceTiles()

     -nested loops

     -onRollOver

          -trace tile name

function clickEachTile()

     -nested loops

     -onRelease   

          -set state for that tile  //X or O

          -turnTile(tile,state)

          -switchPlayers()

function switchPlayers()

     -dim current player

     -highlight other player

function turnTile(tile,state)

     -make tile appearence  //X or O

     -traceStates()

function traceStates()

     -nested loops

     -trace states of all the tiles

Since I get no errors and no output the problem I think is somewhere dealing with the attachMovie, onRollOver, or set state for that tile.

Additionally after further investigating I found that I can not use the Action's Window's "Auto Format" because of two errors. It expects a '{' on a line which has it however quadruple checking it looks to be correct without and it has the proper number of closing '}'s. The other is a syntax error I get on the very last line no matter what I do to correct or delete it, it just movies up to the previous line.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2012 Oct 13, 2012

If you won't show the actual code you can't expect much feedback.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 29, 2012 Nov 29, 2012
LATEST

if you want you can use frame by frame and set each one in its own frame.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines