1 Reply Latest reply on May 2, 2009 7:36 AM by Ned Murphy

    Need help with Tic Tac Toe script

    skcovert24@sbcglobal.net

      I am working on creating an assessment on uses of an iPod. The learner has the freedom to select any three questions as long as they form a Tic Tac Toe when they are completed. What I have created so far:
      1.All 9 square on the main stage, the suqares were converted to a movie clip
      2. The learner clicks on a square and then taken to a page of their own ie. square one opens a square one more detailed question and place to type in answer
      3. The learner types in their answer into an input text box - the enter button takes the learner to a correct page or a need to review page
      4. I have attached a button on the correct page that will change the color of the square on the main page when the learner returns to the main page
      The problem:

      the changed square color does not stay changed when the learner answers another question and goes back to the main page. Square one returns back to the original color.
      What do I do to get the square to change color to show the learner has this question correct.?
      I have attached the script below attached to the correct page the learner uses to return to the main page:

      This is on the page the learn is directed to when they select the correct answer. This will take the learner back to the main page with all 9 squares.The square 1 will change color. but when the learner moves onto another square, square 1 changes back to the origiinal color. How do I get it to stay changed?

       

       

      on (release) {
      gotoAndStop(1);
      }
      on (release) 

      colorchange = new Color("/square1"); 
      colorchange.setRGB(0xff33cc); 
      }


      Thanks for your help.
      Sharon Covert

        • 1. Re: Need help with Tic Tac Toe script
          Ned Murphy Adobe Community Professional & MVP

          I'm not sure what you mean when you talk about going to different pages, but the key to having things stay the same is to retain information, either thru storing data and using it or not leaving the page.

           

          For what you described, my approach would probably have been to utilize movieclips for the additional pages you mention so that the main page remains present at all time, but is either hidden by the movieclip pages or disabled in the background, but is always present so that it does not change.

           

          If you wanted to move away from the main section entirely instead, then my approach would be to store the status of the tic tac toe section in a data structure that spans the entire timeline so that as you move from one section/page to the next, the data is not lost, and when you return to the main section, a function automatically re-establishes the conditions based on the data stored.

          1 person found this helpful