<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community : Document List - ActionScript 3</title>
    <link>https://forums.adobe.com/community/flash/flash_actionscript3?view=documents</link>
    <description>Latest Documents in ActionScript 3</description>
    <language>en</language>
    <pubDate>Wed, 12 Sep 2012 19:08:03 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2012-09-12T19:08:03Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Debugging ActionScript That Triggers No Errors</title>
      <link>https://forums.adobe.com/docs/DOC-2572</link>
      <description>&lt;!-- [DocumentBodyStart:f9e3a994-8e86-41f6-ab62-fcd3752f2392] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Code That Doesn't Work&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;This is a common lament. Adobe forum posters frequently state they see no error message but their code doesn't work.&amp;nbsp; Finding the problem and then the solution always involves the same steps:&amp;nbsp; Use the trace() function.&amp;nbsp; And, then use it again and again and again until you pinpoint the problem.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You can always pinpoint the problem using the trace() function.&amp;nbsp; For example, you click a button that's supposed to load a swf but when you click your button, your swf doesn't load.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Well, that's just the way a typical forum post would read.&amp;nbsp; But everyone that's been answering forum posts for more than a few months knows you can't assume the poster is correct.&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;The only things you can safely assume are you click something and you fail to see what you expect to see (the loaded swf).&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;That might mean the swf didn't load.&amp;nbsp; But it also might mean you didn't click the button that starts your swf loading or you did click that button and your swf did load but isn't added to the display list. Or, it did load and it is added to the display list but it's not visible because something is over it or it's positioned off-stage or its alpha is 0 or its visible property is false. Or, maybe the swf was loaded and added to the display list and would have been visible but something occured before the next frame rendered to make the loaded swf not visible.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;There are almost always a lot of reasons that code can seem to "not work".&amp;nbsp; To find the problem, you should start by pinpointing exactly where your code fails.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;So, let's debug this code which should load test.swf and display it when btn is clicked:&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;&lt;span style="font-size: 9.0pt; font-family: Courier;"&gt;btn.addEventListener(MouseEvent.CLICK,btnF);&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-size: 9.0pt; font-family: Courier;"&gt;function btnF(e:MouseEvent):void {&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-size: 9.0pt; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var loader:Loader = new Loader();&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-size: 9.0pt; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loader.load(new URLRequest("test.swf"));&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-size: 9.0pt; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(loader);&lt;/span&gt;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you do not see what you expect, first confirm that what you expect to see is reasonable by clicking test.swf or its embedding html to confirm that you can see something on stage and thereby judge that test.swf is displayed.&amp;nbsp; Or, use the trace() function in test.swf to judge whether it is loaded or not.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Once you do that you should make sure that code executes. Depending on where that code is located, it might not execute. To check if that code is executing you could use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace("ok");&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;btn.addEventListener(MouseEvent.CLICK,btnF);&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function btnF(e:MouseEvent):void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var loader:Loader = new Loader();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loader.load(new URLRequest("test.swf"));&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;When you test that code you should see ok in the output panel (or that code is not executing or you disabled trace output.)&amp;nbsp; If that code is not executing (i.e., you do not see ok in the output panel), you need to fix that:&amp;nbsp; &lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;If that code is timeline code, you can conclude it is attached to a frame that has not played at the time you click btn. &lt;/li&gt;&lt;li&gt;If it is in a class, that class has not been instantiated.&amp;nbsp; &lt;/li&gt;&lt;li&gt;And/or that listener is added within a function that needs to be called.&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;Assuming you see ok in the output panel, the next step would be to confirm your btn listener function (btnF) is being called:&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;btn.addEventListener(MouseEvent.CLICK,btnF);&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function btnF(e:MouseEvent):void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(e);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var loader:Loader = new Loader();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loader.load(new URLRequest("test.swf"));&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(loader);&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;After clicking btn you should see a MouseEvent.CLICK event in your output panel ([MouseEvent type="click" etc]). If you do not, btn is not being clicked. You might think you are clicking btn but Flash does not.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;There are quite a few ways that can happen but because there is no error message you know Flash is finding something with reference btn. So, btn exists. It is just not the object you are clicking. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;You should check for all btn objects by using Movie Explorer. If you find more than one, that may be the problem. Create a test fla and confirm multiple btn objects are the problem by removing all but the one closest to frame one of the parent timeline and retesting your code. If that works, re-add the other keyframes that contain btn (without dragging anything from the library) and the error should not return.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you do see [MouseEvent type="click" etc] in the output panel and there are no error messages, you know test.swf exists in a valid path (otherwise, Flash would generate an "Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found" message. But, you can add an Event.COMPLETE listener with a trace() function to confirm that test.swf is loading.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If none of the above reveal the problem, then you know test.swf is loading.&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;To find why it is not being displayed you will need to execute code some milliseconds after loading is complete to see if loader is still on stage and visible some milliseconds after loading is complete or whether some other code is moving or removing or otherwise changing loader so its content is no longer visible.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;The code below should do that allowing you to check if loader is being used to load something else or its alpha or x or visible or some other property is unexpected.&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;btn.addEventListener(MouseEvent.CLICK,btnF);&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;var loader:Loader = new Loader();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var t:Timer = new Timer(100,1);&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;t.addEventListener(TimerEvent.TIMER,traceF);&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function btnF(e:MouseEvent):void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loader.load(new URLRequest("test.swf"));&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(loader);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.start()&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function traceF(e:TimerEvent):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The url property should show test.swf confirming loader is not being used to&amp;nbsp;&amp;nbsp; // load something other than test.swf .&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The numChildren property should be one greater than loader's childIndex or&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // something is being positioned over loader&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(loader.content.loaderInfo.url,loader.parent.numChildren,loader.parent.getChildIndex (loader))&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xml:XML = describeType(loader);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var xmlList:XMLList = xml.accessor;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i:int=0;i&amp;lt;xmlList.length();i++){&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(xmlList[i].@access.indexOf("read")&amp;gt;-1){&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This will reveal most of the properties of loader and their&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // values (like alpha, x, y, visible etc).&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(xmlList[i].@name,loader[xmlList[i].@name])&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You will need to check those properties and values carefully.&amp;nbsp; While it would obviously be a problem if a property like visible is false there are less obvious ways a property change can cause a problem.&amp;nbsp; For example, if you are loading a swf that contains only non-embedded classic text and you rotate your loader or its content, you will not see anything on stage from the loaded swf.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Errors Caused by Asynchronous Code Execution&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Most code in flash executes in an orderly easy-to-follow way.&amp;nbsp; If you have&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;f1();&amp;nbsp; // where functions f1() and f2() are defined in this scope&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;f2();&lt;/p&gt;&lt;p class="GTGeneralText"&gt;you can be sure the code in f1() will execute before the code in f2().&amp;nbsp; That is an example of synchronous code execution:&amp;nbsp; If statement1 precedes statement2, statement1 executes before statement2 .&amp;nbsp; Most actionscript executes synchronously.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;But some code executes asynchronously.&amp;nbsp; In particular, file loading is asynchronous and load-complete listener functions execute asynchronously.&amp;nbsp; For example,&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var urlLoader:URLLoader = new URLLoader();&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;urlLoader.load(new URLRequest("test.txt"));&amp;nbsp; // test.txt should be in the same file with your flash files&lt;/li&gt;&lt;/ol&gt;&lt;p class="CXCodeLastLine"&gt;trace(urlLoader.data); // undefined because loading is not complete&lt;/p&gt;&lt;p class="GTGeneralText"&gt;and&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var dataS:String;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var urlLoader:URLLoader = new URLLoader();&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;urlLoader.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;urlLoader.load(new URLRequest("test.txt"));&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataS = urlLoader.data;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace(urlLoader.data); // undefined because this executes before completeF() executes&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;trace(dataS);&amp;nbsp; // null because dataS is typed but no value is assigned until completeF() executes&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, you should use listener functions to trigger code that depends on loaded assets:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var dataS:String;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var urlLoader:URLLoader = new URLLoader();&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;urlLoader.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;urlLoader.load(new URLRequest("test.txt"));&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataS = urlLoader.data;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dependentCodeF();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function dependentCodeF():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(dataS);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // etc&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;gotoAndPlay and gotoAndStop (to a Frame Not Yet Loaded)&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you use either of those and find the Flash is not going to the correct frame, after checking for typos, you should ensure the target frame is loaded.&amp;nbsp; This is more likely to occur when testing online but I've seen the same issue when testing locally, too.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, don't execute the goto until the needed frame is loaded.&amp;nbsp; It's easiest to use a complete listener to ensure all frames are loaded if you encounter this problem:&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Example 1.&amp;nbsp;&amp;nbsp; goto is applied to the swf that contains your code &lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;this.loaderInfo.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.gotoAndStop(this.totalFrames);&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Example 2.&amp;nbsp; The goto is applied to a loaded swf:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var loader:Loader = new Loader();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;loader.load(new URLRequest("test.swf"));&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var mc:MovieClip = MovieClip(loader.content); // the loader's content property, after loading is complete, is the loaded swf's main timeline (which is a MovieClip).&amp;nbsp; Unfortunately, the flash compiler (in strict mode) often loses track of what object is of what class type and triggers a &lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mc.gotoAndStop(mc.totalFrames);&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Lost Object References&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;There are many ways this occurs but most commonly it occurs in for-loops and while-loops.&amp;nbsp; One reference is used repeatedly so with each loop iteration the current object reference overwrites the previous object reference.&amp;nbsp; At the end of the for-loop that reference only refers to the last created object. Here's the typical problem (already mentioned in chapter 1):&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (var io:int = 0; io &amp;lt; 4; io++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt; opBtn.addEventListener(MouseEvent.CLICK, pressOperator);&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;And then later in the code&lt;/p&gt;&lt;ul style="list-style-type: disc;"&gt;&lt;li&gt;&lt;strong style="font-family: Courier;"&gt;opBtn.mouseEnabled = false;&amp;nbsp; //&amp;nbsp; only one opBtn instance will be disabled&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="GTGeneralText"&gt;Among the many ways to resolve this issue you can, &lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;assign a name property to each object and use the getChildByName() method applied to the objects' parent:&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtn.name=i.toString();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var btn = getChildByName(i.toString());&amp;nbsp; // if you use an opBtn reference, use Appendix A to debug the Flash error&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btn.mouseEnabled = false;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;push each object into an array and latter loop through the array:&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;var opBtnA:Array = [];&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtnA.push(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;opBtnA.length;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtnA[i].mouseEnabled = false;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;add each object to a parent that contains nothing but those objects and loop through the parents children:&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;var opBtnParent:Sprite = new Sprite();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;addChild(opBtnParent);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtnParent.addChild(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;opBtnParent.numChildren;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Btn_operator(opBtnParent.getChildAt(i)).mouseEnabled = false; &lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;use a different object reference in each loop:&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this["opBtn"+i] = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this["opBtn"+i].mouseEnabled = false;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Repeated Execution Code&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;This only happens when code is added to a timeline frame and that frame repeatedly plays.&amp;nbsp; For example, if the following code is attached to a frame that repeatedly executes you will find f() being executed more and more frequently.&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var t:Timer = new Timer(1000,0);&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;t.addEventListener(TimerEvent.TIMER,f);&lt;/li&gt;&lt;li&gt;t.start();&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function f(e:TimerEvent):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(getTimer());&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, use a boolean so that code only executes the first time the frame plays:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var alreadyExecuted:Boolean;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;if (! alreadyExecuted) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alreadyExecuted=true;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var t:Timer=new Timer(1000,0);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.addEventListener(TimerEvent.TIMER,f);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.start();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function f(e:TimerEvent):void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(getTimer());&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;} &lt;/p&gt;&lt;p class="GTGeneralText"&gt;The above code is also an example of a run-away loop defined by an accelerating loop.&amp;nbsp; If you use setInterval(), you can prevent it from triggering run-away loops by clearing the interval prior to each setting:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var testI:int;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;clearInterval(testI);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;testI = setInterval(testF,1000);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function testF(){&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(getTimer());&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;or enclose in a boolean. Or, even better, do both:&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var alreadyExecuted:Boolean;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;if (! alreadyExecuted) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var testI:int;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clearInterval(testI);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testI = setInterval(testF,1000);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function testF(){&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(getTimer());&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;} &lt;/p&gt;&lt;p class="CXCodeLastLine" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Problems Related to Class File Use&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ol style="list-style-type: decimal;"&gt;&lt;li&gt;To see the results of a changed class file, you must save your changes and then test or publish a new swf.&lt;/li&gt;&lt;li&gt;If, in your default directory, you have a class file C1.as:&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;package {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class C1 {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function C1() {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("C1");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;And in a subdirectory Sub of your default directory you have a different class file C1.as:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;package Sub{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class C1 {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function C1() {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("C.C1");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Then in any other class instantiating a C1 instance, even if Sub.C1 is imported into that class and no matter the location of the other class, the C1 class from the default directory will be used, not the C1 class from the Sub directory.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:f9e3a994-8e86-41f6-ab62-fcd3752f2392] --&gt;&lt;img src='/beacon?t=1415939609820' /&gt;</description>
      <pubDate>Fri, 14 Sep 2012 17:01:51 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/docs/DOC-2572</guid>
      <dc:date>2012-09-14T17:01:51Z</dc:date>
      <clearspace:dateToText>2 years 2 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Debugging ActionScript 3.0 Errors</title>
      <link>https://forums.adobe.com/docs/DOC-2542</link>
      <description>&lt;!-- [DocumentBodyStart:ba0abb09-3a8a-4a3e-9340-b1f1853b94dc] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;First, click File &amp;gt; Publish Settings &amp;gt; Flash, tick the "Permit debugging" checkbox, then click OK and retest.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;By ticking "Permit debugging" you will see more detailed/helpful error messages. Error messages' exact contents depend on the error type (compile-time or run-time), the exact error and the location (timeline or class file) of your problematic code. But, in all scenarios (except for errors that occur during an asynchronous event like file loading), the error message will indicate the &lt;strong&gt;&lt;em&gt;exact line number&lt;/em&gt;&lt;/strong&gt; of the problematic code,&lt;em&gt; if&lt;/em&gt; you tick "Permit debugging".&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;You may find some error messages need no explanation (like compiler error "1021&lt;strong&gt;: &lt;/strong&gt;Duplicate function definition"). But if you need further explanation, check the Flash help file &lt;span style="color: windowtext;"&gt;Appendixes&lt;/span&gt; (Help &amp;gt; Flash Help &amp;gt; ActionScript 3.0 and Components &amp;gt; ActionScript 3.0 Reference for the Adobe Flash Platform &amp;gt; Appendixes), where you'll find Compiler Errors and Run-Time Errors which comprise a complete listing of all error messages often with additional and sometimes helpful information. As of this writing that link is &lt;a class="jive-link-external-small" href="http://help.adobe.com/en_US/FlashPlatform/reference/ActionScript/3/appendixes.html" rel="nofollow" target="_blank"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/ActionScript/3/app endixes.html&lt;/a&gt; but that may change especially as updated help files are published by Adobe.&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;This is the first place you should check when you encounter an error message that you do not completely understand. The additional information may be enough to save hours of hair-pulling frustration.&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;But if that's not enough help, don't be afraid to use a search engine. Searching for "Flash as3 error xxxx" should bring up all sorts of information. Some of it may be helpful.&lt;/span&gt;&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Below are the error messages (in numeric order) most commonly cited in the ActionScript 3 forum and help for resolving.&lt;/span&gt;&lt;/p&gt;&lt;p class="CTChapterTitle" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="CTChapterTitle" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1009: Cannot access a property or method of a null object reference.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;This is the most common error posted on the Adobe Flash-related Forums.&amp;nbsp; Fortunately, most of these errors are quick and easy to fix (assuming you read the Permit Debugging section).&amp;nbsp; If there is only one object reference in the problematic line of code, you can conclude &lt;em&gt;that object does not exist when that line of code executes&lt;/em&gt;.&amp;nbsp;&amp;nbsp; For example, if there is no object mc on-stage,&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var mc:MovieClip;&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;mc.x = 0;&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;is the simplest code that would trigger a 1009 error.&amp;nbsp; The variable mc has been declared but is null because no movieclip exists and and it has not been created.&amp;nbsp; Trying to access the x property (or any other property of mc) is going to result in a 1009 error because you cannot access a property of a null (or non-existant) object.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy this problem, you must create the referenced object either on-stage or with actionscript. To create the object with code, use the "new" constructor:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var mc:MovieClip = new MovieClip();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;mc.x = 0;&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;Precisely the same error will occur in many different guises.&amp;nbsp; Here's the same error trying to reference a null object method:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var s:Sound;&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;s.play();&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;If there's more than one object in the problematic line of code, for example:&lt;/p&gt;&lt;p class="C1Code1Line"&gt;mc1.x = mc2.width+mc2.x;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;use the trace() function to find which object(s) is(are) null:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace(mc1);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace(mc2);&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;mc1.x = mc2.width+mc2.x;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Of course, typos are every coders burden and are a common cause of 1009 errors.&amp;nbsp; Instead of comparing two names and trying to confirm they are the same, (eg, an instance name in the properties panel and an actionscript name), it's more reliable to copy the name from one location and paste it to the other.&amp;nbsp; Then you can be certain the names are the same.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;There are, however, more obtuse ways to trigger a 1009 error when you create and delete objects on-stage and especially if you use timeline tweening.&amp;nbsp;&amp;nbsp; I have seen some 1009 errors that are impossible to diagnose without checking the history panel.&amp;nbsp;&amp;nbsp; And if that panel is cleared or the problem was created far enough in the past that the steps causing the error are no longer present in the history panel, there's no way (known to me) to deduce what caused the error.&amp;nbsp; However, those errors can still be fixed.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you are certain you have an on-stage object whose instance name (in the properties panel) matches your actionscript reference and &lt;em&gt;it is in a frame that plays no later than your code referencing that object&lt;/em&gt;, you may need to take a few steps backwards to solve the problem.&amp;nbsp; But first make sure that frame plays before your object reference. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;You can always confirm that by using the trace() function:&amp;nbsp; Place a trace("frame") in the keyframe that contains your object.&amp;nbsp; (If you have a document class it will need to extend the MovieClip class to do this.) And place a trace("code") just above the problematic line of code and test.&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you see "code" and then your error message, your code is executing before your frame plays. Fix your code so it does not execute until the object exists.&amp;nbsp; I cannot tell you how to do that because the solution will vary depending on your project.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you see "frame" then "code", you have confirmed your object exists before your code tries to reference it so something else is causing the problem. This always boils down to Flash being confused because you have or had more than one object with that reference name.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To solve this problem, move the on-stage object to its own layer, clear all keyframes in that layer except one, copy its reference from your actionscript and paste into the properties panel.&amp;nbsp; Use movie explorer to confirm there is no actionscript creating a duplicate reference and there is no other on-stage object with the same reference.&amp;nbsp;&amp;nbsp; Then test.&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;There will be no 1009 referencing that object if those steps are followed and the actionscript referencing the object executes no sooner than the keyframe containing the object. Now, add other needed keyframes and change the object properties, as needed.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Another way this error can occur is when trying to reference a loader's content property before loading is complete:&amp;nbsp; &lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var loader:Loader = new Loader();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;loader.load(new URLRequest("test.swf"));&amp;nbsp; // make sure you have a test.swf in the correct directory&lt;/li&gt;&lt;/ol&gt;&lt;p class="CXCodeLastLine"&gt;trace(MovieClip(loader.content).totalFrames);&amp;nbsp; // will trigger a 1009 error&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Because a loader's content property is null until loading is complete, use an Event.COMPLETE listener and listener function before referencing the loader's content.&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var loader:Loader = new Loader();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;loader.load(new URLRequest("test.swf"));&amp;nbsp; // make sure you have a test.swf in the correct directory&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(MovieClip(loader.content).totalFrames);&amp;nbsp; // no error&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Also, a DisplayObject's root and stage properties are null until the object is added to the display list.&amp;nbsp; This error frequently occurs in a DisplayObject's class file where the object is created using the "new" constructor, the object's class constructor executes and a stage reference is made before the object is added to the display list. For example:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var custom_mc:Custom_MC = new Custom_MC();&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;addChild(custom_mc);&lt;/p&gt;&lt;p class="GTGeneralText"&gt;will trigger this error if Custom_MC looks something like:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;package {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.display.MovieClip;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Custom_MC extends MovieClip {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function Custom_MC() {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // stage is null at this point triggering a 1009 error&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.x=stage.stageWidth/2;&amp;nbsp; &lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To test if the problem is whether an object has been added to the display list, you can use:&lt;/p&gt;&lt;p class="C1Code1Line"&gt;trace(this.stage);&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;added above the problematic line of code.&amp;nbsp; The trace output will be null.&amp;nbsp; For example:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;package {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.display.MovieClip;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Custom_MC extends MovieClip {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function Custom_MC() {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(this.stage);&amp;nbsp; &lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.x=stage.stageWidth/2;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy this problem, use the Event.ADDED_TO_STAGE listener before trying to reference the stage:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;package {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.display.MovieClip;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Custom_MC extends MovieClip {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function Custom_MC() {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.addEventListener(Event.ADDED_TO_STAGE,init);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function init(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.x=stage.stageWidth/2;&amp;nbsp; // stage is defined when this executes&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1013: The private attribute may be used only on class property definitions.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;This is commonly caused by mis-matched curly brackets {} in a class file in a line of code above the line that is mentioned in the error message.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1046:Type was not found or was not a compile-time constant: xxxx&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You forgot to save the xxx class file, you have a typo or you need to import the needed class, xxxx.. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy the later, open the Flash help files&amp;gt;Classes&amp;gt;xxxx.&amp;nbsp; At the top you will see a package listed (eg, fl.controls) that you will use in the needed import statement.&amp;nbsp; Add the following to your scope:&lt;/p&gt;&lt;p class="C1Code1Line"&gt;import fl.controls.xxxx&lt;/p&gt;&lt;p class="GTGeneralText"&gt;(And, in this example, the needed class type is a component so you'll need that component in your fla's library, too.)&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1061: Call to a possibly undefined method xxxx through a reference with static type flash.display:DisplayObject.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You are trying to reference a method defined on a MovieClip timeline using dot notation but the Flash compiler does not recognize that MovieClip as a MovieClip. To remedy explicitly cast the MovieClip.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;For example, you have a function/method xxxx() defined on your root timeline which you are trying to reference using,&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;root.xxxx();&lt;/li&gt;&lt;/ol&gt;&lt;p class="GTGeneralText"&gt;To remedy, cast root as a MovieClip,&lt;/p&gt;&lt;p class="C1Code1Line"&gt;MovieClip(root).xxxx();&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1067: Implicit coercion of a value of type xxxx to an unrelated type yyyy.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You are trying to assign an object from class xxxx a value from class yyyy. The most common error of this type seen on the Adobe forums is when trying to assign text to a TextField and the code forgets to use the TextField's text property:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var tf:TextField = new TextField();&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;tf = "This is test text.";&amp;nbsp; // should be using tf.text = "This is test text.";&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1078: Label must be a simple identifier.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;I get this error frequently because I'm speed typing and instead of a semi-colon, I have the shift-key pressed and add a colon at the end of a line of code.&amp;nbsp; Check the line of code mentioned in the error message and look for a misplaced colon (typically the last character in the line).&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1118: Implicit coercion of a value with static type xxxx to a possibly unrelated type yyyy.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Often loaded content needs to be cast. For example, if you load a swf and try and check a MovieClip property (e.g., totalFrames), you will need to cast it as a MovieClip:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var loader:Loader = new Loader();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;loader.load(new URLRequest("someswf.swf"));&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace(e.target.loader.content.totalFrames):&amp;nbsp; // error expected&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;trace(MovieClip(e.target.loader.content).totalFrames));&amp;nbsp; // no error expected&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, if you are loading xml:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var xml:XML;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var loader:URLLoader = new URLLoader();&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;loader.addEventListener(Event.COMPLETE,completeF);&lt;/li&gt;&lt;li&gt;loader.load(new URLRequest("somexml.xml"));&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;function completeF(e:Event):void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;xml = e.target.data // error expected&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;xml = XML(e.target.data); // no error expected&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;When you use getChildByName, the compiler only knows the object is a DisplayObject. If you want to use a property that is not inherited by DisplayObjects (e.g., mouseEnabled), you need to cast the object:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator(); // where the Btn_operator class&amp;nbsp; // extends an InteractiveObject class&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtn.name=i.toString();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtn = Btn_operator(getChildByName(i.toString()));&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtn.mouseEnabled = false;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1119: Access of possibly undefined property xxx through a reference with static type yyyy&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You're trying to reference a property that doesn't exist for that class type.&amp;nbsp; You either have a typo or, if the Flash type is something like DisplayObject and, you are trying to reference a property of a class, which does have the property you are trying to reference, explicitly cast your object.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;For example, if you have a DisplayObject (eg, dobj) added to the root timeline:&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;root.dobj;&amp;nbsp; // may trigger a 1119 error&lt;/li&gt;&lt;/ol&gt;&lt;p class="CXCodeLastLine"&gt;MovieClip(root).dobj; // will not trigger a 1119 error&lt;/p&gt;&lt;p class="GTGeneralText"&gt;In fact, almost always when you use root in ActionScript 3 you will need to case it as a MovieClip unless you have a document class that extends the Sprite class. In that situation, you will need to cast root as a Sprite:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;MovieClip(root); // or&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;Sprite(root):&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Also if, this.parent is a MovieClip:&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;this.parent.ivar;&amp;nbsp; // may trigger a 1119 error&lt;/li&gt;&lt;/ol&gt;&lt;p class="CXCodeLastLine"&gt;MovieClip(this.parent).ivar;&amp;nbsp; // will not trigger a 1119&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you're using one of your own class objects,&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var opBtnParent:Sprite = new Sprite();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;addChild(opBtnParent);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (var i:int=0;i&amp;lt;4;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opBtn:Btn_operator = new Btn_operator();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opBtnParent.addChild(opBtn);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// then you can use:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;for (i=0;i&amp;lt;opBtnParent.numChildren;i++) {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Btn_operator(opBtnParent.getChildAt(i)).mouseEnabled = false;&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, you may be trying to reference an object created outside the class.&amp;nbsp; In that situation make sure your class is dynamic, for example:&lt;/p&gt;&lt;p class="C1Code1Line"&gt;dynamic public class YourClass extends MovieClip{&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You can now add properties to YourClass instances from outside YourClass.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;a class="jive-link-thread-small" data-containerId="2066" data-containerType="14" data-objectId="418359" data-objectType="1" href="https://forums.adobe.com/thread/418359"&gt;&lt;span style="color: windowtext;"&gt;&lt;strong&gt;1120:Access of undefined property error&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;strong&gt; xxxx&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You either have a typo, you have forgotten that ActionScript is case sensitive or you have defined the variable somewhere but your reference is out of scope of the defined variable. Typically, the later occurs when you make a variable local to a function and then try and reference the variable outside that function. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;For example,&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var thisVar:String = "hi";&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;trace(thisVar);&lt;/p&gt;&lt;p class="GTGeneralText"&gt;will trigger and 1120 error because thisVar is local to f() (as a consequence of prefixing its definition with the keyword var inside a function body.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, use the following (but you will need to call f() before thisVar has value "hi"):&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var thisVar:String;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisVar = "hi";&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;trace(thisVar);&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Check chapter 2, function scope for more information.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1120: Access of undefined property Mouse.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;(import the needed class: flash.ui.Mouse):&lt;/p&gt;&lt;p class="C1Code1Line"&gt;import flash.ui.Mouse;&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1151: A conflict exists with definition xxxx in namespace internal.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You have more than one of the following statements in the same scope:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var xxxx:SomeClass;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;// and/or&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;var xxxx:SomeClass = new SomeClass();&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, change all but the first&amp;nbsp; to:&lt;/p&gt;&lt;p class="C1Code1Line"&gt;xxxx = new SomeClass();&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1178: Attempted access of inaccessible property xxxx through a reference with static type YYYY.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Variable xxxx typed private in class YYYY when should be protected, internal or public.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1180: Call to a possibly undefined method addFrameScript.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You have code (or even an empty space) on a timeline and your document class is extending the sprite class.&amp;nbsp; To remedy, extend movieclip or remove code from all timelines.&amp;nbsp; To find timeline code, use movie explorer and toggle only the show actionscript button.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;1180: Call to a possibly undefined method xxxx&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you think you &lt;em&gt;have &lt;/em&gt;defined that method, check for a typo. i.e., check your method's spelling and use copy and paste to eliminate typo issues.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, you have a path problem. To remedy, check your path and check the relevant (movieclip or class) scope section in chapter 2 to resolve path problems.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, if xxxx is a class name, you failed to define/save that class in the correct directory.&amp;nbsp; To remedy, save the needed class file and make sure the method xxxx is defined in your class.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, you are trying to use a method defined in a class that has not been imported. To remedy, import the needed class. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, you are trying to use a method xxxx that is not inherited by your class. For example, trying to use addEventListener in a custom class that does not extend a class with the addEventListener method will trigger a 1080 error.&amp;nbsp; To remedy, extend a class that has this method.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, you nested a named function. To remedy, un-nest it:&lt;/p&gt;&lt;p class="GTGeneralText"&gt;In actionscript, you can use named and anonymous functions.&amp;nbsp; A named function has the form:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void{&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;An anonymous function has the form:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var f1:Function = function():void{&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;In the code below, both f1() and f2() are named functions and f2() is nested in f1().&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("f1");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function f2():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("f2");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you use this code, at no time will f2() be defined outside f1().&amp;nbsp; If you try and call f2() from outside f1(), no matter how many times you call f1(), you will generate an 1180 error:&amp;nbsp; call to a possibly undefined method.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;To remedy, un-nest:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f2():void{&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Alternatively, nest an anonymous function in a named function:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var f2:Function; &lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2 = function():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Or, nest two anonymous functions:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var f2:Function;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var f1:Function = function():void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2 = function():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Note f2 is declared outside f1.&amp;nbsp; That is required if you want to call f2 from outside the f1 function body. &lt;/p&gt;&lt;p class="GTGeneralText"&gt;If you tried:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var f2:Function = function():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("f2");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2();&amp;nbsp; // this will work&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;But, if you try:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var f2:Function = function():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("f2");&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;f1();&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;f2();&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You will trigger an 1180: Call to a possibly undefined method f2 error.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You can expect the same error if you nest a named function in an anonymous function.&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;You can nest name and anonymous functions &lt;em&gt;if &lt;/em&gt;you only call the nested function from within the nesting function body.&amp;nbsp; For example, the following two snippets will not trigger an error.&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Snippet 1:&lt;/strong&gt;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;function f1():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(1);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function f2():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(2);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;f1();&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Snippet 2:&lt;/strong&gt;&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var f1:Function=function():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(1);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function f2():void{&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace(2);&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;}&lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;f1();&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Nevertheless, while you &lt;em&gt;can &lt;/em&gt;nest a named function in this situation without triggering an error, you should not.&amp;nbsp; There is no benefit to nesting a named function and, in addition to triggering 1180 errors, it makes your code less readable.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt; 1203: No default constructor found in base class xxx.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Failure to call the superclass (or no constructor).&amp;nbsp; To remedy, either create a constructor or use super() in your already existing constructor.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;SecurityError: Error #2000: No active security context.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;The file you are trying to load does not exist.&amp;nbsp; You probably have a typo or a path problem.&amp;nbsp; &lt;/p&gt;&lt;p class="GTGeneralText"&gt;If your file loads when tested locally but triggers that error when test&amp;nbsp; online, look for case mis-matches. For example, trying to load file.SWF will load file.swf locally but not online.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;TypeError: Error #2007: Parameter text must be non-null.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You are trying to assign undefined text to a TextField's text property. For example, the following will trigger this error:&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var tf:TextField = new TextField();&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var a:Array = [1,2];&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;var s:String;&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;tf.text = s;&lt;/li&gt;&lt;/ol&gt;&lt;p class="C2Code2Lines"&gt;// and&lt;/p&gt;&lt;ol style="list-style-type: lower-alpha;"&gt;&lt;li&gt;tf.text = a[2];&lt;/li&gt;&lt;/ol&gt;&lt;p class="CXCodeLastLine"&gt;// will both trigger this error&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You have an incorrect path and/or file name.&amp;nbsp; First, double check your spelling and your paths.&amp;nbsp; Then make sure your load target's path is relative to the location of your swf's embedding html file's location, if you are testing by opening the html in a browser.&amp;nbsp; If you are testing in the Flash IDE or testing by opening the swf directly, the path should be relative to the swf.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;2136: The SWF file file:///somepath/someswf.swf contains invalid data.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;You are trying to use the "new" constructor with a document class.&amp;nbsp; To remedy, either remove that class from your document class or remove the "new" constructor applied to that class.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;5000: The class 'xxx' must subclass 'yyy' since it is linked to a library symbol of that type.&lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;Can occur because a previous error stoned the compiler triggering errors that do not exist.&amp;nbsp; But if it's the first (or only) error listed, your 'xxx' class must usually extend a MovieClip or SimpleButton.&amp;nbsp; Right click your library symbol, click properties and check the base class listed there.&lt;/p&gt;&lt;p class="GTGeneralText" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;&lt;strong&gt;5008: The name of definition 'Xxxx' does not reflect the location of this file. Please change the definition's name inside this file, or rename the file. &lt;/strong&gt;&lt;/p&gt;&lt;p class="GTGeneralText"&gt;The file name and the class name must match.&amp;nbsp; For example,&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;package&amp;nbsp; {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Xxxx {&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function Xxxx(){&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p class="C2Code2Lines"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p class="CXCodeLastLine"&gt;}&lt;/p&gt;&lt;p class="GTGeneralText"&gt;must be saved as Xxxx.as (and case matters).&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ba0abb09-3a8a-4a3e-9340-b1f1853b94dc] --&gt;</description>
      <pubDate>Wed, 12 Sep 2012 19:02:20 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/docs/DOC-2542</guid>
      <dc:date>2012-09-12T19:02:20Z</dc:date>
      <clearspace:dateToText>2 years 2 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

