<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: AS3 Flash Games for Beginners: Level Mechanics and Animated Backgrounds</title>
	<atom:link href="http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/feed" rel="self" type="application/rss+xml" />
	<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds</link>
	<description>Learn to Make Flash Games, Applications, and Websites</description>
	<pubDate>Fri, 12 Mar 2010 13:13:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gary</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4787</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Tue, 09 Mar 2010 00:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4787</guid>
		<description>Hi,

This is a great tutorial.  I was wondering if the code for the Starfield background can be modified to look like a 1st person point of view?  In otherwords, we are traveling towards the stars and the stars are zooming past us?

This is terrific.  Thanks very much.

Best,
Gary</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is a great tutorial.  I was wondering if the code for the Starfield background can be modified to look like a 1st person point of view?  In otherwords, we are traveling towards the stars and the stars are zooming past us?</p>
<p>This is terrific.  Thanks very much.</p>
<p>Best,<br />
Gary</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniël</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4726</link>
		<dc:creator>Daniël</dc:creator>
		<pubDate>Thu, 28 Jan 2010 10:47:57 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4726</guid>
		<description>Here, Daniël here.
I have the same problem as mikehart, getting an 1136 error..
Even after I compared all the codes written by me with the final .zip of this tut, I cant find it.

The only thing I have "customized", is the player code to get a smaller boundary for the ship to fly in.
Its really weird and frustrating to still get the message
"1136: Incorrect number of arguments.  Expected 0."

Can anybody help me?</description>
		<content:encoded><![CDATA[<p>Here, Daniël here.<br />
I have the same problem as mikehart, getting an 1136 error..<br />
Even after I compared all the codes written by me with the final .zip of this tut, I cant find it.</p>
<p>The only thing I have &#8220;customized&#8221;, is the player code to get a smaller boundary for the ship to fly in.<br />
Its really weird and frustrating to still get the message<br />
&#8220;1136: Incorrect number of arguments.  Expected 0.&#8221;</p>
<p>Can anybody help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cnicoletti</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4723</link>
		<dc:creator>cnicoletti</dc:creator>
		<pubDate>Wed, 27 Jan 2010 20:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4723</guid>
		<description>First let me start off by saying how cool this is!

Anyway, I have setup the stars and they are flowing rather well.

My question is, how do you get them to stop?

removeChild? If so, How does that work with multiple stars on stage at once?</description>
		<content:encoded><![CDATA[<p>First let me start off by saying how cool this is!</p>
<p>Anyway, I have setup the stars and they are flowing rather well.</p>
<p>My question is, how do you get them to stop?</p>
<p>removeChild? If so, How does that work with multiple stars on stage at once?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Unsafe Creations</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4719</link>
		<dc:creator>Unsafe Creations</dc:creator>
		<pubDate>Sun, 24 Jan 2010 04:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4719</guid>
		<description>In case anyone was having touble with johno's problem...(Just posting this because it took me like 30 minutes to figure out...I might just be dumb, though)

If you want the Stars to go from left to right, use MrKrackham's example above. If you want them to go from right to left, and your stars aren't respawning, and if you're an AS noob like me, here's the problems.

public function setupLine(randomizeX:Boolean = false) : void
{
//inline conditional, looks complicated but it's not.
x = randomizeX ? Math.random()*stageRef.stageWidth : 750; **has to be 750, this is where they respawn**
y = Math.random()*stageRef.stageHeight;
alpha = Math.random();
scaleX = Math.random();
scaleY = Math.random();
 
speed = 2 + Math.random()*2;
}
 
public function loop(e:Event) : void
{
x -= speed; ****has to be a minus sign, so they go left****
 
if (x &#60; 0) ****this is where it got. don't know why. it just did.****
setupLine();
 
}
 
}
}</description>
		<content:encoded><![CDATA[<p>In case anyone was having touble with johno&#8217;s problem&#8230;(Just posting this because it took me like 30 minutes to figure out&#8230;I might just be dumb, though)</p>
<p>If you want the Stars to go from left to right, use MrKrackham&#8217;s example above. If you want them to go from right to left, and your stars aren&#8217;t respawning, and if you&#8217;re an AS noob like me, here&#8217;s the problems.</p>
<p>public function setupLine(randomizeX:Boolean = false) : void<br />
{<br />
//inline conditional, looks complicated but it&#8217;s not.<br />
x = randomizeX ? Math.random()*stageRef.stageWidth : 750; **has to be 750, this is where they respawn**<br />
y = Math.random()*stageRef.stageHeight;<br />
alpha = Math.random();<br />
scaleX = Math.random();<br />
scaleY = Math.random();</p>
<p>speed = 2 + Math.random()*2;<br />
}</p>
<p>public function loop(e:Event) : void<br />
{<br />
x -= speed; ****has to be a minus sign, so they go left****</p>
<p>if (x &lt; 0) ****this is where it got. don&#8217;t know why. it just did.****<br />
setupLine();</p>
<p>}</p>
<p>}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikehart</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4696</link>
		<dc:creator>mikehart</dc:creator>
		<pubDate>Mon, 28 Dec 2009 02:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4696</guid>
		<description>I'm getting a strange error when I try to compile. its on the line in the for loop

1136:Incorrect number of arguments.  Expected 0.</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting a strange error when I try to compile. its on the line in the for loop</p>
<p>1136:Incorrect number of arguments.  Expected 0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ollie</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4692</link>
		<dc:creator>Ollie</dc:creator>
		<pubDate>Mon, 21 Dec 2009 22:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4692</guid>
		<description>Yes, I have the same problem as johno. I can't get the stars to be reproduced when having them scroll horizontally.</description>
		<content:encoded><![CDATA[<p>Yes, I have the same problem as johno. I can&#8217;t get the stars to be reproduced when having them scroll horizontally.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrKrackham</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4629</link>
		<dc:creator>MrKrackham</dc:creator>
		<pubDate>Wed, 09 Dec 2009 16:09:37 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4629</guid>
		<description>@johno

I tried doing that too. Just switch all occurrences of WidthHeight, xy and randomizeYrandomizeX. Seemed to work fine :)

package com.asgamer.basics1
{
  import flash.display.MovieClip;
  import flash.display.Stage;
  import flash.events.Event;
 
  public class Star extends MovieClip
  {
    private var stageRef:Stage;
    private var speed:Number;
 
    public function Star(stageRef:Stage)
    {
      this.stageRef = stageRef;
      setupStar(true);
 
      addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
    }
 
    public function setupStar(randomizeX:Boolean = false) : void
    {
      //inline conditional, looks complicated but it's not.
      x = randomizeX ? Math.random()*stageRef.stageWidth : 0;
      y = Math.random()*stageRef.stageHeight;
      alpha = Math.random();
      rotation = Math.random()*360;
      scaleY = Math.random();
      scaleX = Math.random();
 
      speed = 2 + Math.random()*2;
    }
 
    public function loop(e:Event) : void
    {
      x += speed;
 
      if (x &#62; stageRef.stageWidth)
        setupStar();
    }
  }
}</description>
		<content:encoded><![CDATA[<p>@johno</p>
<p>I tried doing that too. Just switch all occurrences of WidthHeight, xy and randomizeYrandomizeX. Seemed to work fine <img src='http://asgamer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>package com.asgamer.basics1<br />
{<br />
  import flash.display.MovieClip;<br />
  import flash.display.Stage;<br />
  import flash.events.Event;</p>
<p>  public class Star extends MovieClip<br />
  {<br />
    private var stageRef:Stage;<br />
    private var speed:Number;</p>
<p>    public function Star(stageRef:Stage)<br />
    {<br />
      this.stageRef = stageRef;<br />
      setupStar(true);</p>
<p>      addEventListener(Event.ENTER_FRAME, loop, false, 0, true);<br />
    }</p>
<p>    public function setupStar(randomizeX:Boolean = false) : void<br />
    {<br />
      //inline conditional, looks complicated but it&#8217;s not.<br />
      x = randomizeX ? Math.random()*stageRef.stageWidth : 0;<br />
      y = Math.random()*stageRef.stageHeight;<br />
      alpha = Math.random();<br />
      rotation = Math.random()*360;<br />
      scaleY = Math.random();<br />
      scaleX = Math.random();</p>
<p>      speed = 2 + Math.random()*2;<br />
    }</p>
<p>    public function loop(e:Event) : void<br />
    {<br />
      x += speed;</p>
<p>      if (x &gt; stageRef.stageWidth)<br />
        setupStar();<br />
    }<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: johno</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4601</link>
		<dc:creator>johno</dc:creator>
		<pubDate>Sat, 28 Nov 2009 18:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4601</guid>
		<description>Hi, im trying to get the stars to go from right to left iv managed to do this fairly easily but once the first wave appears no more come i have managed to make the stars go left to right fine but cant seem to get them to carry on producing from the right to left any ideas?</description>
		<content:encoded><![CDATA[<p>Hi, im trying to get the stars to go from right to left iv managed to do this fairly easily but once the first wave appears no more come i have managed to make the stars go left to right fine but cant seem to get them to carry on producing from the right to left any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emb03</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4594</link>
		<dc:creator>emb03</dc:creator>
		<pubDate>Fri, 20 Nov 2009 20:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4594</guid>
		<description>@memyselfandmetoo

I am having this issue. You said it was easy, but how did you get the background to stop panning at the edge of the stage?

Thanks!</description>
		<content:encoded><![CDATA[<p>@memyselfandmetoo</p>
<p>I am having this issue. You said it was easy, but how did you get the background to stop panning at the edge of the stage?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aceofspadez619</title>
		<link>http://asgamer.com/2009/as3-flash-games-for-beginners-level-mechanics-and-animated-backgrounds/comment-page-1#comment-4536</link>
		<dc:creator>aceofspadez619</dc:creator>
		<pubDate>Thu, 17 Sep 2009 22:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://asgamer.com/?p=105#comment-4536</guid>
		<description>...adding to my previous post.

In some ways answered my own question.  I forgot that I had added the background to the stage at runtime as you had suggested in Step one, so when I copied your code into my Engine.as file, I lost the background!  I had forgot what I had done so at first I tried this (I have a Background.as file with an empty constructor function, which i'm guessing is all that's needed since the background does nothing):

//add background to the stage
stage.addChild(new Background());

which brought back my background, but (as I'm sure you know) no stars!!  I guessed they were covered up, so I used the addChildAt to set the level to 0:

//add background to the stage
stage.addChildAt(new Background(), 0);

and my stars are back!  So I'm guessing this displayList number corresponds to the "level" of the object, similar to the layer list on the timeline (objects in layers above cover up objects below)?</description>
		<content:encoded><![CDATA[<p>&#8230;adding to my previous post.</p>
<p>In some ways answered my own question.  I forgot that I had added the background to the stage at runtime as you had suggested in Step one, so when I copied your code into my Engine.as file, I lost the background!  I had forgot what I had done so at first I tried this (I have a Background.as file with an empty constructor function, which i&#8217;m guessing is all that&#8217;s needed since the background does nothing):</p>
<p>//add background to the stage<br />
stage.addChild(new Background());</p>
<p>which brought back my background, but (as I&#8217;m sure you know) no stars!!  I guessed they were covered up, so I used the addChildAt to set the level to 0:</p>
<p>//add background to the stage<br />
stage.addChildAt(new Background(), 0);</p>
<p>and my stars are back!  So I&#8217;m guessing this displayList number corresponds to the &#8220;level&#8221; of the object, similar to the layer list on the timeline (objects in layers above cover up objects below)?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
