title: How does ActionScript's writeInt work with Integers?
body: <p>I wanted to know how does writeInt treat a 32 bit unsigned or a signed integer passed to it?</p>
  
  <p>It is easy to understand that how it works with a hexadecimal number. Util.Print will print the corresponding ASCII Characters.</p>
  
  <p>0x41424344 will be broken down into 4 1 byte characters, A, B, C and D.</p>
  
  <p>It seems like its different when an integer is passed to writeInt.</p>
  
  <p>for instance,</p>
  
  <pre><code>var test: ByteArray = new ByteArray();
  test.writeInt(0x41424344); // prints ABCD
  test.writeInt(2590463591); // prints gVg
  test.writeInt(1119885898);  // prints BÀJ
  </code></pre>
  
  <p>I am unclear how the Util.Print function treats the integers written into the ByteArray by writeInt.</p>
  
  <p>The characters, gVg do not correspond to the integer number, 2590463591</p>
  
  <p>According to the definition of writeInt here:</p>
  
  <p><a href="http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/flash/utils/ByteArray.html#writeInt%28%29" rel="nofollow">http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/flash/utils/ByteArray.html#writeInt%28%29</a></p>
  
  <p>It states that it works with a 32 Bit Signed Integer.</p>
  
  <p>If someone can elaborate over how it translates the integers to characters, it would be helpful.</p>
  
  <p>EDIT: And how does it handle negative integers?</p>
  
  <p>For instance,</p>
  
  <pre><code>test.writeInt(-11338743); // prints ÿRü 
  </code></pre>
  
  <p>So, </p>
  
  <pre><code>-11338743 = 0xFF52FC09
  </code></pre>
  
  <p>is that correct?</p>
  
  <p>Thanks.</p>