1120: Access of undefined property myTest

I am learning Actionscript 3.0 and Flex 3 but am having a
very hard time trying to understand error 1120. I come from a c++
background so OOP is not new to me.
I create the object instance of the imported class but then I
cannot call those object functions on the object I have created. I
am guessing there is some kind of scoping issue but I have not been
able to find a simple example of how to create an object from a
class and then use its functions on the object.
Any help would be greatly appreciated (with explanations
hopefully). Code attached.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import com.smyrin.*;
public var myTest:EntryClass = new EntryClass();
myTest.addNum (); <--------- 1120 error here!
]]>
</mx:Script>
</mx:Application>
package com.smyrin
public class EntryClass {
private var num:Number;
public function EntryClass () {
num = 10;
public function addNum ():void {
num = num + 5;
}

The following example illustrates how an MXML file can
communicate with class objects of an imported Actionscript file in
Flex 3.0.
MXML File:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
//This example shows how to instantiate a class object of an
actionscript file and to
//call class functions on that object. Please note I am by
no means an expert but have
//figured this out through research and experimentation.
Feel free to correct me where
//I may be wrong.
//Import actionscript file.
import com.sample.SampleClass;
//Create variable to class object(s).
public var myObject:SampleClass;
//Initialize class objects.
public function init():void {
myObject = new SampleClass ();
//Now we can use the class functions thru the class object.
//See button control click value.
]]>
</mx:Script>
<mx:VBox x="10" y="10" width="300" height="300"
horizontalAlign="center" id="verticalBox">
<mx:Button label="Add Text Box" id="myButton"
click="myObject.doSomething ()"/>
</mx:VBox>
</mx:Application>
ACTIONSCRIPT File:
//I like to put my packages in a domain name as Flex 3
suggests.
package com.sample {
//Import list.
import mx.controls.Text;
import mx.core.Application; //Class needs access to
Application class.
//It is very important to extend this class with an
appropriate superclass.
//I chose Application but others work as well such as
Sprite, etc... This will
//clear up those pesky 1120 errors.
public class SampleClass extends Application {
//Class Variables:
public var str:String //Dummy variable.
public var myTextBox:Text; //Text box variable.
//Constructor
public function SampleClass () {
//I usually use the constructor to initialize all the class
//variables that I need for the functions.
str = "Hello World!";
myTextBox = new Text ();
//Simple function that is called by the click of a button in
the
//mxml file. The function accesses the application container
and
//adds myTextBox containing the value of str.
public function doSomething ():void {
myTextBox.text = str;
Application.application.verticalBox.addChild (myTextBox);
}

Similar Messages

  • Getting the very lovely 1120: Access of undefined property...

    Hi Guys n Gals,
    I’m getting the "1120: Access of undefined property texttwo_mc." error I've done this code before and no issue.
    What I’m doing is simple, click a button and it will go to a movie clip within a movie clip to start the label named "_go", and this error accrued. The MC I’m calling is on the beginning of the timeline.
    Thanks
    BTW for some odd reason my SWF keeps deleting it self, thats on 2 differnt PC's ones CS5 and CS4.

    Hi Ned,
    Ok ill be as detailed as possible.:
    In the main stage I have a MC with a instance name of texttwo_mc, within that i have a mocvie clip "about button" that acts like a button and its on 5 on the timeline.
    The "about button" is not viable till timeline 5 but there's a stop on timeline 1 and it goes to timeline 5 (to make itself viable) when its told to in action scripting. And there's a button on the main stage that makes it go from 1 to 5 in action scripting.
    and thats where the eror is.
    BTW the "about button" is on timeline 1..just not viable till 5.

  • Error, please help? 1120: Access of undefined property event

    I have ActionScript 3 in two frames of my piece. In this 2nd frame, I get an error: "1120: Access of undefined property event" for "myXML=XML(event.target.data);" Can anyone help? I am not sure how to fix this.
    var myloader:URLLoader=new URLLoader();
    myloader.dataFormat=URLLoaderDataFormat.VARIABLES;
    myloader.addEventListener(Event.COMPLETE, guestBookWriteFunc);
    function guestBookWriteFunc(e:Event):void{
              var loader:URLLoader=URLLoader(e.target);
              var vars:URLVariables=new URLVariables(loader.data);
              var url:String="makexml.asp";
                   var sendloader:URLLoader=new URLLoader();
                   var request:URLRequest=new URLRequest(url);
                   trace("xml page created");
    var urlRequest:URLRequest=new URLRequest("makexml.asp");
    var urlLoader:URLLoader=new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, fileLoaded);
    urlLoader.load(urlRequest);
    //Setting up the XML
    var myXML:XML=new XML();
    myXML.ignoreWhitespace=true;
    var xmlList:XMLList;
    //Setting up the data holder Arrays
    var theUserName:Array=new Array();
    var theUserEmail:Array=new Array();
    var theUserComment:Array=new Array();
    function fileLoaded(e:Event):void{
         myXML=XML(event.target.data);
         xmlList=myXML.children();
         for (var i:int=0; i<xmlList.length(); i++){
              var xmlName:String=xmlList[i].username;
              var xmlEmail:String=xmlList[i].useremail;
              var xmlComment:String=xmlList[i].usercomment;
              theUserName.push(xmlName);
              theUserEmail.push(xmlEmail);
              theUserComment.push(xmlComment);
              if(i==xmlList.length()-1){
                   updateText();
    //Populating the text field to display messages
    var maximumMessages:Number=5;
    var currentMessages:Number=0;
    function updateText(){
         guestText.htmlText="";
         for (var i=currentMessages; i<maximumMessages; i++){
                   guestText.htmlText+=("<b><u>Name:</u></b>" + theUserName[i]);
                   guestText.htmlText+=("<b><u>Email:</u></b>" + theUserEmail[i]);
                   guestText.htmlText+=("<b><u>Comment:</u></b>" + theUserComment[i]);
                   guestText.htmlText+=(".................................");
                   currentMessages=i;
                   myScroller.scrollTarget=guestText;

    You are more likely to get a reply if you ask in the Flash or ActionScript forum.

  • GotoAndStop error 1120:Access of undefined property on MC's loaded from .swc

    I am trying to tell a MovieClip added from a .swc library to do simple things like "gotoAndStop()" and all I get is a red X error message 1120: Access of undefined property whenever I do.
    I can add the MovieClip to the application and position it without any problem. I cannot make it do anything. In my Flash IDE library the CustomCheckBox()'s base class is
    import flash.display.MovieClip;
    import mx.flash.UIMovieClip;
         //  **** TRIED EACH IMPORT STATEMENT AND BOTH**** (NEITHER of which work at all).
    private var _checkPlaylist:MovieClip = new CustomCheckBox();
    private var _checkClassroom:MovieClip = new CustomCheckBox();
    _checkPlaylist.gotoAndStop(1);
    _checkClassroom.gotoAndStop(2);
    I can declare my CustomCheckBox as a MovieClip and in my Symbol Properties panel it's base class is — mx.flash.UIMovieClip — and it shows up just fine. I just can't make the thing stop or do anything else a MovieClip is supposed to be able to do.
    One of the other developers here who is way more advanced than I am also cannot get a ******* movie clip to stop either.
    I am new to Flash Builder — yet have been using Flash and AS3 for years and I have never had a more difficult time getting up to speed with a new technology than Flex / Flash Builder has become for me. I feel stupid that I keep spending days on end just trying to figure out basic things like this.

    I keep answering my own questions. When I added a gotoAndStop command to the referenced MC inside of the init function it stopped throwing that error at me. I was trying to initialize the button states after declaring them as MC variables, but the compiler did not like that.

  • Error Code 1120 access of undefined property...help please

    I am fairly new to Flash - I have CS4 and am not sure if I am in the right place to get help.
    I am trying to build a click through gallery with small buttons that you click on and it switches the larger image out as you click through.
    I copied over a gallery I had successfully built with 10 images.  The new gallery has 20 images.
    Basically the movie just runs continuously without being able to click on the thumbnails.
    I am getting the following compiler errors
    Scene1 Layer 'actions', Frame 1, Line 42 1120:Access of undefined property btn11_btn Source - btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    I get this for image 11 through 20
    The following is my code
    stop();
    btn1_btn.addEventListener(MouseEvent.MOUSE_OVER, showimage1);
    function showimage1(event:MouseEvent):void {
    gotoAndPlay("label1");
    btn2_btn.addEventListener(MouseEvent.CLICK, showimage2);
    function showimage2(event:MouseEvent):void {
    gotoAndPlay("label2");
    btn3_btn.addEventListener(MouseEvent.CLICK, showimage3);
    function showimage3(event:MouseEvent):void {
    gotoAndPlay("label3");
    btn4_btn.addEventListener(MouseEvent.CLICK, showimage4);
    function showimage4(event:MouseEvent):void {
    gotoAndPlay("label4");
    btn5_btn.addEventListener(MouseEvent.CLICK, showimage5);
    function showimage5(event:MouseEvent):void {
    gotoAndPlay("label5");
    btn6_btn.addEventListener(MouseEvent.CLICK, showimage6);
    function showimage6(event:MouseEvent):void {
    gotoAndPlay("label6");
    btn7_btn.addEventListener(MouseEvent.CLICK, showimage7);
    function showimage7(event:MouseEvent):void {
    gotoAndPlay("label7");
    btn8_btn.addEventListener(MouseEvent.CLICK, showimage8);
    function showimage8(event:MouseEvent):void {
    gotoAndPlay("label8");
    btn9_btn.addEventListener(MouseEvent.CLICK, showimage9);
    function showimage9(event:MouseEvent):void {
    gotoAndPlay("label9");
    btn10_btn.addEventListener(MouseEvent.CLICK, showimage10);
    function showimage10(event:MouseEvent):void {
    gotoAndPlay("label10");
    btn11_btn.addEventListener(MouseEvent.CLICK, showimage11);
    function showimage11(event:MouseEvent):void {
    gotoAndPlay("label11");
    btn12_btn.addEventListener(MouseEvent.CLICK, showimage12);
    function showimage12(event:MouseEvent):void {
    gotoAndPlay("label12");
    btn13_btn.addEventListener(MouseEvent.CLICK, showimage13);
    function showimage13(event:MouseEvent):void {
    gotoAndPlay("label31");
    btn14_btn.addEventListener(MouseEvent.CLICK, showimage14);
    function showimage14(event:MouseEvent):void {
    gotoAndPlay("label14");
    btn15_btn.addEventListener(MouseEvent.CLICK, showimage15);
    function showimage15(event:MouseEvent):void {
    gotoAndPlay("label15");
    btn16_btn.addEventListener(MouseEvent.CLICK, showimage16);
    function showimage16(event:MouseEvent):void {
    gotoAndPlay("label16");
    btn17_btn.addEventListener(MouseEvent.CLICK, showimage17);
    function showimage17(event:MouseEvent):void {
    gotoAndPlay("label17");
    btn18_btn.addEventListener(MouseEvent.CLICK, showimage18);
    function showimage18(event:MouseEvent):void {
    gotoAndPlay("label18");
    btn19_btn.addEventListener(MouseEvent.CLICK, showimage19);
    function showimage19(event:MouseEvent):void {
    gotoAndPlay("label19");
    btn20_btn.addEventListener(MouseEvent.CLICK, showimage20);
    function showimage20(event:MouseEvent):void {
    gotoAndPlay("label20");
    Any advice would be great
    I dont know if I have to start from scratch - which would be a pain for sure
    Thanks

    I feel foolish - I solved my own problem!
    I figured out that I had not given buttons 11 - 20 an instance name
    Once I did that - voila problem solved
    Sorry for bothering you all.

  • Need help with error msg 1120: Access of undefined property

    I am not a coder, so I need coding help. Any help would be greatly appreciated.
    I'm doing a Flash banner that has clickTAG instructions from Google. The code they said to put on the button is:
    ClickTAG parameter code for ActionScript 3:
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    someButton_or_displayObject_to_receive_mouseClick.addEventListener(
          MouseEvent.CLICK,
          function(event: MouseEvent) : void {
          flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");
    Replace someButton_or_displayObject_to_receive_mouseClick with the actual name of button that will receive the click.
    Note that it's not necessary to specify the destination URL for the ad anywhere in this code; this is taken care of through the usage of clickTAG. Also, depending on the structure of your Flash ad, it may be necessary to prepend "_root." or "_level0." to "clickTAG" above, resulting in "_root.clickTAG" or "_level0.clickTAG". It is strongly recommended to upload the ad into your account and verify that the ad is behaving normally prior to it going live, allowing time for any necessary changes.
    And this is the code I put in (btnClickTag is the name of my button):
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    btnClickTag.addEventListener(
          MouseEvent.CLICK,
          function(event: MouseEvent) : void {
          flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");
    and this is the error I got:
    Scene1, Layer 'actions', Frame 1, 1120: Access of undefined property btnClickTag. btnClickTag.addEventListener(

    First, make sure you have assigned that name to the button via the properties panel, then, be sure to adjust the code so that it is not spread out over several lines... normally it needs to be on one line.  You should not nest the function in the event listener either, so try the following (no need for the import statements)...
    btnClickTag.addEventListener(MouseEvent.CLICK, tagClick);
    function tagClick(event:MouseEvent):void {
          navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");

  • Flash CS3 Compiler in Strict Mode errors out 1120: Access of undefined property

    Hi,
    I am following a code example in a book and have the final fla and as files, so I know the project works when fully coded.
    This is my problem:
    In the book, it tells me I can test the movie to make sure that it is working so far. When I do that, I get the error 1120: Access of undefined property.
    The "property" is a component instance. If I take the example completed code and remove everything up to the point I am at, I receive the same errors, so I know it's not a spelling/syntax mistake.
    I have a feeling it is the Compiler in Strict Mode. But, when I change it to Standard Mode, then I get error 5001: The name of package 'com.foundastionAS3.ch12' does not reflect the location of this file. etc.
    So, in the end, I feel if I can't check my code until everything is completely finished, how do I check it as I am working?
    Can someone help?
    Thanks.
    note:: attached is a file of the compiler when it gives me multiple 1120s.

    It's funny. I checked the code from the book, it does not have it imported, but it still works. When I complete the code without the import, it works.
    When I do add the import (which is the first thing I did when the errors were thrown) while building the code, it removes that error, but the same 1120's are there. I checked the properties of the components to make sure they are runtime, and also the properties of the actionscript is runtime, so what is it?
    All of the more complex examples in the book are throwing these errors while building the code. The problem is, how do I check my code while creating it... That's why when I found this post "http://forums.adobe.com/message/2844566#2844566" I replied.

  • 1120: Access of undefined property scrollTractor

    The culprit line is:
    scrollingTractor.visible = true;
    Yes, scrollingTractor is a stage instance of a movie clip.  I copied the name from the instance name in the property inspector, so there is no typo.
    What am I missing?
    Regards,
    Ron

    Wow, that was fast!  <s>
    Actually, I put the code in the MC timeline instead of the main timeline.  Talk about being dumb. <g>
    Thanks!
    Ronald

  • 1120: Access of undefined property image_mc

    Image_mc is a symbol of mine. Not sure why it doesn't want to work. Here is my code:
    // Import the classes
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;
    import flash.geom.*;
    import flash.filesystem.*;
    var colorBitmapData:BitmapData = new BitmapData(960, 960, true, 0x000000);
    colorBitmapData.draw (image_mc);
    var myBitmapData:BitmapData = new BitmapData(960,960, true, 0x000000);
    var myBitmap:Bitmap = new Bitmap(myBitmapData, "auto", true);
    addChild(myBitmap);
    var drawLayer:Sprite = new Sprite();
    var drawTimer:Timer = new Timer(1000/990, 0);
    drawTimer.addEventListener("timer", drawToBitmapData);
    drawTimer.start();
    function drawToBitmapData(event:TimerEvent) {
              myBitmapData.draw(drawLayer);
    // use this equation for a hypotrochoid to plot points
    // x = offsetX+(rOuter+rInner)*Math.cos(time) - (rInner+offset) * Math.cos(((rOuter+rInner)/rInner)*time);
    // y = offsetY+(rOuter+rInner)*Math.sin(time) - (rInner+offset) * Math.sin(((rOuter+rInner)/rInner)*time);
    //point_A
    var xpos1:Number;
    var ypos1:Number;
    var radius1:Number = 50;
    var rOuter:Number = 200;
    var rInner:Number = 100;
    var offset:Number = 0;
    //point_B
    var xpos2:Number;
    var ypos2:Number;
    var radius2:Number = 100;
    var rOuter2:Number = 0;
    var rInner2:Number = 200;
    var offset2:Number = 480;
    //point_C
    var xpos3:Number;
    var ypos3:Number;
    var radius3:Number = 150;
    var rOuter3:Number = 100;
    var rInner3:Number = 100;
    var offset3:Number = 50;
    //same value for all points
    var centerX:Number = 480;
    var centerY:Number = 480;
    var offsetX:Number = 480;
    var offsetY:Number = 480;
    var time:Number = .5;
    addEventListener(Event.ENTER_FRAME,drawLines);
    function drawLines(e:Event){
              xpos1 = offsetX+(rOuter+rInner)*Math.cos(time) - (rInner+offset) *Math.cos(((rOuter+rInner)/rInner)*time);
              ypos1 = offsetY+(rOuter+rInner)*Math.sin(time) - (rInner+offset) *Math.sin(((rOuter+rInner)/rInner)*time);
              xpos2 = offsetX+(rOuter2+rInner2)*Math.cos(time) - (rInner2+offset2) *Math.cos(((rOuter2+rInner2)/rInner2)*time);
              ypos2 = offsetY+(rOuter2+rInner2)*Math.sin(time) - (rInner2+offset2) *Math.sin(((rOuter2+rInner2)/rInner2)*time);
              xpos3 = offsetX+(rOuter3+rInner3)*Math.cos(time) - (rInner3+offset3) *Math.cos(((rOuter3+rInner3)/rInner3)*time);
              ypos3 = offsetY+(rOuter3+rInner3)*Math.sin(time) - (rInner3+offset3) *Math.sin(((rOuter3+rInner3)/rInner3)*time);
              point_A.x = xpos1;
              point_A.y = ypos1;
              point_B.x = xpos2;
              point_B.y = ypos2;
              point_C.x = xpos3;
              point_C.y = ypos3;
    var color1:Number = colorBitmapData.getPixel(point_B.x, point_B.y);
    var color2:Number = colorBitmapData.getPixel(point_C.x, point_C.y);
    drawLayer.graphics.clear();
    drawLayer.graphics.moveTo(point_A.x,point_A.y);
    drawLayer.graphics.lineStyle(10, color1, .1);
    drawLayer.graphics.lineTo(point_B.x, point_B.y);
    drawLayer.graphics.lineStyle(2, color2, .2);
    drawLayer.graphics.lineTo(point_C.x, point_C.y);
    time += .01;

    Is image_mc on the screen (in the display list) with the correct instance name of image_mc or is it instantiated in code?
    If it's in your library you need to set the properties to export for actionscript and give it a name, e.g. MyImage. Then you need to instantiate it into memory,
    e.g.:
    var img:MyImage = new MyImage();
    Then you can draw it into a bitmapdata.
    colorBitmapData.draw(img);
    It doesn't need to be on the display list to be drawn of course.
    Also if this is in a class, make sure your class extends a display object or you'll have no access to the stage. So typically extend either Sprite or MovieClip.

  • 1120: Access of undefined property but4.

    stop();
    import flash.events.MouseEvent;
    but3.enabled;
    but3.addEventListener(MouseEvent.CLICK, pla);
    but4.enabled;
    but4.addEventListener(MouseEvent.CLICK, sto);
    function pla(e:MouseEvent):void {
    gotoAndPlay(1);
    function sto(e:MouseEvent):void {
    stop()
    Button3(but3) works fine, but with Button4(but4) I keep getting this error and I don't know what it means.
    In Digital Design class, making a simple Play/Pause button. Help is greatly appreciated.

    Nevermind, I fixed this. It didn't have an Instance Name.
    Now I have a new problem though

  • 1120: Access of undefined property contact.

    Hey Im currently in the middle of designing a flash wesbite.. ive even followed a tutorial and im stillll having problems...when i create buttons and i want action script for those buttons to go to like home page and stuff i get that error message.. heres what my code looks like and pretty much looks the ame as it does on the tutorial aswell:s
    stop();
    //handle events for buttons...
    video.addEventListener(MouseEvent.CLICK, clickSection);
    home.addEventListener(MouseEvent.CLICK, clickSection);
    photography.addEventListener(MouseEvent.CLICK, clickSection);
    printdesign.addEventListener(MouseEvent.CLICK, clickSection);
    pricelist.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
        //trace shows what's happening.. in the output window
        trace ("The "+evtObj.target.name+" button was clicked!")
        //go to the section clicked on...
        gotoAndStop(evtObj.target.name);
    i hope some 1 can help me with this... its just really unusual how im following the tutorial aswell and the code still aint working:s

    Hi,
    Just check the frame label you have put is according to button name or not

  • 1120: Access of undefined property

    hello to all.
    am also new to as3 and am sure that this error i've got is quite silly.
    i did a research on the net about this error but any answer could solve my prob.
    [CODE]
    package
         import flash.events.MouseEvent;
         public class displayNumbers
              zero_btn.addEventListener(MouseEvent.CLICK, callZero);
    //-----------------ADD NUMBER ZERO--------------------------------------------
         function callZero(e:MouseEvent):void
              result_txt.text= String(display_txt.maxChars - display_txt.length); //+ " characters left";
              if (result_txt.text > "1")
                   display_txt.appendText("0");
                   showSign_txt.appendText("0");               
              else
                   result_txt.visible = true;
                   result_txt.text = "MAX INPUTS";
    [/CODE]
    this code is included within an external file. however when i move this code back to the actions works fine.
    any ideas?
    thank you in advanced!

    This forum is about the Flash Player application, not aout programming in ActionScript 3. Try the ActionScript 3 forum at http://forums.adobe.com/community/flash/flash_actionscript3
    With regard to a learning path you are probably better of just getting some Introduction to ActionScript training and starting at chapter one before you start moving code from existing files to elsewhere when you have no idea what you are doing.

  • 1120: Access of undefined property (webservice)

    I have code as below. I keep having this compile error on the
    5 lines of code after the webservice creation line of code. I have
    searched the net for a solution to no avail. Please help, this is
    urgent. Many thanks in advance.
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.Responder;
    import mx.rpc.Fault;
    import mx.rpc.soap.WebService;
    import mx.rpc.soap.WSDL;
    import mx.rpc.soap.LoadEvent;
    import mx.rpc.soap.Operation;
    import flash.events.EventDispatcher;
    import flash.events.Event;
    var webService:WebService = new WebService(null, null);
    webService.wsdl="WSDL/csta-call-control-service.wsdl";
    webService.loadWSDL();
    webService.addEventListener(LoadEvent.LOAD, onWSDL);
    webService.addEventListener(ResultEvent, onRes);
    webService.addEventListener(FaultEvent.FAULT, onFault);
    ]]>
    </mx:Script>

    Hi, I managed to work out that particular syntax error....
    basically the below needed to be enclosed within a function.
    webService.wsdl="WSDL/csta-call-control-service.wsdl";
    webService.loadWSDL();
    webService.addEventListener(LoadEvent.LOAD, onWSDL);
    webService.addEventListener(ResultEvent, onRes);
    webService.addEventListener(FaultEvent.FAULT, onFault);
    Thanks!

  • 1120: Access of undefined property sendbtn.

    What would cause this I have a button named sendbtn but it causes this error like 4 times

    it says the same thing about these lines of code
    sendbtn.buttonMode = true;
    sendbtn.addEventListener(MouseEvent.CLICK, submit);
    resetbtn.buttonMode = true;
    resetbtn.addEventListener(MouseEvent.CLICK, reset);

  • 1120:access of undefined property _weaponManager

    package com.script {
              import flash.display.MovieClip;
              import flash.events.KeyboardEvent;
              import flash.events.MouseEvent;
              import com.weaponsystem.WeaponManager;
              import com.weaponsystem.weapons.ProjectileSingle;
              import flash.events.Event;
              public class Bird1 extends Bird{
                        public function Bird1() {
                                   var _weaponManager:WeaponManager;
                                  // add basic event listeners
                                  stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                                  stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
                                  stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler);
                                  // create new instance of WeaponManager, pass a reference to stage
                                  _weaponManager = new WeaponManager(this);
                                  // create weapons: AbstractWeapon(id_string, weapon_manager_instance, x, y, rotation)
                                  var singleTurret:ProjectileSingle = new ProjectileSingle("gun 1", _weaponManager, 100, 275, 90); // 1 turret projectile gun
                                  // add created weapons to weapon manager
                                  _weaponManager.addWeapon(singleTurret);
                                  // add solid objects to WeaponManager
                        // Event Handlers
                         * Enter Frame handler
                         * @param          event          Uses Event
                         private function enterFrameHandler(event:Event):void
                                  _weaponManager.update();
                         * Mouse Down handler
                         * @param          e          Uses MouseEvent
                         function onMouseDownHandler(event:MouseEvent):void
                                  _weaponManager.fireWeapons();
                         * Mouse Up handler
                         * @param          e          Uses MouseEvent
                         function onMouseUpHandler(event:MouseEvent):void
                                  _weaponManager.stopWeapons();
    can any 1 help me to solve? thx...

    Give it a try as dmennenoh said.
      public class Bird1 extends Bird{
         private  var _weaponManager:WeaponManager;
                      public function Bird1() {

Maybe you are looking for