I am hoping someone could help me with a problem I am having trying to integrate as3 code from a puzzle I have created into my game FLA file.
In Game.fla I have a main class called Engine that contains that calls a number of empty movie clips from the library to the stage and then populates each movie clip with assets from the library. Each movie clip has its own class associated with it.
I have created each puzzle in a separate file with its own main class to test and make sure the puzzles work, when I try to add the code for a puzzle to a movieclip class I am getting a number of errors
output error
**Warning** The linkage identifier 'feedback2' was already
assigned to the symbol 'wrong_box', and cannot be assigned
to the symbol 'graphics/scrambleAssets/wrong_box',
since linkage identifiers must be unique.
and compiler error
Line 132 1136: Incorrect number of arguments. Expected 1.
line 132 is 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 for 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 for 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 i
scramble_word(a);
}
//MORE FUNCTIONS FOR PUZZLE