Skip navigation
Kuglof
Currently Being Moderated

Question about action script 2

Sep 4, 2012 2:56 PM

Hello!

 

I hope I posted in right forum.

 

I used this code http://www.adobe.com/devnet/flash/articles/puzzle_game_sample.html to make my own puzzle and I made changes like image of puzzle and number and size of puzzle pieces and board. I also changed placement of pieces in the beginning to fit my puzzle better. Now everything is working fine, it recognizes piece is on the right place and all but once puzzle is solved it won't load disappearing effect and you have won part I added to go after it. I tried removing what I added to go after but it still didn't do disappearing effect. It acts as if puzzle isn't solved from what I can see but I can't figure out why.If someone could help me I would be very grateful. ^^

 

Thanks!

 
Replies
  • Currently Being Moderated
    Sep 7, 2012 5:50 AM   in reply to Kuglof

    Moving this thread out of the FAQs to Flash Pro - General forums.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 7:39 AM   in reply to Kuglof

    Can you show the code that is relevant to your problem(s)? (Not all of the code, just the relevant portions of it.)

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 1:52 PM   in reply to Kuglof

    That's too much code to look at.  It is better to just provide the code that is directly relevant to the problem, preferably in a form that is not page-based, and within the posting thread so that it is readily evident to see.

     

    The function that you highlighted appears to perform the work that you say works fine except for the part where the puzzleSolved(); get called.  I would expect the problem to either be the conditional you have that drives calling that function...

     

         if(correctPuzzlePieces == totalPuzzlePieces) {

           puzzleSolved();

         }

     

    or in the puzzleSolved function.  So what you should do to try to isolate the problem is use the trace() function to see what the values of things are or if certain processing is being executed.  For instance, see if the conditional works when it should by putting a trace before it and a trace within the puzzleSolved function...

     

     

         trace(correctPuzzlePieces, totalPuzzlePieces);

         if(correctPuzzlePieces == totalPuzzlePieces) {

           puzzleSolved();

         }

     

        function puzzleSolved():Void {

            trace("this function has been called")

     

    Continue to use the trace to track down where things don't agree with what you expect they need to be.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points