title: another Actionscript newbie error 1118: Implicit coercion of value with static type Object to a possibly
body: <p>I get this error when compiling an AS3/Flex project:</p>
  
  <pre><code>Error 1118: Implicit coercion of a value with static type Object to a possibly 
  unrelated type HRPeople
  </code></pre>
  
  <p>I've clearly declared dataHR_A to be of class HRPeople, and I've initialized all of the arrays inside the HRPeople.as file. Not sure why I'm getting this error.</p>
  
  <p>My MXML Code looks like (snippet):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:Application 
      creationComplete="initApp()"
      xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"&gt;
  
      &lt;fx:Script&gt;
          &lt;![CDATA[                   
              public var dataHR_A:HRPeople = new HRPeople;
  
              public function initApp():void
              {               
                  //preallocate memory
                  dataHR_A.elements = 5;
                  dataHR_A.FirstName = new Array(dataHR_A.elements);
                  dataHR_A.LastName = new Array(dataHR_A.elements);
                  dataHR_A.Email = new Array(dataHR_A.elements);
                  dataHR_A.Salary = new Array(dataHR_A.elements);
  
                  dataHR_A = {  // ERROR IS ON THIS LINE OF CODE
                      FirstName:["Donald","Douglas","Jennifer","Michael","Pat"],
                      LastName:["OConnell","Grant","Whalen","Hartstein","Fay"],
                      Email:["OCONNELL","DGRANT","JWHALEN","MHARTSTE","PFAY"],
                      Salary:[2600, 2600, 4400, 13000, 6000]};
              }
  and so on ...
  </code></pre>
  
  <p>Here's the class file for HRPeople.as:</p>
  
  <pre><code>package {
      public class HRPeople {
          public var elements:int;
          public var FirstName:Array = [];
          public var LastName:Array = [];
          public var Email:Array = [];
          public var Salary:Array = [];
      }
  }
  </code></pre>