Hi all,
I picked up the following code from net and i think its and AS3 code which I am trying to run in AS2 (flash 8.0). I did create the button with remove_bt instance as follows. The code is as follows:-
[COLOR=#0101FF]
[/COLOR]
[FONT=Verdana]var texts:Array = ['courses', 'tutorials', 'www.marplo.net']; // tex to display[/FONT]var bcolor:Array = [0xe8e9fe, 0xeded01, 0xfedada]; // Array with colors for the background of each textvar lung:int = 100; // Variable used for the lenght of the text field// Reads through the "texts" Arrayfor(var i:int=0; i<texts.length; i++){ // creates a field "TextField" for each element in texts // Sets the fields height, lenght, and distance "x" depending on "i" (for liniar display) // Adds background color from "bcolor" Array and text from the current element in "texts" var txt:TextField = new TextField(); txt.height = 25; txt.width = lung; txt.x = i*(lung + 8); txt.backgroundColor = bcolor*; txt.background = true; txt.text = texts*; // Atributin a name to the instance, for it to be unique also use 'i's value txt.name = 'camp'+i; addChild(txt); // Adds the field on the stage}// Recording CLICK event for the button on the stage, "remove_bt"remove_bt.addEventListener(MouseEvent.CLICK, removeIns);// The function called by the registered eventfunction removeIns(evt:MouseEvent):void{ removeChild(getChildByName('camp0')); // Deletes the element with 'camp0' name removeChild(getChildByName('camp1')); // Deletes the element with 'camp1' name [COLOR=#0101FF]}[/COLOR]
I get the following message :
Error Scene=Scene 1, layer=Layer 1, frame=1:Line 29: The class or interface ‘MouseEvent’ could not be loaded.
function removeIns(event:MouseEvent)
Total ActionScript Errors: 1 Reported Errors: 1
Can some please help sort this out.
Thanks All.