actionscript 3 - AS3 OOP inheritance and functions -
i hoping me problem having trying integrate as3 code puzzle have created game fla file.
in game.fla have main class called engine contains calls number of empty movie clips library stage , populates each movie clip assets library. each movie clip has own class associated it.
i have created each puzzle in separate file own main class test , make sure puzzles work, when try add code puzzle movieclip class getting number of errors
output error
**warning** linkage identifier 'feedback2' assigned symbol 'wrong_box', , cannot assigned symbol 'graphics/scrambleassets/wrong_box', since linkage identifiers must unique. and compiler error
line 132 1136: incorrect number of arguments. expected 1. line 132 this:
if(ques_num==words.length){removechild(checker); f3=new feedback3; addchild(f3); f3.x=100; f3.y=100; }else{ getword();} main class
public function show_level1puzzle(){ level1puzzle_screen = new level1puzzle(this); remove_levelchooseboy(); addchild(levelpuzzleboy_screen); level1puzzle_screen.x=510; level1puzzle_screen.y=380; } ** class level1puzzle**
package actions { import flash.display.movieclip; public class level1puzzle extends movieclip { public var main_class:engine; // variables used in puzzle var words:array = new array; var rand1:int;var rand2:int; var i:int; //variable used loop iterations // more variables public function level1puzzle(passed_class:engine) { main_class = passed_class; public function getword(passed_class:engine) { main_class = passed_class; words=["cat","dog"]; current_word=words[ques_num]; settiles(current_word.length); ques_num++; } public function settiles(a) {tilearray=[ ]; for(i=0;i<a;i++){ var tempclip:tile =new tile;addchild(tempclip); tempclip.x=300+(i*180);tempclip.y=200;tempclip.tag=i; tempclip.original_posx=tempclip.x; tempclip.original_posy=tempclip.y; tilearray[i]=tempclip; var tempclip2:placeholder =new placeholder;addchild(tempclip2); tempclip2.x=300+(i*180);tempclip2.y=400; targetarray[i]=tempclip2; }//for scramble_word(a); } //more functions puzzle
this function has parameter :
public function getword(passed_class:engine) { main_class = passed_class; words=["cat","dog"]; current_word=words[ques_num]; settiles(current_word.length); ques_num++; } on line 132, not passing parameter, reason error message.
Comments
Post a Comment