Hi,

you need to create an instance of the testClass like this

var test:testClass = new testClass();

regards,
Christophe

--
Christophe Herreman
http://www.herrodius.com
http://www.pranaframework.com

2008/1/1, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
> This compiles but when you hit the test button, it says
>
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> at Main/test()
> at Main/__b1_click()
>
> Can anyone explain what this means ? It totally does not make any sense
> to me.
>
> >>>>>>main.mxml:
> <?xml version="1.0"?>
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
> <mx:Script source="MainCode.as"/>
> <mx:Button id="b1" label="Test" click="test();"/>
>
> </mx:Application>
>
> >>>>>>MainCode.as:
> Public function test():void
> {
> var test:testClass;
> test.justtesting();
>
> }
>
> >>>>>>testClass.as:
> package {
> public class testClass {
> public function testClass() {
>
> }
> public function justtesting():void {
> trace("just testing");
> }
> }
>
> }
>  
>



-- 
Christophe Herreman
http://www.herrodius.com
http://www.pranaframework.org

Reply via email to