Author Topic: Hello World Help??  (Read 965 times)

zxz1661

  • Member
  • **
  • Posts: 62
  • Karma: +0/-0
  • Full of Fail
    • View Profile
Hello World Help??
« on: Thu, Jul 1, 2010 »
I really need help---and bear with me as this is my first post---this is the error that i came up with.
I am using FlashDevelop. This is the code for helloWorld.as:
package 
{
   import org.flixel.*;
   [SWF(width = "640", height = "480", backgroundColor = "#000000")]
   
   public class HelloWorld extends FlxGame
   {
      public function HelloWorld()
      {
         super(320,240,PlayState,2);
      }
   }
}




And for PLayState:

package 
{
   import org.flixel.*;
   
   public class PlayState extends FlxState
   {
      override public function create():void
      {
         add(new FlxText(20, 0, 100, "Hello, World!"));
      }
      
   }

}



And then the error:

Error: Access of undefined property PlayState.

this error was located on line 10 of HelloWorld.as
, which reads:
super(320,240,PlayState,2);


PLEASE HELP!! i want to make sure i get this right before i start making any games. :-[ ???

wacyWeek

  • Guest
Re: Hello World Help??
« Reply #1 on: Thu, Jul 1, 2010 »
Is PlayState a functional FlxState class?

Also youse "[_code_]" and "[_code_]" (remove the underscores)
To do this:
Code: [Select]
package blah
....

luciebara

  • Member
  • **
  • Posts: 15
  • Karma: +0/-0
    • View Profile
    • Midnight'mare (My Band ;D)
Re: Hello World Help??
« Reply #2 on: Thu, Jul 1, 2010 »
if you havent made playstate a class under the helloworld.as, try to put the file in the same folder.
if it is, just create a new playstate as a class under helloworld and copy and paste the code
-
I am not a human anymore, I traded my attitude and I traded my spine, placid weak as piss wanna **** in my car?
-