Hi guys!
I need a clear understanding on my problem:
I have var on my stage and i want my class to be able to access
that var.
Here’s what is on my main.fla:
import ShapeOuts;
var ShapeDetect = 0;
var shaped:ShapeOuts = new ShapeOuts();
function showShape()
{
trace("Show Shape");
shaped.grow();
}
showShape();
Here’s what is on my class:
package
{
import flash.events.Event;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class ShapeOuts extends MovieClip
{
public function ShapeOuts()
{
addEventListener(Event.ADDED_TO_STAGE, grow);
}
public function grow():void
{
if(MovieClip(root).ShapeDetect == 0)
{
trace("ShapeDetect = " + MovieClip(root).ShapeDetect);
}
}
}
}
i keep getting this error: Cannot access a property or method of a null object reference.
Am i missing something here? Hope this one makes sense.