<?xml version="1.0" encoding="UTF-8"?>
<posts type="array">
  <post>
    <body>bq. will it still fail with users who have only Flash 10?

yes, it will.

bq. Whats the big difference between them?

Adobe has an &quot;article about xss and flash9&quot;:http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html

edit:

&lt;pre&gt;
Security.allowDomain(&quot;http://www.site.com/image.png&quot;);
&lt;/pre&gt;

Won't it be better, if you only enter the DOMAIN, not the whole path to the file you want to load?</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;will it still fail with users who have only Flash 10?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;yes, it will.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Whats the big difference between them?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Adobe has an &lt;a href=&quot;http://www.adobe.com/devnet/flashplayer/articles/flash_player9_security_update.html&quot;&gt;article about xss and flash9&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;edit:&lt;/p&gt;
&lt;pre&gt;
Security.allowDomain(&quot;&lt;a href=&quot;http://www.site.com/image.png&amp;quot;)&quot;&gt;http://www.site.com/image.png&amp;quot;)&lt;/a&gt;;
&lt;/pre&gt;
&lt;p&gt;Won&amp;#8217;t it be better, if you only enter the &lt;span class=&quot;caps&quot;&gt;DOMAIN&lt;/span&gt;, not the whole path to the file you want to load?&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-21T14:13:27-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1482724</id>
    <post-number type="integer">8</post-number>
    <topic-id type="integer">65760</topic-id>
    <updated-at type="datetime">2009-11-21T14:21:07-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>It depends on the player you are using.
Flash 9 and older don't need them, only if you are using 10 and newer.</body>
    <body-html>&lt;p&gt;It depends on the player you are using.&lt;br /&gt;
Flash 9 and older don&amp;#8217;t need them, only if you are using 10 and newer.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-21T13:34:21-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1482543</id>
    <post-number type="integer">6</post-number>
    <topic-id type="integer">65760</topic-id>
    <updated-at type="datetime">2009-11-21T13:34:21-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. When I test it on the site, I get the green light, but no score submission.

The green light was removed months ago.
What you see now is the green plug. It only show, that you are able to chat. It don't show the API connection.

if it don't even execute &lt;code&gt;trace(&quot;Initialized&quot;);&lt;/code&gt; then your class never get initialized.
Like Curious asked, how do you create an instance of the Main class?</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;When I test it on the site, I get the green light, but no score submission.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The green light was removed months ago.&lt;br /&gt;
What you see now is the green plug. It only show, that you are able to chat. It don&amp;#8217;t show the &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; connection.&lt;/p&gt;
&lt;p&gt;if it don&amp;#8217;t even execute &lt;code&gt;trace(&quot;Initialized&quot;);&lt;/code&gt; then your class never get initialized.&lt;br /&gt;
Like Curious asked, how do you create an instance of the Main class?&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T10:16:53-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476670</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">65472</topic-id>
    <updated-at type="datetime">2009-11-19T10:16:53-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. I thought flash cs3 or 4 is what most people use ?

That's right!
But most people don't like coding. They prefer drawing the most stuff and animate it using the timeline. 

Flash CS isn't suitable for coding.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;I thought flash cs3 or 4 is what most people use ?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s right!&lt;br /&gt;
But most people don&amp;#8217;t like coding. They prefer drawing the most stuff and animate it using the timeline.&lt;/p&gt;
&lt;p&gt;Flash CS isn&amp;#8217;t suitable for coding.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T05:33:42-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476297</id>
    <post-number type="integer">16</post-number>
    <topic-id type="integer">65382</topic-id>
    <updated-at type="datetime">2009-11-19T05:33:42-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. so there&#8217;s no other way but to write the code in the &#8220;Actions &#8211; Frame&#8221; window, instead of in the document&#8217;s class .as file ?

You still can write it in &quot;document class&quot;. 
Sounds like you use Flash CS. There is a setting &quot;publish into first frame&quot;. Uncheck this setting to ALL of your stuff but preloader.

bq. the code of the first frame only begins when everything is already loaded

That's because ALL your stuff is in the first frame.
Flash only execute the first frame, if it is fully loaded. If your game has only one frame, then flash will wait until your whole game is loaded.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;so there&#8217;s no other way but to write the code in the &#8220;Actions &#8211; Frame&#8221; window, instead of in the document&#8217;s class .as file ?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You still can write it in &amp;#8220;document class&amp;#8221;. &lt;br /&gt;
Sounds like you use Flash CS. There is a setting &amp;#8220;publish into first frame&amp;#8221;. Uncheck this setting to &lt;span class=&quot;caps&quot;&gt;ALL&lt;/span&gt; of your stuff but preloader.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;the code of the first frame only begins when everything is already loaded&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s because &lt;span class=&quot;caps&quot;&gt;ALL&lt;/span&gt; your stuff is in the first frame.&lt;br /&gt;
Flash only execute the first frame, if it is fully loaded. If your game has only one frame, then flash will wait until your whole game is loaded.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T05:26:04-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476287</id>
    <post-number type="integer">11</post-number>
    <topic-id type="integer">65382</topic-id>
    <updated-at type="datetime">2009-11-19T05:30:18-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. The private var and public var part didn&#8217;t make a lot of sense.

Why not?
This vars are inside the class, not a function. You need to specify their visibility.
Make them private - that way you can access them within the class.

bq. Making a private var for the char in the Gun function doesn&#8217;t make sense.

You need a reference to your char object within the gun class. 
Using static variables isn't the best way to solve it.

bq. And would I call the Gun function in the Char class?

nope. You only call it from the Game class.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;The private var and public var part didn&#8217;t make a lot of sense.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Why not?&lt;br /&gt;
This vars are inside the class, not a function. You need to specify their visibility.&lt;br /&gt;
Make them private &amp;#8211; that way you can access them within the class.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Making a private var for the char in the Gun function doesn&#8217;t make sense.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You need a reference to your char object within the gun class. &lt;br /&gt;
Using static variables isn&amp;#8217;t the best way to solve it.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;And would I call the Gun function in the Char class?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;nope. You only call it from the Game class.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T01:38:54-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476130</id>
    <post-number type="integer">5</post-number>
    <topic-id type="integer">65316</topic-id>
    <updated-at type="datetime">2009-11-19T01:39:32-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. (It&#8217;s like the swf waits for everything to be loaded before it shows anything at all)

That's true.... if you have only ONE frame. Thats why you should put your preloader into the first frame and anything else into the second. That way flash will launch the preloader after the first frame is ready.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;(It&#8217;s like the swf waits for everything to be loaded before it shows anything at all)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s true&amp;#8230;. if you have only &lt;span class=&quot;caps&quot;&gt;ONE&lt;/span&gt; frame. Thats why you should put your preloader into the first frame and anything else into the second. That way flash will launch the preloader after the first frame is ready.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T01:35:06-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476129</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">65382</topic-id>
    <updated-at type="datetime">2009-11-19T01:35:06-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>maybe you try remove it twice?

btw: that way you remove only the visible part. it still remains in the memory. 
It will continue to listen to events.</body>
    <body-html>&lt;p&gt;maybe you try remove it twice?&lt;/p&gt;
&lt;p&gt;btw: that way you remove only the visible part. it still remains in the memory. &lt;br /&gt;
It will continue to listen to events.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-19T00:36:03-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1476109</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">65453</topic-id>
    <updated-at type="datetime">2009-11-19T00:36:03-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>Char is a class. you need an instance of it first:

&lt;pre&gt;
  var char:Char = new Char();
&lt;/pre&gt;

After it you should add it to your stage or any other DisplayObjectContainer, which is somehow on the stage.
Do it in you Game Class.

Also, if you want use your Class Char as a MovieClip, you should extend MovieClip:

&lt;pre&gt;
  import flash.display.MovieClip;
  public class Char extends MovieClip {
&lt;/pre&gt;

Cause your Gun Class need a reference to your Char Instance, you should change your Gun into something like:

&lt;pre&gt;
  private var char:Char;
  public function Gun(char:Char) {
    this.char = char;
  }
&lt;/pre&gt;

That way you can access char from your Gun Class.

well... now back to your Game Class:

&lt;pre&gt;
  var char:Char = new Char();
  addChild(char);
  var gun:Gun = new Gun(char); // pass you char to the Gun Class
  addChild(gun);
&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;Char is a class. you need an instance of it first:&lt;/p&gt;
&lt;pre&gt;
  var char:Char = new Char();
&lt;/pre&gt;
&lt;p&gt;After it you should add it to your stage or any other DisplayObjectContainer, which is somehow on the stage.&lt;br /&gt;
Do it in you Game Class.&lt;/p&gt;
&lt;p&gt;Also, if you want use your Class Char as a MovieClip, you should extend MovieClip:&lt;/p&gt;
&lt;pre&gt;
  import flash.display.MovieClip;
  public class Char extends MovieClip {
&lt;/pre&gt;
&lt;p&gt;Cause your Gun Class need a reference to your Char Instance, you should change your Gun into something like:&lt;/p&gt;
&lt;pre&gt;
  private var char:Char;
  public function Gun(char:Char) {
    this.char = char;
  }
&lt;/pre&gt;
&lt;p&gt;That way you can access char from your Gun Class.&lt;/p&gt;
&lt;p&gt;well&amp;#8230; now back to your Game Class:&lt;/p&gt;
&lt;pre&gt;
  var char:Char = new Char();
  addChild(char);
  var gun:Gun = new Gun(char); // pass you char to the Gun Class
  addChild(gun);
&lt;/pre&gt;</body-html>
    <created-at type="datetime">2009-11-18T03:47:19-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1473490</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">65316</topic-id>
    <updated-at type="datetime">2009-11-18T03:47:19-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. How do I determine what number I need that to be? 

easiest way: save the biggest possible &quot;cookie&quot; and then look at the size of it. The size depends on the used language ( as2, as3), the name and the type of stored data. 

bq. How does that speed up progress?

It reserve the specifed space for the cookie. so it only sends one request to flash player. If the user set space to unlimited, you may not notice any speeddowns, but if the space is limited you won't ask for more space everytime you save.

bq. Can you give me a good example of that last function?

I made a class &quot;Settings&quot; with a function &lt;code&gt;readString(String):String&lt;/code&gt; and a function &lt;code&gt;writeString(String, String)&lt;/code&gt;.
This functions are static, so i don't need a pointer of Settings. If i want to read a value from the cookie, i just need to type this:

&lt;pre&gt;
  var foo:String = Settings.readString(&quot;foo&quot;);
&lt;/pre&gt;

It's shorter and better ( since you only open your cookie once ). You can access your cookie from your whole project.

bq. shared objects are stored in your appdata, which is hard to get to

just enter &lt;code&gt;%APPDATA%&lt;/code&gt; on any windows-machine.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;How do I determine what number I need that to be?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;easiest way: save the biggest possible &amp;#8220;cookie&amp;#8221; and then look at the size of it. The size depends on the used language ( as2, as3), the name and the type of stored data.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How does that speed up progress?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It reserve the specifed space for the cookie. so it only sends one request to flash player. If the user set space to unlimited, you may not notice any speeddowns, but if the space is limited you won&amp;#8217;t ask for more space everytime you save.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Can you give me a good example of that last function?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I made a class &amp;#8220;Settings&amp;#8221; with a function &lt;code&gt;readString(String):String&lt;/code&gt; and a function &lt;code&gt;writeString(String, String)&lt;/code&gt;.&lt;br /&gt;
This functions are static, so i don&amp;#8217;t need a pointer of Settings. If i want to read a value from the cookie, i just need to type this:&lt;/p&gt;
&lt;pre&gt;
  var foo:String = Settings.readString(&quot;foo&quot;);
&lt;/pre&gt;
&lt;p&gt;It&amp;#8217;s shorter and better ( since you only open your cookie once ). You can access your cookie from your whole project.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;shared objects are stored in your appdata, which is hard to get to&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;just enter &lt;code&gt;%APPDATA%&lt;/code&gt; on any windows-machine.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-18T03:35:47-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1473487</id>
    <post-number type="integer">6</post-number>
    <topic-id type="integer">65233</topic-id>
    <updated-at type="datetime">2009-11-18T03:35:47-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>you may add a number to flush:

&lt;pre&gt;
  so.flush(1024);
&lt;/pre&gt;

It could speed up the save progress.

Your code should work.

If you don't want to hardcode your names, you could use vars instead:

&lt;pre&gt;
var usr:String = &quot;username&quot;;
so.data[usr] = &quot;user1337&quot;;
&lt;/pre&gt;

That way you could make public functions to read your SharedObject.
Only open the SharedObject once in your class and use the function to access it:

&lt;pre&gt;
readString(name:String):String {
  return so.data[name];
}
&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;you may add a number to flush:&lt;/p&gt;
&lt;pre&gt;
  so.flush(1024);
&lt;/pre&gt;
&lt;p&gt;It could speed up the save progress.&lt;/p&gt;
&lt;p&gt;Your code should work.&lt;/p&gt;
&lt;p&gt;If you don&amp;#8217;t want to hardcode your names, you could use vars instead:&lt;/p&gt;
&lt;pre&gt;
var usr:String = &quot;username&quot;;
so.data[usr] = &quot;user1337&quot;;
&lt;/pre&gt;
&lt;p&gt;That way you could make public functions to read your SharedObject.&lt;br /&gt;
Only open the SharedObject once in your class and use the function to access it:&lt;/p&gt;
&lt;pre&gt;
readString(name:String):String {
  return so.data[name];
}
&lt;/pre&gt;</body-html>
    <created-at type="datetime">2009-11-17T12:55:04-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1471199</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">65233</topic-id>
    <updated-at type="datetime">2009-11-17T12:55:04-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>error:

&lt;pre&gt;
  else if (this.x &gt; 50 + Main.sBackground.x); {
&lt;/pre&gt;

remove the ; after the if condition.</body>
    <body-html>&lt;p&gt;error:&lt;/p&gt;
&lt;pre&gt;
  else if (this.x &amp;gt; 50 + Main.sBackground.x); {
&lt;/pre&gt;
&lt;p&gt;remove the ; after the if condition.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-17T12:46:18-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1471169</id>
    <post-number type="integer">7</post-number>
    <topic-id type="integer">64756</topic-id>
    <updated-at type="datetime">2009-11-17T12:46:18-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>you should check the list for a reference before you access it first.
Like Brain told you to, put the if before your loop.

&lt;pre&gt;if(FriendlyShip.list != null) {&lt;/pre&gt;

you could use instead:

&lt;pre&gt;if(FriendlyShip.list) {&lt;/pre&gt;

But the best way would be: don't delete your list, don't set it to null.
Instead, remove the objects from your list, so it would be empty.

btw: your code would only check the first ship in your list. 
If hitTest true, it takes damage. Else it just keep flying without check any other ships.</body>
    <body-html>&lt;p&gt;you should check the list for a reference before you access it first.&lt;br /&gt;
Like Brain told you to, put the if before your loop.&lt;/p&gt;
&lt;pre&gt;if(FriendlyShip.list != null) {&lt;/pre&gt;
&lt;p&gt;you could use instead:&lt;/p&gt;
&lt;pre&gt;if(FriendlyShip.list) {&lt;/pre&gt;
&lt;p&gt;But the best way would be: don&amp;#8217;t delete your list, don&amp;#8217;t set it to null.&lt;br /&gt;
Instead, remove the objects from your list, so it would be empty.&lt;/p&gt;
&lt;p&gt;btw: your code would only check the first ship in your list. &lt;br /&gt;
If hitTest true, it takes damage. Else it just keep flying without check any other ships.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-14T12:58:47-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1460124</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">64756</topic-id>
    <updated-at type="datetime">2009-11-14T12:58:47-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href='/forums/4/topics/64059?page=1#posts-1444219'&gt;Moonkey&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;Instead of casting directly like that, I find it better to use the &lt;code&gt;as&lt;/code&gt; operator. If casting fails using &lt;code&gt;as&lt;/code&gt;, it returns null instead of throwing an error.&lt;/p&gt;
&lt;/p&gt;&lt;/blockquote&gt;

I prefer to use the &lt;code&gt;is&lt;/code&gt; operator. 
Just check if you match the class before you try to cast it.

&lt;pre&gt;
if (evt.target is ToggleButton) {
  var tb:ToggleButton = evt.target as ToggleButton;
  tb.addToolTip(tb.parent.mouseX, tb.parent.mouseY);
}
&lt;/pre&gt;

&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href='/forums/4/topics/64059?page=1#posts-1443967'&gt;KMAE&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;
&lt;p&gt;Edit: maybe I should be trying to add it to the parent?&lt;/p&gt;&lt;/blockquote&gt;

That could also solve your error.
Another way would be to make the tooltip &quot;invisible&quot; for the mouse, so it wont launch any MouseOver Events.

&lt;pre&gt;
  toolT.mouseEnabled = false;
  toolT.mouseChildren = false;
&lt;/pre&gt;

You need to execute it only once. ( put it into your constructor of the tooltip )</body>
    <body-html>&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href=&quot;/forums/4/topics/64059?page=1#posts-1444219&quot;&gt;Moonkey&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;Instead of casting directly like that, I find it better to use the &lt;code&gt;as&lt;/code&gt; operator. If casting fails using &lt;code&gt;as&lt;/code&gt;, it returns null instead of throwing an error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;I prefer to use the &lt;code&gt;is&lt;/code&gt; operator. &lt;br /&gt;
Just check if you match the class before you try to cast it.&lt;/p&gt;
&lt;pre&gt;
if (evt.target is ToggleButton) {
  var tb:ToggleButton = evt.target as ToggleButton;
  tb.addToolTip(tb.parent.mouseX, tb.parent.mouseY);
}
&lt;/pre&gt;
&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href=&quot;/forums/4/topics/64059?page=1#posts-1443967&quot;&gt;&lt;span class=&quot;caps&quot;&gt;KMAE&lt;/span&gt;&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;br /&gt;
&lt;p&gt;Edit: maybe I should be trying to add it to the parent?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;That could also solve your error.&lt;br /&gt;
Another way would be to make the tooltip &amp;#8220;invisible&amp;#8221; for the mouse, so it wont launch any MouseOver Events.&lt;/p&gt;
&lt;pre&gt;
  toolT.mouseEnabled = false;
  toolT.mouseChildren = false;
&lt;/pre&gt;
&lt;p&gt;You need to execute it only once. ( put it into your constructor of the tooltip )&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-09T12:46:02-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1445363</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">64059</topic-id>
    <updated-at type="datetime">2009-11-09T12:46:15-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>&lt;pre&gt;
emptyBottleBtn:ToggleButton = new ToggleButton();
&lt;/pre&gt;

If you want to define a new var, you should put the keyword var in front of it.
Else, remove the :ToggleButton part.

choose one of them:

&lt;pre&gt;
emptyBottleBtn= new ToggleButton();
var emptyBottleBtn:ToggleButton = new ToggleButton();
&lt;/pre&gt;</body>
    <body-html>&lt;pre&gt;
emptyBottleBtn:ToggleButton = new ToggleButton();
&lt;/pre&gt;
&lt;p&gt;If you want to define a new var, you should put the keyword var in front of it.&lt;br /&gt;
Else, remove the :ToggleButton part.&lt;/p&gt;
&lt;p&gt;choose one of them:&lt;/p&gt;
&lt;pre&gt;
emptyBottleBtn= new ToggleButton();
var emptyBottleBtn:ToggleButton = new ToggleButton();
&lt;/pre&gt;</body-html>
    <created-at type="datetime">2009-11-07T13:03:02-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1438710</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">63812</topic-id>
    <updated-at type="datetime">2009-11-07T13:03:02-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href='/forums/7/topics/63578?page=1#posts-1433569'&gt;UltimateChaos&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;The Card isn&amp;#8217;t checking either&lt;/p&gt;&lt;/blockquote&gt;

same here. finished 2 missions, still need 5 more.

&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href='/forums/7/topics/63578?page=1#posts-1433374'&gt;Protoblob&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;I finished Mission 1 on hard but the box doesn&amp;#8217;t check.&lt;/p&gt;&lt;/blockquote&gt;

finished mission2 on hard. box doesn't check.</body>
    <body-html>&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href=&quot;/forums/7/topics/63578?page=1#posts-1433569&quot;&gt;UltimateChaos&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;The Card isn&amp;#8217;t checking either&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;same here. finished 2 missions, still need 5 more.&lt;/p&gt;
&lt;blockquote&gt;&lt;cite&gt;Originally posted by &lt;b&gt;&lt;a href=&quot;/forums/7/topics/63578?page=1#posts-1433374&quot;&gt;Protoblob&lt;/a&gt;:&lt;/b&gt;&lt;/cite&gt;&lt;br&gt;&lt;p&gt;I finished Mission 1 on hard but the box doesn&amp;#8217;t check.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;finished mission2 on hard. box doesn&amp;#8217;t check.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-06T02:41:47-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">7</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1434448</id>
    <post-number type="integer">7</post-number>
    <topic-id type="integer">63578</topic-id>
    <updated-at type="datetime">2009-11-06T02:41:47-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. At the moment I&#8217;ve simplified it by taking out the inventory and just having multiple instances of one object

You won't have the error, if you would keep only one instance of your objects and move them between the room and the inventory.

bq. event.currentTarget.visible = false;

don't set it to invisible. REMOVE it from your Stage. If it invisible it could still listen to Click Events. (had that issue in my mingames)

But back to your question...

bq. I&#8217;m looking for a catchall [...] so that I can just have one eventListener for all my objects

You could add your EventListener in the container, which stores all your items.
If you add the EventListener to this container, then currentTarget would be the container.
So add the Listener from container to every item with the same callback function.</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;At the moment I&#8217;ve simplified it by taking out the inventory and just having multiple instances of one object&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You won&amp;#8217;t have the error, if you would keep only one instance of your objects and move them between the room and the inventory.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;event.currentTarget.visible = false;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;don&amp;#8217;t set it to invisible. &lt;span class=&quot;caps&quot;&gt;REMOVE&lt;/span&gt; it from your Stage. If it invisible it could still listen to Click Events. (had that issue in my mingames)&lt;/p&gt;
&lt;p&gt;But back to your question&amp;#8230;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I&#8217;m looking for a catchall [&amp;#8230;] so that I can just have one eventListener for all my objects&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You could add your EventListener in the container, which stores all your items.&lt;br /&gt;
If you add the EventListener to this container, then currentTarget would be the container.&lt;br /&gt;
So add the Listener from container to every item with the same callback function.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-11-03T13:22:42-08:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1428680</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">63300</topic-id>
    <updated-at type="datetime">2009-11-03T13:22:42-08:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>you need to initialize it too.

&lt;pre&gt;
  addEventListener(Event.ENTER_FRAME, onEnterFrame);
&lt;/pre&gt;

best to put into the constructor of your class.
But you can try to put it in the timeline too.

Also you need an Textfield with the instancename textfield to work my example.</body>
    <body-html>&lt;p&gt;you need to initialize it too.&lt;/p&gt;
&lt;pre&gt;
  addEventListener(Event.ENTER_FRAME, onEnterFrame);
&lt;/pre&gt;
&lt;p&gt;best to put into the constructor of your class.&lt;br /&gt;
But you can try to put it in the timeline too.&lt;/p&gt;
&lt;p&gt;Also you need an Textfield with the instancename textfield to work my example.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-30T09:28:37-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1418003</id>
    <post-number type="integer">4</post-number>
    <topic-id type="integer">62852</topic-id>
    <updated-at type="datetime">2009-10-30T09:28:37-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>language?

&lt;pre&gt;
var cnt:int = 90;


function onEnterFrame(e:Event):void {
  cnt--;
  textfield.text = &quot;Ticks left: &quot; + cnt;

  if (cnt &lt;= 0) {
    // do something
  }
}
&lt;/pre&gt;

well, you need to assign that function to ENTER_FRAME. It's just an example. Work with it.</body>
    <body-html>&lt;p&gt;language?&lt;/p&gt;
&lt;pre&gt;
var cnt:int = 90;


function onEnterFrame(e:Event):void {
  cnt--;
  textfield.text = &quot;Ticks left: &quot; + cnt;

  if (cnt &amp;lt;= 0) {
    // do something
  }
}
&lt;/pre&gt;
&lt;p&gt;well, you need to assign that function to ENTER_FRAME. It&amp;#8217;s just an example. Work with it.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-30T07:38:36-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1417924</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">62852</topic-id>
    <updated-at type="datetime">2009-10-30T07:38:36-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>bq. The fault i get is that its trying to access something thats null.

on what line?
What DisplayObjects do you have in your preloader?

i would change your done function into this:

&lt;pre&gt;
function done(e:Event)
{
	stage.addChild(myLoader);
	stage.removeChild(this);
}
&lt;/pre&gt;

It's important to FIRST add the loaded content and then remove the preloader. Else you will lose the stage reference.

What is percent? Did you define and initialize it?</body>
    <body-html>&lt;blockquote&gt;
&lt;p&gt;The fault i get is that its trying to access something thats null.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;on what line?&lt;br /&gt;
What DisplayObjects do you have in your preloader?&lt;/p&gt;
&lt;p&gt;i would change your done function into this:&lt;/p&gt;
&lt;pre&gt;
function done(e:Event)
{
	stage.addChild(myLoader);
	stage.removeChild(this);
}
&lt;/pre&gt;
&lt;p&gt;It&amp;#8217;s important to &lt;span class=&quot;caps&quot;&gt;FIRST&lt;/span&gt; add the loaded content and then remove the preloader. Else you will lose the stage reference.&lt;/p&gt;
&lt;p&gt;What is percent? Did you define and initialize it?&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-28T11:01:31-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1413123</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">62617</topic-id>
    <updated-at type="datetime">2009-10-28T11:02:20-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>google for 'as3 livedocs'. You will find anything about as3 there.
With plugIns like OpenTheDoc you can read the livedocs offline from FD.</body>
    <body-html>&lt;p&gt;google for &amp;#8216;as3 livedocs&amp;#8217;. You will find anything about as3 there.&lt;br /&gt;
With plugIns like OpenTheDoc you can read the livedocs offline from FD.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-25T14:42:59-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1405194</id>
    <post-number type="integer">5</post-number>
    <topic-id type="integer">58395</topic-id>
    <updated-at type="datetime">2009-10-25T14:42:59-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>not 50 different stats. it means, that at least 50 player should submit any stat.</body>
    <body-html>&lt;p&gt;not 50 different stats. it means, that at least 50 player should submit any stat.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-24T01:57:39-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1400257</id>
    <post-number type="integer">5</post-number>
    <topic-id type="integer">61790</topic-id>
    <updated-at type="datetime">2009-10-24T01:57:39-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>are you talking about filesize or RAM use?</body>
    <body-html>&lt;p&gt;are you talking about filesize or &lt;span class=&quot;caps&quot;&gt;RAM&lt;/span&gt; use?&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-20T14:22:26-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1390101</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">61560</topic-id>
    <updated-at type="datetime">2009-10-20T14:22:26-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>zero, if you remove the ! you should swap the else statement.

n00b, in the first hitTest, you should use y+r:

&lt;pre&gt;
 if (!_root.ground.hitTest(_x, _y+r, true)) 
&lt;/pre&gt;

Your jumpheight should be less then the strenght of your ground.
Else it could fall through your ground between the frames you do the hitTest.

oh... and use &lt; PRE &gt; Tags.</body>
    <body-html>&lt;p&gt;zero, if you remove the ! you should swap the else statement.&lt;/p&gt;
&lt;p&gt;n00b, in the first hitTest, you should use y+r:&lt;/p&gt;
&lt;pre&gt;
 if (!_root.ground.hitTest(_x, _y+r, true)) 
&lt;/pre&gt;
&lt;p&gt;Your jumpheight should be less then the strenght of your ground.&lt;br /&gt;
Else it could fall through your ground between the frames you do the hitTest.&lt;/p&gt;
&lt;p&gt;oh&amp;#8230; and use &amp;lt; &lt;span class=&quot;caps&quot;&gt;PRE&lt;/span&gt; &amp;gt; Tags.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-19T05:10:03-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1385687</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">61397</topic-id>
    <updated-at type="datetime">2009-10-19T05:10:03-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
  <post>
    <body>4gb are not that much of ram.

Do you have 32 or 64bit?
How much virtual memory?

Also, i would not put ALL drawings in one single file.
If you want them to split, copy the file and delete from it the duplicate drawings.</body>
    <body-html>&lt;p&gt;4gb are not that much of ram.&lt;/p&gt;
&lt;p&gt;Do you have 32 or 64bit?&lt;br /&gt;
How much virtual memory?&lt;/p&gt;
&lt;p&gt;Also, i would not put &lt;span class=&quot;caps&quot;&gt;ALL&lt;/span&gt; drawings in one single file.&lt;br /&gt;
If you want them to split, copy the file and delete from it the duplicate drawings.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-10-19T04:54:34-07:00</created-at>
    <flaggings-count type="integer">0</flaggings-count>
    <forced-visibility-state type="boolean">true</forced-visibility-state>
    <forum-id type="integer">4</forum-id>
    <hidden-by-id type="integer" nil="true"></hidden-by-id>
    <id type="integer">1385670</id>
    <post-number type="integer">2</post-number>
    <topic-id type="integer">61396</topic-id>
    <updated-at type="datetime">2009-10-19T04:54:34-07:00</updated-at>
    <user-id type="integer">183841</user-id>
  </post>
</posts>
