I'm trying to create a folder hierarchy in flash, the folders i have are
C:\uk\ac\uwe\webgames\math
in the math folder i have the following file called GameMath.as
package uk.ac.uwe.webgames.math{
public class GameMath {
// ------- Constructor -------
public function GameMath() {
}
// ------- Properties -------
const PI:Number = Math.PI;
// ------- Methods -------
public function areaOfCircle(radius:Number):Number {
var area:Number;
area = PI * radius * radius;
return area;
}
}
}
In the webgames folder i have a file called webgames_driver.fla
import uk.ac.uwe.webgames.math.GameMath;
import flash.text.TextField;
// Create a GameMath instance
var output:TextField = new TextField();
var aGameMathInstance:GameMath = new GameMath();
// you will need to create a dynamic textfield called
// output on the stage to display method return value
output.text=aGameMathInstance.areaOfCircle(5).toString();
addChild(output);
//trace(aGameMathInstance.areaOfCircle(1))
however i am getting the following errors
Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition uk.ac.uwe.webgames.math:GameMath could not be found.
Scene 1, Layer 'Layer 1', Frame 1, Line 1 1172: Definition uk.ac.uwe.webgames.math:GameMath could not be found.
Scene 1, Layer 'Layer 1', Frame 1, Line 5 1046: Type was not found or was not a compile-time constant: GameMath.
Scene 1, Layer 'Layer 1', Frame 1, Line 5 1180: Call to a possibly undefined method GameMath.
Could anyone help coz i am just stuck, and i'm really new to flash