public static var cross:Class = Cross;
I only needed the reference to the internal class so I could call its static variables. But that gave me a null.
If I created a constructor in CursorDepot and called:
trace(cross ); // output: Class [Cross]
it worked fine, it gave me the expected results.
But when called from outside the class:
trace(CursorDepot.cross ); // output: null
I guess it's just not possible to call anything from internal classes, not even when going via the public class. Or am I mistaken? I'd like to be :)
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: [email protected] [mailto:[email protected]] On Behalf Of Bart Wttewaall
Sent: Wednesday, July 12, 2006 4:22 AM
To: [email protected]
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 Wttewaall2006/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
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

