<?xml version="1.0" encoding="UTF-8"?>
<posts type="array">
  <post>
    <body>Thanks for the tips--I am going to try the stopPropagation(), but I can see a good case for switching over to the MOUSE_UP/MOUSE_DOWN approach in general.</body>
    <body-html>&lt;p&gt;Thanks for the tips&amp;#8212;I am going to try the stopPropagation(), but I can see a good case for switching over to the MOUSE_UP/MOUSE_DOWN approach in general.&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-12-14T16:05:40-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">578963</id>
    <post-number type="integer">7</post-number>
    <topic-id type="integer">29034</topic-id>
    <updated-at type="datetime">2009-09-17T01:36:57-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>I have used that.  What I mean is that the initial CLICK event triggers a function that installs a new CLICK listener on the next screen.

With a single click, however, both listeners end up firing.

SCREEN1: mouse click listener takes user to screen2
SCREEN2: mouse click listener takes user to screen3

One click is causing the movie to go from SCREEN1 to SCREEN3.</body>
    <body-html>&lt;p&gt;I have used that.  What I mean is that the initial &lt;span class=&quot;caps&quot;&gt;CLICK&lt;/span&gt; event triggers a function that installs a new &lt;span class=&quot;caps&quot;&gt;CLICK&lt;/span&gt; listener on the next screen.&lt;/p&gt;
&lt;p&gt;With a single click, however, both listeners end up firing.&lt;/p&gt;
&lt;p&gt;SCREEN1: mouse click listener takes user to screen2&lt;br /&gt;
SCREEN2: mouse click listener takes user to screen3&lt;/p&gt;
&lt;p&gt;One click is causing the movie to go from SCREEN1 to SCREEN3.&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-12-10T12:46:59-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">570280</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">29034</topic-id>
    <updated-at type="datetime">2009-09-17T01:36:57-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>Is there a way to clear an event or otherwise notify flash that it's been handled already?

One problem I'm running into is the following:

From the main menu, a single click takes the user to the instructions screen.
Once on that screen, a click takes the user back to the menu.

However, the problem I'm having is that a single click quickly shows and then hides the instructions instantly.  I think this is because both mouse click listeners are firing from the same click.  Things are set up like this:

1) add an event listener for mouse click on the main menu
2) on click, the instructions image is shown.  the old click listener is removed and a new listener is added.
3) the new listener is supposed to dismiss the image and restore the original listener.

When the user clicks, both listeners trigger.  Is there an easy way to avoid this?

So far, I just have been using a timer that delays creating the second listener for a couple frames so there is no chance the single click will register twice.

Any tips appreciated...</body>
    <body-html>&lt;p&gt;Is there a way to clear an event or otherwise notify flash that it&amp;#8217;s been handled already?&lt;/p&gt;
&lt;p&gt;One problem I&amp;#8217;m running into is the following:&lt;/p&gt;
&lt;p&gt;From the main menu, a single click takes the user to the instructions screen.&lt;br /&gt;
Once on that screen, a click takes the user back to the menu.&lt;/p&gt;
&lt;p&gt;However, the problem I&amp;#8217;m having is that a single click quickly shows and then hides the instructions instantly.  I think this is because both mouse click listeners are firing from the same click.  Things are set up like this:&lt;/p&gt;
&lt;p&gt;1) add an event listener for mouse click on the main menu&lt;br /&gt;
2) on click, the instructions image is shown.  the old click listener is removed and a new listener is added.&lt;br /&gt;
3) the new listener is supposed to dismiss the image and restore the original listener.&lt;/p&gt;
&lt;p&gt;When the user clicks, both listeners trigger.  Is there an easy way to avoid this?&lt;/p&gt;
&lt;p&gt;So far, I just have been using a timer that delays creating the second listener for a couple frames so there is no chance the single click will register twice.&lt;/p&gt;
&lt;p&gt;Any tips appreciated&amp;#8230;&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-12-10T11:34:36-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">570138</id>
    <post-number type="integer">1</post-number>
    <topic-id type="integer">29034</topic-id>
    <updated-at type="datetime">2009-09-17T01:36:56-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>This question feels a bit newB, but I have to ask it anyway.

Say I have a game object with multiple animations:
--idle
--get hit
--die
--attack
--etc.

What is the best way to deal with this in AS3?  Several solutions come to mind, but I feel like I might be missing the easiest/obvious one:

Option A) Have all animations loaded into one movie clip and control what plays just by controlling the movie clip playhead

Option B) Have separate movie clips for each animation.  Whenever the game object status changes, destroy any current movie clip that is playing an instantiate the proper one. (e.g delete IDLE mc and spawn a new GETHIT mc)

Option C) Have separate movie clips for each animation.  Create one parent mc for the game object, and create movie clip instances of each anim that will be children to this parent.  Control visibility of all child clips base upon status of the game object.  (e.g. make everything invisibile but IDLE)

Down sides of all these:
A) lots of frame jockeying/maintenance
B) maybe the best?
C) will have lots of invisible movie clips hanging around

Am I missing an obvious solution?

--NeoClassic</body>
    <body-html>&lt;p&gt;This question feels a bit newB, but I have to ask it anyway.&lt;/p&gt;
&lt;p&gt;Say I have a game object with multiple animations:&lt;br /&gt;
&amp;#8212;idle&lt;br /&gt;
&amp;#8212;get hit&lt;br /&gt;
&amp;#8212;die&lt;br /&gt;
&amp;#8212;attack&lt;br /&gt;
&amp;#8212;etc.&lt;/p&gt;
&lt;p&gt;What is the best way to deal with this in AS3?  Several solutions come to mind, but I feel like I might be missing the easiest/obvious one:&lt;/p&gt;
&lt;p&gt;Option A) Have all animations loaded into one movie clip and control what plays just by controlling the movie clip playhead&lt;/p&gt;
&lt;p&gt;Option B) Have separate movie clips for each animation.  Whenever the game object status changes, destroy any current movie clip that is playing an instantiate the proper one. (e.g delete &lt;span class=&quot;caps&quot;&gt;IDLE&lt;/span&gt; mc and spawn a new &lt;span class=&quot;caps&quot;&gt;GETHIT&lt;/span&gt; mc)&lt;/p&gt;
&lt;p&gt;Option C) Have separate movie clips for each animation.  Create one parent mc for the game object, and create movie clip instances of each anim that will be children to this parent.  Control visibility of all child clips base upon status of the game object.  (e.g. make everything invisibile but &lt;span class=&quot;caps&quot;&gt;IDLE&lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;Down sides of all these:&lt;br /&gt;
A) lots of frame jockeying/maintenance&lt;br /&gt;
B) maybe the best?&lt;br /&gt;
C) will have lots of invisible movie clips hanging around&lt;/p&gt;
&lt;p&gt;Am I missing an obvious solution?&lt;/p&gt;
&lt;p&gt;&amp;#8212;NeoClassic&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-11-18T14:32: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">530282</id>
    <post-number type="integer">1</post-number>
    <topic-id type="integer">27163</topic-id>
    <updated-at type="datetime">2009-09-17T01:27:09-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>I can instantiate them easily enough but for level design, placing them on stage is easier.

I just found a solution although I'm still wondering if there is a fast/easy way to count # of instances of an object.

The solution I'm using was something Gary Rosenzweig used in one of his examples from his book.  Basically, you have a ExamineLeve() function that runs upon startup.  You loop through the display objects and count how many are of the specified type.  This allows you to place manually on the stage if you wish but still do an accounting for them.

I miss GameMaker's instance_number(treasure)!</body>
    <body-html>&lt;p&gt;I can instantiate them easily enough but for level design, placing them on stage is easier.&lt;/p&gt;
&lt;p&gt;I just found a solution although I&amp;#8217;m still wondering if there is a fast/easy way to count # of instances of an object.&lt;/p&gt;
&lt;p&gt;The solution I&amp;#8217;m using was something Gary Rosenzweig used in one of his examples from his book.  Basically, you have a ExamineLeve() function that runs upon startup.  You loop through the display objects and count how many are of the specified type.  This allows you to place manually on the stage if you wish but still do an accounting for them.&lt;/p&gt;
&lt;p&gt;I miss GameMaker&amp;#8217;s instance_number(treasure)!&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-10-27T17:53:16-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">492401</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">25091</topic-id>
    <updated-at type="datetime">2009-09-17T01:17:32-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>Is there an easy way to count # of instances of a particular object (movie clip)? And also iterate through them?

E.g. 
In the game I'm prototyping I have a treasure pickup Movie Clip.  I've placed a couple dozen of them on the stage.  As the player flies around the level, I want to detect whether he's colliding with any one of these Movie Clips.  If so, I will resolve the pickup.

I plan on just doing a loop but I need to know how to count the # of instances dynamically and also how to iterate through them.

Thanks for any tips,

--NeoClassic</body>
    <body-html>&lt;p&gt;Is there an easy way to count # of instances of a particular object (movie clip)? And also iterate through them?&lt;/p&gt;
&lt;p&gt;E.g. &lt;br /&gt;
In the game I&amp;#8217;m prototyping I have a treasure pickup Movie Clip.  I&amp;#8217;ve placed a couple dozen of them on the stage.  As the player flies around the level, I want to detect whether he&amp;#8217;s colliding with any one of these Movie Clips.  If so, I will resolve the pickup.&lt;/p&gt;
&lt;p&gt;I plan on just doing a loop but I need to know how to count the # of instances dynamically and also how to iterate through them.&lt;/p&gt;
&lt;p&gt;Thanks for any tips,&lt;/p&gt;
&lt;p&gt;&amp;#8212;NeoClassic&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-10-27T16:38:08-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">492136</id>
    <post-number type="integer">1</post-number>
    <topic-id type="integer">25091</topic-id>
    <updated-at type="datetime">2009-09-17T01:17:32-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>Thanks for the tips--both are interesting.  I feel slightly better that it isn't something obvious I missed, but slightly worse that it's not straightforward to reference stage vector geometry. :)

--Tyler</body>
    <body-html>&lt;p&gt;Thanks for the tips&amp;#8212;both are interesting.  I feel slightly better that it isn&amp;#8217;t something obvious I missed, but slightly worse that it&amp;#8217;s not straightforward to reference stage vector geometry. :)&lt;/p&gt;
&lt;p&gt;&amp;#8212;Tyler&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-10-02T22:12: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">443551</id>
    <post-number type="integer">3</post-number>
    <topic-id type="integer">22314</topic-id>
    <updated-at type="datetime">2009-09-17T01:03:56-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
  <post>
    <body>(Using AS3)

I would like to use the pen tool to draw vector lines directly on the stage, and then reference the points that define those lines within actionscript.  Is this possible?

For example, I would use the pen tool to draw a series of lines between (0,0)(100,0)(100,100)(0,100) and back to (0,0). This would form a rectangular area bounded by four lines.  In actionscript, I want to use those lines for collision detection.

I know that I can recreate the lines in actionscript, but I am looking to use the normal Flash UI and stage as a sort of level editor.  Easier to adjust line positions on the stage than editing coordinates in AS.

Any tips appreciated.

--Tyler</body>
    <body-html>&lt;p&gt;(Using AS3)&lt;/p&gt;
&lt;p&gt;I would like to use the pen tool to draw vector lines directly on the stage, and then reference the points that define those lines within actionscript.  Is this possible?&lt;/p&gt;
&lt;p&gt;For example, I would use the pen tool to draw a series of lines between (0,0)(100,0)(100,100)(0,100) and back to (0,0). This would form a rectangular area bounded by four lines.  In actionscript, I want to use those lines for collision detection.&lt;/p&gt;
&lt;p&gt;I know that I can recreate the lines in actionscript, but I am looking to use the normal Flash UI and stage as a sort of level editor.  Easier to adjust line positions on the stage than editing coordinates in AS.&lt;/p&gt;
&lt;p&gt;Any tips appreciated.&lt;/p&gt;
&lt;p&gt;&amp;#8212;Tyler&lt;/p&gt;</body-html>
    <created-at type="datetime">2008-09-30T14:53:10-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">437983</id>
    <post-number type="integer">1</post-number>
    <topic-id type="integer">22314</topic-id>
    <updated-at type="datetime">2009-09-17T01:03:56-07:00</updated-at>
    <user-id type="integer">822010</user-id>
  </post>
</posts>
