Hello, its probably been asked (X) times.
However I cannot spot my mistake here.
I’ve read : http://greenethumb.com/article/23/understanding-root-and-the-document-class-in-as3
Which helps me perfectly to call a function from the “imported” class inside the documentclass.
But I can’t seem to manage to trigger a function inside my imported class:
This class is functionality for a button:
aka i want to show some text inside that specific button:
main.as:
public function ldr_onComplete( event:Event ):void
{
var variables:URLVariables = new URLVariables(event.target.data);
ldr.removeEventListener(Event.COMPLETE, ldr_onComplete);
var SAVE:save_button = new save_button();
SAVE.COMPLETED();
}
save_button.as
public function COMPLETED():void
{
trace ("save DONE");
saveBool = true;
}
This traces the following error:
TypeError: Error #1009: Kan geen eigenschap of methode benaderen via een verwijzing naar een object dat null is.
at classes.buttons::save_button()
at main2/ldr_onComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
So going back to that greenethumb blog post.
I am doing the exact same thing (i think) as he mentioned with:
child.traceRoot(); inside his main class…
any help is more then welcome. it baffles me.
cheers