mercredi 23 septembre 2015

Need some help getting started with OOD in ActionScript 3

So being new to AS3 but not development in general, during a recent project that I just started I hit an immediate snag where my normal method of OOD is causing errors in AS3.

I created a layer in Adobe Flash called code just to keep everything separate and in frame one under actions I used the following code to get started:

var GameContainerSize:int = 400;

class GameInfo {
    var GameID:int;
    var HomeTeam:String;
    var VisitingTeam:String;
    function GameInfo()
    {

    }
}

This simple code immediately causes an error though

Scene 1, Layer 'Code', Frame 1, Line 4 1131: Classes must not be nested.

And my best guess is this is because the timeline and all code on it exists within a class already. So what should I be doing if I want to develop this program using class objects, or is this even possible in flash?

Aucun commentaire:

Enregistrer un commentaire