0
votes

I am a proficient programmer in C++, and recently I decided to try and use Actionscript to make a small flash game.I have been having some trouble getting started. I'm not sure what classes should link to what MovieClips and vice versa? The problem is that with the code below, my DeerCartoon MovieClip does not appear on the stage when I run it.

Anyways, All I'm trying to do is create a "Deer" object and have it appear on my stage when I instantiate it.

Here's my code:

Deer.As

package
{
    import flash.display.*;

    public class Deer extends MovieClip
    {
        public function Deer()
        {
            //ctor
        }
    }
}

Main.As

package 
{
    import flash.display.*;

    public class Main extends DeerMassacre2
    {
        public function Main()
        {
            var d:Deer = new Deer();
            addChild(d);
        }
    } 
}

The name of the actionscript program is DeerMassacre2 (the name of my game)

I have no code in the timeline and nothign on the stage yet.

Could someone please help me out?

Thanks in Advance!

1
What is the content of DeerMassacre2.as class? and what compiler errors you get when you run? my answer will depend on these answers.Amer
What is your document class ? It's possible you have not set a document class, therefore nothing will happen.prototypical
Yep that was the problem, fixed it last night. Thanks for your input anyway!Taylor

1 Answers

0
votes

You need to name library symbol to use with Actionscript in the Flash, look here: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b8ea63-7fee.html Or draw something in your Deer class with code

Also, if you are C++ programmer, you might be interested in this: http://www.as3gamegears.com/misc/crossbridge/