Coding in ActionScript I found an error I couldn't solve. I have a Flash file with a library, in which I have a MovieClip object called "SpriteGraphic" (it's linked and it's class name is also "SpriteGraphic")
Now I have an external class, in which I want to have an instance of that object:
package {
import flash.display.Stage;
import flash.geom.Point;
import flash.display.MovieClip;
public class Object
{
var spriteGraphic:SpriteGraphic;
var velY:Number;
var velX:Number;
var IA:Number;
public function Object(posInit:Point, vel:Number , parAngle:Number, stageObj:Stage):void
{
spriteGraphic = new SpriteGraphic();
spriteGraphic.x = posInit.x;
spriteGraphic.y = posInit.y;
trace(spriteGraphic.x);
IA = parAngle;
velX = -vel * Math.cos(IA);
velY = vel * Math.sin(IA);
stageObj.addChild(spriteGraphic);
}
...
When I execute the output says spriteGraphic is null. How can I use the MovieClip from the library, and have a variable from that type in an external class?
Thanks a lot!
No one? Really? :c