Help making a Spot The Difference game

Hi!
Im pretty new at Actionscript 3.0 and I have to make a Spot The Difference game for school.. Now I followed a tutorial, but it's in AS 2.0 and I really cant get it to work in AS 3.0. Also, the tutorial isn't complete, so is there anyone that can help me any further with the code ?
Here's the tutorial I followed:
http://www.flashperfection.com/tutorial ... rence-Ga...
Thanks!

The link in the first post doesnt seem to work, so I hope it works now:
http://www.flashperfection.com/tutorials/Create-a-Spot-the-Difference-Game-63139.html
The code in the game Mc is:
var differences:Number = 3;
var found:Number = 0;
function addDifferences(thisSide, otherSide) {
for (var i = 1; i<=differences; i++) {
var difference = thisSide["dif"+i];
difference.useHandCursor = false;
difference.found = false;
difference.otherSide = otherSide["dif"+i];
difference.tabEnabled = false;
difference.onPress = function() {
if (!this.found) {
this.play();
this.otherSide.play();
this.found = true;
this.otherSide.found = true;
found++;
if (found == differences) {
found = 0;
levels.play();
and then on left side:
_parent._parent._parent.addDifferences(this, _parent.rightSide)
and on the right side:
_parent._parent._parent.addDifferences(this, _parent.leftSide)

Similar Messages

  • How to create a simple spot the difference game

    Hi everyone. I'm new to the forums and relatively new to flash, so bear with me
    I'm looking to do a very simple spot the difference game using flash CS3 and actionscript 2 for a school project.
    As it stands, I have 2 images on separate layers on a timeline in the same frame, which has been paused using the 'stop' command. I am looking to have around 4 differences that, when clicked, will be recorded at the bottom of the screen.
    The problem is, I am unable to find a way to get the differences recorded at the bottom in the order the user finds them, where each one is entered when the user clicks it, leaving gaps for those that haven't been found.
    Being only a basic user, I am only familiar with scenes and basic timeline controls, and i'm hoping there's a relatively simple way of achieving this. However I am perfectly comfortable with using more complex actionscript, having done some programming before.
    Thanks in advance,
    Laurence

    Thanks so much for all your help
    Just one last thing about the 'if' script you gave me, what do i replace 'somemovieclip' with if I've already definied the movie clips I want to be monitored? Also, do I put that script on the frame? If not, where? It just doesn't work properly at the moment (skips straight to the completion frame even though the movie clips are hidden at the start) and i'm not sure about those things ^
    Sorry to be of more trouble
    Laurence

  • Spot the Ball game - help needed

    Hi there.
    I have been asked to create a "spot the ball" game. The user
    gets 3 goes at placing their cross on an image of a soccer match
    with the ball removed. I would like the appplication to be able to
    convert the 3 x & y co-ordinates into either a 'HIT' or 'MISS'
    value. When they have their 3 goes, they then get the option to
    send their name & email address (with the HIT or Miss variable
    passed) to enter the cometition.
    I've never created this type of thisng before so I wondered
    if anyone may be able to point me in the right direction to some
    source code/tutorial that I may be able to adapt.
    Many thanks,
    Tony Mead

    make the ball's location a hotspot by adding a (transparent)
    movieclip over that location. you can then use an onMouseDown
    handler to check if there's a positive hittest between your
    movieclip and the mouse.

  • I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website

    I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website

    Here's two popup test sites.
    http://www.kephyr.com/popupkillertest/test/index.html
    http://www.popuptest.com/

  • An anyone help me to find the difference and relation between the following

    Hi,
    can anyone help me to find the difference and relation between the following methods of Swing :
    a) validate()
    b) invalidate()
    c) revalidate()
    d) repaint()

    You'd be far ahead by opening up the API and Java turorial and your course book and learning for yourself, rather than, asking other to do your homework for you.
    But if you have andwers already to go, then post them and ask if you have drawn appropriate conclusions.

  • Help with a hunt the wumpus game

    I accidently posted this question on the wrong section so i'm posting it again here.
    i'm trying to write the hunt the wumpus game with simple conditions: (check-marked the ones i already accomplished)
    [x]the pits will be placed randomly
    [x] the wumpus is placed in the maze randomly (not sure if i did that one correctly)
    [x] the player starts on the lower left of the maze row 3 col 0
    -the player will only have 1 chance to shoot the Wumpus
    [x]if the player is close to the Wumpus then there would be a prompt saying there is stench around
    [x]if the player is close to a pit then she/he will be prompted that there is a breeze.
    -if the player falls in a pit or gets eaten by the wumpus the game will be over and the map of the maze will be shown. I used 0 for empty cells and p for pits and w for wumpus in the array.
    There is some problem with the program i've written so far but i don't know how to fix it. also, i don't know how to check if the wumpus will be in the direction the player wants to shoot. i'd appreciate any suggestions
    import java.util.*;
    public class playWumpus
        //initMaze METHOD
        //put the pits and wumpus into the world
        public static void initMaze(char [][] maze)
            Random r = new Random();
            for (int row = 0; row <4; row ++)
                maze[row][col] = '0';    <<<<<<there is a problem here: col cannot be resolved
            int pitRow, pitCol;
            for (int pitNum = 0; pitNum <4; pitNum++)
                pitRow = r.nextInt(4); //randomly choose row
                pitCol = r.nextInt(6); //randomly choose column
                if (pitRow == 3 && pitCol == 0)//start location
                    pitCol=5;
            maze [pitRow][pitCol] = 'p'; //places the pits in the maze randomly
            maze [r.nextInt(4)][r.nextInt(6)] = 'w'; //places the wumpus randomly in the maze
        }// end of Maze method
        //CHECKMOVE method
        //possible outcomes: run into the wall , fall into the pit, eaten by wumpus,
        //feel breeze, smell stench, nothing.
        public static int checkMove(char [] [] maze, int newRow, int newCol)
            //checks if they run into a wall
            if (newRow<0 || newRow>3 || newCol<0 || newCol>5)
                System.out.println("You hit a wall");
                return 0;
                // it will return to the main method and places 0 in the state variable
            else if (maze[newRow][newCol] == 'p') 
            //this checks the maze if there is a P in that location
                System.out.println("You fall into a pit");
                return 2;
                // it will return to the main method and places 2 in the state variable
            else if (maze[newRow][newCol] == 'w')//checks for the wumpus
                System.out.println("You've eaten by the Wumpus!!");
            //checks for the breeze (right,left,down,up)   //<<is the following if-statement correct?>>>
            if (
                (newCol>0 && maze[newRow][newCol-1] == 'p') ||
                (newCol<5 && maze[newRow][newCol+1] =='p') ||
                (newRow>0 && maze[newCol][newRow-1] == 'p') ||
                (newRow<3 && maze[newCol][newRow+1] =='p')
                System.out.println("You feel a breeze");
            return 1;
        }//end of the maze method
        public static void main(String [ ] args)
            char [ ] [ ] maze = new char [4][6]; //the actual map of the game
            int playerRow=3, playerCol=0;  // player location aka lat/long
            Scanner in= new Scanner(System.in);   //<<there is something wrong with my scanner:The method nextInt(int) in the type Scanner is not applicable for the arguments (InputStream)>>>
            int move, state;
            // state of the game
            // state   0= illegal move, 1= legal move, 3= end game
            initMaze (maze); // calling the initMaze method
            do
                System.out.println("What would you like to do? 1=up, 2=down, 3=right 4=left, 5=shoot");
                move = in.nextInt(System.in);   //<<eclipse is telling me that the type is incorrect>>
                if (move ==1) // move up in the world
                    state = checkMove(maze, playerRow-1,playerCol); //these are coordinates
                    if ( state >0 ) // legal move
                        playerRow = playerRow-1;
                if (move ==2) // move down in the world
                    state = checkMove(maze, playerRow+1,playerCol);
                    if ( state >0 ) // legal move
                        playerRow = playerRow+1;
                if (move ==3) // move right in the world
                    state = checkMove(maze, playerRow,playerCol+1);
                    if ( state >0 ) // legal move
                        playerCol = playerCol+1;
                if (move ==4) // move left in the world
                    state = checkMove(maze, playerRow,playerCol-1);
                    if ( state >0 ) // legal move
                        playerRow = playerCol-1;
                if (move == 5) // shoot the wumpus in the world
                    System.out.println("Which direction would you like to shoot? 1=up, 2=down, 3=right, 4=left");
                    int shootDir = in.nextInt(System.in);
                    // check if the wumpus gets killed
                    if (  shootDir == 1 )  //<<not sure on how to check if the dir they are shooting has the wumpus in there>>
                        System.out.println("You shot the Wumpus!");
            }while (state!=2);
        }//end of main
    }//end of class

    here is the whole code just in case you guys want to see it...yes i know it looks primitive to you experts but hey i can follow and understand what i've written and that's what matters ^.~))V
    import java.util.*;
    public class playWumpus
         //initMaze METHOD
         //put the pits and wumpus into the world
         public static void initMaze(char [][] maze)
              Random r = new Random();
              for (int row = 0; row <4; row ++)
                for (int col = 0; col<6; col ++)
                    maze[row][col] = '0';             
              int pitRow, pitCol;
              for (int pitNum = 0; pitNum <4; pitNum++)
                   pitRow = r.nextInt(4); //randomly choose row
                   pitCol = r.nextInt(6); //randomly choose column
                   if (pitRow == 3 && pitCol == 0)//start location
                        pitCol=5;
                   maze [pitRow][pitCol] = 'p'; //places the pits in the maze randomly
              int wumpusRow = r.nextInt(4);
              int wumpusCol = r.nextInt(6);
              maze [wumpusRow][wumpusCol] = 'w'; //places the wumpus randomly in the maze
         }// end of Maze method
         //CHECKMOVE method
         //possible outcomes: run into the wall , fall into the pit, eaten by wumpus,
         //feel breeze, smell stench, nothing.
         public static int checkMove(char [] [] maze, int newRow, int newCol)
              //checks if they run into a wall
              if (newRow<0 || newRow>3 || newCol<0 || newCol>5)
                   System.out.println("You hit a wall");
                   return 0;
                   // it will return to the main method and places 0 in the state variable
              //this checks the maze if there is a pit in that location
              else if (maze[newRow][newCol] == 'p') 
                   System.out.println("You fall into a pit. You lose!");
                   return 2;
              //checks for the wumpus
              else if (maze[newRow][newCol] == 'w')
                   System.out.println("You've been eaten by the Wumpus. You lose!!");
                   return 2;
              //checks for the breeze (right,left,down,up)
              if (
                   (newCol>0 && maze[newRow][newCol-1] == 'p') ||
                   (newCol<5 && maze[newRow][newCol+1] =='p') ||
                   (newRow>0 && maze[newCol][newRow-1] == 'p') ||
                   (newRow<3 && maze[newCol][newRow+1] =='p')
                   System.out.println("You feel a breeze");
              //checks for the wumpus' stench
              else if (
                        (newCol>0 && maze[newRow][newCol-1] == 'w') ||
                        (newCol<5 && maze[newRow][newCol+1] =='w') ||
                        (newRow>0 && maze[newCol][newRow-1] == 'w') ||
                        (newRow<3 && maze[newCol][newRow+1] =='w')
                        System.out.println("Something smells!!");
                        return 1;
              else
                   System.out.println("Nothing happens.");
                   return 1;
              return 1;
         }//end of the maze method
         public static void main(String [ ] args)
              char [][] maze = new char [4][6]; //the actual map of the game
              int playerRow=3, playerCol=0;  // player location
              Scanner in= new Scanner(System.in);
              int move;
              int state = 1;
              // state of the game
              // state   0= illegal move, 1= legal move, 3= end game
              initMaze (maze); // calling the initMaze method
              do
                   System.out.println("What would you like to do? 1=up, 2=down, 3=right 4=left, 5=shoot");
                   move = in.nextInt();
                   if (move ==1) // move up in the world
                        state = checkMove(maze, playerRow-1,playerCol); //these are coordinates
                        if ( state > 0 ) // legal move
                             playerRow = playerRow-1;
                   if (move ==2) // move down in the world
                        state = checkMove(maze, playerRow+1,playerCol);
                        if ( state >0 ) // legal move
                             playerRow = playerRow+1;
                   if (move ==3) // move right in the world
                        state = checkMove(maze, playerRow,playerCol+1);
                        if ( state > 0 ) // legal move
                             playerCol = playerCol+1;
                   if (move ==4) // move left in the world
                        state = checkMove(maze, playerRow,playerCol-1);
                        if ( state >0 ) // legal move
                             playerCol = playerCol-1;
                   if (move == 5) // shoot the wumpus in the world
                        System.out.println("Which direction would you like to shoot? 1=up 2=down 3=right 4=left");
                        int shootDir = in.nextInt();
                        if (shootDir==1 && playerRow>0)
                             if (maze[playerRow-1][playerCol] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if(shootDir==2 && playerRow<3)
                             if (maze[playerRow+1][playerCol] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if (shootDir==3 && playerCol<5)
                             if (maze[playerRow][playerCol+1] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
                        else if (shootDir==4 && playerCol>0)
                             if (maze[playerRow][playerCol-1] == 'w')
                                  System.out.println("You shot the Wumpus!");break;
                             else
                                  System.out.println("You missed! You lose!");break;
              }while (state!=2);
              //shows the user the map of the maze if he/she gets eaten or falls in a pit
                   for(int row=0;row<4;row++,System.out.println())
                        for(int col=0;col<6;col++)
                             String loc = ""+maze[row][col];
                             loc += ((row == playerRow) && (col == playerCol)) ? "*" : "";
                             System.out.print(loc+"\t");
         }//end of main
    }//end of class

  • Help making a millipede/centipede type game

    Hi,
    Can anyone recommend a book that will help me make Centipede or Millipede in Java? This is my first year taking Computer Science and we need to make a game in a month and a half. I know the basics of Java (what I was able to learn in a semester). I chose Centipede which is like Space Invaders. Can you help me? Thanks!

    The Java Tutorial is a good reference, then any game programming in Java Book, there are several here that have been recommended.
    The biggest problem that you face, is scope. DON'T TRY TO DO MORE THAN YOU HAVE TIME TO DO. Keep the scope of your project doable and do not let it creep. One of the biggest things new programmers have problems with is: "Why not?" If it will look KEWL and you didn't have it in your original spec, don't include it.
    If you are just looking to suck code down from someone else's experience, then there is a whole world to Google with lots and lots of source.

  • Please, help me, What is the difference between SCWCD and SCBCD ?

    {color:#000000}*HI, Everyone*
    I want to know major difference between Sun Certified Business Component Developer and Sun Certified Web Component Developer.
    Who should go for business component developer and who should go for web component developer?
    It would be great if somebody can give 1 or 2 examples of application which can be developed by business component developer or web component developer.
    Thank you {color}
    Edited by: Xpero on Aug 19, 2010 9:19 AM

    Do you think writing in bold will make people more interested in your post? It doesn't. It's just annoying.

  • What is the difference between an End User ID and Deploy to ID?

    when installing my licenses i can see that i have an End User ID and a Deploy to ID, both having different numbers! please could you help me to understand the difference.

    I have n iMac 6.1 which I was led to believe was late 2008.
    Neil is correct, however to elaborate a 6.1 iMac is from late 2006, not 2008.

  • Sound quality: If you want to hear the difference between higher and lower bit rates

    Have you ever wondered about the difference in the sound quality of music at different bit-rates? Can you hear the difference?
    If you listen to 64kbps and 28kbps (either wma or mp3), you'll hear the great difference. However, if you listen to 28kbps and 92kbps (either wma or mp3), you'll find that there is little or no difference (to me, that is).
    collegeboy wrote:
    We all know that wma 28kbps sounds just as good as wma 320kb
    ps.
    the reason i and you go higher than 28 is because where able to. you can deny all you want.
    If you want to experience better sound quality at higher bit-rates, the best thing to do is to listen to the music at a quiet place. This may sound like lame advise, but it really works. Try 320kbps for the best results. You'll be able to hear minor details you never had before.

    SSR wrote:
    Wayyyyyy back when I first started encoding MP3s I was using 28 with an inferior encoder. At the time I couldn't spot the difference, but now the difference is stark. Particular types of music (and more specifically instruments and combinations) do emphasise it though.
    Actually, you cannot hear the difference when the background noise is loud, or example, public transport. I suggest that one uses a noise cancellation headset. $$$

  • Find the difference between loading and registering the drivers..

    Dear Sir..
    Could you please help me to find the difference between two activities..
    1.Loading the drivers
    2.Registering the drivers
    What's the difference between loading and registeing the drivers and what activities take place by the JVM to do it all.

    Dear Sir..
    Could you please help me to find the difference
    between two activities..
    1.Loading the drivers
    2.Registering the drivers
    What's the difference between loading and registeing
    the drivers and what activities take place by the JVM
    to do it all.You load a class - it isn't specific to a driver.
    That is part of java - not JDBC.
    Normally JDBC drivers register themselves when the class is loaded. This is specific to the driver and has nothing to do with a user of the driver. It is only a concern to someone who must implement a driver.

  • Find the difference in Two Tabels in two different schema?

    Hello Gurus,
    In DB which have millions of records -
    I have a Tabel A under Schema A and i have another Tabel B under Schema B and i have to pick the refrence from Tabel C under Schedma B altough my DB is same. Both of the tables (Table A and Table B) have exatly the same structure in both the schema and when i tried finding the difference like -
    Find the refrence from Table C and pick the values which are in Tabel A under Schema A but which are not present in the Tabel B under Schema B .
    I have to compare each and ever field value which is present under all of the columns under Table A to ever field value which is present under all of the columns under Table B.
    then wrote the following query-
    SELECT * FROM
    SchemaA.Table A t1,SchemaB.Table C t2
    WHERE t1.SV_ID = t2.SV_ID order by t1.SV_ID
    Minus
    Select * from SchemaB.TableB order by SV_ID
    Then this query is not working. And display the following error -
    "query block has incorrect number of result columns"
    Even both of the tables have the same column's and same structure.
    Kindly help me .
    Looking forward for some guidance -
    Thanks in advance.

    1-There are some 70 Columns in both of the tables so thats why i don't want to use the query based on columns as it will involve writing all of the columns.
    2- By using the query something like -
    select <column_name(s)> from table1
    minus
    select <column_name(s)> from table2, table1
    where <condition>
    It is throwing the error -ORA-01789: query block has incorrect number of result columns
    3- Using the query
    SELECT t1.*
    FROM SchemaA.TableA t1,SchemaB.TableC t2
    WHERE t1.SV_ID = t2.SV_ID
    MINUS
    SELECT t3.*
    FROM SchemaB.TableB t3
    order by SV_ID
    It gives me the reuslt but when i corss check them individually in both of the tables then there is no difference.
    4- SELECT t1.* FROM
    SchemaA.Table A t1,SchemaB.Table C t2
    WHERE t1.SV_ID = t2.SV_ID order by t1.SV_ID
    Minus
    Select * from SchemaB.TableB order by SV_ID
    Query is not working.
    Kindly help me to find the difference between two tables , column by column based on the condition both of the tables have the same SV_ID.

  • What are the differences between all these functions? stdev.p, stdevpa, stdev, stdeva, stdev.s

    I cannot get the main idea of the function of all these formulas on excel although I can understand the concept of standard deviation.... Kindly help me out... 

    May be the below link would help you to understand the differences
    http://www.excelfunctions.net/standard-deviation-in-excel.html

  • What is the difference between Aggregation and Composition with example

    plz help me to find the difference between Aggregation and Composition with example

    Dear [email protected]:
    Get back to work.
    August 4, 2007 stalin_gnana asked:
    I would like to know the description about 'is a' ,'has a' ..relationship in java.plz reply me to the above doubt if known
    August 8:
    Can any one encounter the clarification on how and where Observer class and Observable interface can be applied..plz answer me
    August 10:
    May you find a solution on why not have the concept of pointer,opterator overloading,virtual function and destructor in java
    (Also August 10):
    I would desire to apprehend the brief description about usage of Singletone class and where it can be applied.plz help me
    Today:
    I am having the doubt of 'is there any relation among Delegation and composition'.if have,plz answer to regarding question.
    And then this thread today too.
    sniff sniff
    I smell a lazy attempt at getting others to do one's homework for him.

  • WebService: The difference between Deployable proxy & Standalone proxy

    Hi all,
    The help document tell me the difference between Deployable proxy & Standalone is the former can be deploy while the latter can not.
    Now I know how to use a standalone proxy, but now I would like to call a ws in web application, I need a deployable one.
    After autogenerate, to my surprise, there's no implementation class in SEI!
    As know to all, if this proxy we call it 'zHello'
    as a standalone proxy, we have four files in SEI
    ZHellows.java
    ZHellowsService.java
    ZHellowsServiceImpl.java
    ZHellowsSoapBindingStub.java
    use the follow segment can do the job.
    ZhellowsService service = new ZhellowsServiceImpl();
    Zhellows hello = service.getLogicalPort();
    System.out.println(hello.zHello("testit"));
    but what I found in the SEI of a deplyable proxy is just 2 interface of them:
    ZHellows.java
    ZHellowsService.java
    This time I do not know how to use this proxy, shall I implement it first?

    Hi William,
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/45/f957507cb343f78e818c50620ed5ca/frameset.htm">Deployable versus Standalone Proxies</a>
    Best regards, Maksim Rashhcynski.

Maybe you are looking for

  • How do I fully delete an email account from my Apple Mail app on my iMac?

    Hello all, How do I fully delete an email account from my Apple Mail app on my iMac? When I go here: Mail > Preferences Mail > Accounts I got the message that I needed to delete it from my Internet Accounts. When I go here: System Preferences > Inter

  • [TV@nywhere Master] Freescan list loading problem at startup.

    Hello all, I am facing a strange problem with MSIPVS3. I was using "channels" set to cables but few of my channels were missing. So I tried Freescan and added few channels manually. Though, I got all channels but now I am facing a strange problem. Wh

  • How to get dynamic icons like in "Searching this Mac"?

    Hello, So whenver I use spotlight to search something and click on "Show all in finder" I get the "Searching This Mac" window. The one where I can add filters and "stuff". When I resize this window, the icons rearrange themselves to allways fit the w

  • Can't Select Rows in the Microsoft Edge F12 Network Inspector

    Applies To: Microsoft Edge F12 Developer Tools Release: Windows 10 Insider Preview SDK and tools, April 2015 release Issue: Can't select rows in the network inspector with mouse to see body, timings etc.

  • Searching iCal for past events

    I am trying to search iCal for a past event. The search window only is giving me events in the current month or in the future. I am on an iMac running 10.8.5. If i manually go back a month I can see an instance of this event that is not showing up in