Should this:


// -- CursorDepot.as :
package cursors {
    
    public class CursorDepot {
        
        public static var cross:Cross = Cross;
        
    }    
}

 

Be:


// -- CursorDepot.as :
package cursors {
    
    public class CursorDepot {
        
        public static var cross:Cross = new Cross();
        
    }    
}

I’d be a little surprised if the original compiles, which is why I think it might just be a typo in your email.

 

Tobias.

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Bart Wttewaall
Sent: Wednesday, July 12, 2006 4:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Package with internal class problem

 

I guess I'm not permitted to delegate an internal class' public static variable through the public class' public static variable. Too bad, I had to create a lot of small classes for each cursor for the application to work. Still, I'm wondering if there's a way to package those classes to keep the amount of files to a minimum.

Anyone with a bright idea?

Bart Wttewaall

2006/7/11, Bart Wttewaall <[EMAIL PROTECTED]>:

Hi list,

I'm trying to combine multiple small classes into one package, but to no avail..
Could someone help me with this?

The error I get is:
TypeError: Error #1009: Cannot access a property or method of a null object reference.

// -- CursorDepot.as :
package cursors {
    
    public class CursorDepot {
        
        public static var cross:Cross = Cross;
        
    }    
}

internal class Cross {
    [Embed(source="../cursors/cross.png")]
    public static var icon:Class;
    
    public static var offsetX:int = 0;
    public static var offsetY:int = 0;
}

// -- in the application:
public function init():void {
    setCursor(CursorDepot.cross);
}

public function setCursor(cursorClass:*):void {
    trace(cursorClass) // outputs: null !!! why?
    var cursorID:int = setCursor(cursorClass.icon, cursorClass.offsetX, cursorClass.offsetY);
}


Thank you in advance,

Bart Wttewaall

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to