reference parent class function in AS 3.0

Posted by vasion on Stack Overflow See other posts from Stack Overflow or by vasion
Published on 2010-03-23T07:07:10Z Indexed on 2010/03/23 7:13 UTC
Read the original article Hit count: 392

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript