How To Create A Custom Class In Haxe?

playtheHnote

  • Posts: 395
As you can see by the silly coding image below I'm obviously used to coding in C# but how would I do this In Haxe???
Thanks
Check out my instrumental rock album "Hail to the Chosen One" at: https://soundcloud.com/play-the-h-note

Visit my facebook page @ https://www.facebook.com/justin.shellhorn.1
"Sound King"  now available at the forge see http://community.stencyl.com/index.php/topic,35672.0.html
for more info!

Justin

  • *
  • Posts: 4634
Don't make a scene or actor behavior, use freeform code.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

playtheHnote

  • Posts: 395
Awesome Thanks, man! So the rest of my code would be fine otherwise?
Check out my instrumental rock album "Hail to the Chosen One" at: https://soundcloud.com/play-the-h-note

Visit my facebook page @ https://www.facebook.com/justin.shellhorn.1
"Sound King"  now available at the forge see http://community.stencyl.com/index.php/topic,35672.0.html
for more info!

Justin

  • *
  • Posts: 4634
You won't need public static for your class
Class name has to start with an uppercase letter
<Dynamic> is Dynamic
"public" should be "public var" for your variables
the constructor should be "public function new" (the function name is "new", not the name of the class.)
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

playtheHnote

  • Posts: 395
That makes sense thanks again
Check out my instrumental rock album "Hail to the Chosen One" at: https://soundcloud.com/play-the-h-note

Visit my facebook page @ https://www.facebook.com/justin.shellhorn.1
"Sound King"  now available at the forge see http://community.stencyl.com/index.php/topic,35672.0.html
for more info!