A term is undefined and has no properties


so i'm trying matching game match food dish country originated from. example pizza, italy. made game have click on 4 of ingredients needed make pizza. know game works after tried making second game, gives me error "a term undefined , has no properties." doing wrong? here's code

 

package  {

          import flash.display.movieclip;

          import flash.events.mouseevent;

          import flash.ui.keyboard;

          import flash.events.keyboardevent;

          import flash.events.event;

 

          public class game1 extends movieclip {

                    var game1 = new gamenumber1;

                    var gameover1 = new gameovergame1;

                    var nextlevel = new thenextlevel;

                    var game2 = new gamenumber2;

                    var count:uint;

 

 

                    public function game1() {

                              addchild(game1);

                              game1.tomato.addeventlistener(mouseevent.click,tomatoright);

                              game1.cheese.addeventlistener(mouseevent.click,cheeseright);

                              game1.flour.addeventlistener(mouseevent.click,flourright);

                              game1.yeast.addeventlistener(mouseevent.click,yeastright);

                              game1.lettuce.addeventlistener(mouseevent.click,lettucewrong);

                              game1.chicken.addeventlistener(mouseevent.click,chickenwrong);

                              game1.beef.addeventlistener(mouseevent.click,beefwrong);

                              game1.rice.addeventlistener(mouseevent.click,ricewrong);

                              gameover1.startoverbutton.addeventlistener(mouseevent.click,startoverbutto n);

 

                              nextlevel.nextlevelbutton.addeventlistener(mouseevent.click,nextlevelbutto n);

                              game2.usaflag.addeventlistener(mouseevent.click,usa123);

                              game2.chinaflag.addeventlistener(mouseevent.click,china123);

                              game2.mexicoflag.addeventlistener(mouseevent.click,mexico123);

                              game2.japanflag.addeventlistener(mouseevent.click,japan123);

                              game2.germanyflag.addeventlistener(mouseevent.click,germany123);

                              game2.italyflag.addeventlistener(mouseevent.click,italy123);

 

                              addeventlistener(event.enter_frame, enterframe);

 

                    }

                    function tomatoright(event:mouseevent):void {

                              game1.correct1.text = "correct!";

                              count+= 1;

 

                    }

                    function cheeseright(event:mouseevent):void {

                              game1.correct2.text = "correct!";

                              count+= 1;

 

                    }

                    function flourright(event:mouseevent):void {

                              game1.correct3.text = "correct!";

                              count+= 1;

 

                    }

                    function yeastright(event:mouseevent):void {

                              game1.correct4.text = "correct!";

                              count +=1;

 

                    }

 

                    function enterframe(event:event):void {

                              if (count == 4) {

                                        addchild(nextlevel);

                                        removechild(game1);

                              }

                    }

                    function lettucewrong(event:mouseevent):void {

                              addchild(gameover1);

                              removechild(game1);

                    }

                    function chickenwrong(event:mouseevent):void {

                              addchild(gameover1);

                              removechild(game1);

                    }

                    function beefwrong(event:mouseevent):void {

                              addchild(gameover1);

                              removechild(game1);

                    }

                    function ricewrong(event:mouseevent):void {

                              addchild(gameover1);

                              removechild(game1);

                    }

                    function startoverbutton(event:mouseevent):void {

                              addchild(game1);

                              removechild(gameover1);

                    }//end of game #1

                    function nextlevelbutton(event:mouseevent):void {

                              addchild(game2);

                              removechild(nextlevel);

                    }

 

                    function usa123(event:mouseevent):void {

                              game2.usa.text = "usa and?";

                    }

                    function china123(event:mouseevent):void {

                              game2.china.text = "china and?";

                    }

                    function mexico123(event:mouseevent):void {

                              game2.mexico.text = "mexico and?";

                    }

                    function japan123(event:mouseevent):void {

                              game2.japan.text = "japan and?";

                    }

                    function germany123(event:mouseevent):void {

                              game2.germany.text = "germany and?";

                    }

                    function italy123(event:mouseevent):void {

                              game2.italy.text = "italy and?";

                    }

 

 

 

          }

 

}

click file>publish settings>swf , tick "permit debugging".  retest.

 

the line number of problematic code in error message.  if need more help, indicate line of code problem.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account