Hmm. I'm doing
SOMETHING wrong here, but I can't tell what.
From an html file:
use('com.nilbog.game.client.Application', function () {
var app = new com.nilbog.game.client.Application();
app.start();
});
Now, from what I've read, Application and anything it depends on in the 'use' builder should be available before the use() callback, above, is called. However, I'm getting an error.
Here's the contents of my com.nilbog.game.client.Application.js file:
Module('com.nilbog.game.client', function (m) {
Class('Application', {
use: ['com.nilbog.game.client.MessageWindow'],
has: { messageWindow: { is: 'ro' } },
methods: {
start: function () {
this.messageWindow = new m.MessageWindow();
}
}
});
});
...and of the MessageWindow.js file:
Module('com.nilbog.game.client', function (m) {
Class('MessageWindow', {
has: {},
methods: {}
});
});
And here's my error. MessageWindow.js loads shortly after this error, AFTER the use() callback has already fired ;(
Uncaught Module [com.nilbog.game.client.Application] may not be instantiated.
Any help?
--
John Mark Hawley
Design Technologist, Nilbog Group
http://www.nilbog.comAIM: jmhnilbog
Twitter: johnmarkhawley