I am trying to run a function of the main class, but even with casting it does not work. I get this error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at rpflash.communication::RPXMLReader/updateplaylist()
at rpflash.communication::RPXMLReader/dataHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::XMLSocket/scanAndSendEvent()
this is the main class code
package{
import flash.display.MovieClip;
import rpflash.communication.RPXMLReader;
public class Main extends MovieClip{
var reader:RPXMLReader = new RPXMLReader();
public function Main(){
trace('Main actionscript loaded');
}
public function test(){
trace('test worked');}
}
}
and this is the function trying to call it:
private function updateplaylist(){
//xml to string
var xmls:String= xml.toXMLString();
trace('playlist updated debug point');
MovieClip(this.parent).test();}
what am i doing wrong?