Question

Trying to learn from a game on github which is backgammon and the fla stage is empty with class files external so when you test the swf it cannot find the interface that is attempting to load :

package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFormat;

import multiflame.game.IGame;
import multiflame.game.IContainer;
import multiflame.game.Constants;

Would the interface be something created in flash builder which I use along with flash CS6 or could those AS3 files be just as easily created in flash? I am new to flash builder and trying to figure out if it is used primarily for networking builds in which case the interface would be best executed there or doesn't it matter?

Was it helpful?

Solution

For very basic explanation - in your case interfaces are very similar to classes - external files with code in it. They are nothing special created with different programs - they are just plain text files named .as

You should provide the error you're getting, but if it says that the interface cannot be loaded, it means that Flash cannot find the file. In your case, if the interface error is about IGame, it means that in your folder where the .swf file is, you must have subfolder multiflame with game folder inside it, and a IGame.as file there.

This is of course if you don't know how to manage source paths - there's a property inside Flash AS options which you can set to target specific directory (for example D:\ can be mapped as root of your classes and so multiflame directory should be inside D:\, no matter where your swf is).

p.s. Further you can read about interfaces and what they do: http://code.tutsplus.com/tutorials/as3-101-oop-introduction-to-interfaces--active-8199

I haven't read the whole tutorial but it seems large enough to cover the idea.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top