how can i call public functions or vars of a sprite class from another class (or frame script)? i keep getting 1061: Call to a possibly undefined method getSide through a reference with static type flash.display:Sprite.
//Framescript
var a:Sprite = new customRect();
addChild(a);
a.getSide();
//.as file
package
{
import flash.display.Sprite;
public class customRect extends Sprite
{
public var side:Number;
private function customRect()
{
var box:Sprite = new Sprite();
box.graphics.beginFill();
box.graphics.drawRect(0, 0, 200, 200);
box.graphics.endFill();
side = box.width;
}
public function getSide():void
{
trace(side);
}
}
}