Witam. Probuje zrobic prosta animacje z CreateJS i podejsciem obiektowym w TypeScript. Niestety nie do konca wiem jak sprawic aby moj glowny plik widzial pliki klas.
Blad:
Uncaught ReferenceError: AnimationParts is not defined
at Main (app2.js:29)
at LoadQueue.StartAnimation (app2.js:22)
at preloadjs-0.6.2.min.js:12
at LoadQueue.a._dispatchEvent (preloadjs-0.6.2.min.js:12)
at LoadQueue.a.dispatchEvent (preloadjs-0.6.2.min.js:12)
at LoadQueue.a._sendComplete (preloadjs-0.6.2.min.js:12)
at LoadQueue.a._loadNext (preloadjs-0.6.2.min.js:13)
at LoadQueue.a._processFinishedLoad (preloadjs-0.6.2.min.js:13)
at LoadQueue.a._handleFileComplete (preloadjs-0.6.2.min.js:13)
at preloadjs-0.6.2.min.js:12
Poczatek button.ts
module AnimationParts {
/**
* A Button class
*
* @export
* @class Button
* @extends {createjs.Bitmap}
*/
export class Button extends createjs.Bitmap {
/**
* Creates an instance of button.
* @param {createjs.LoadQueue} loader
* @param {string} _imageString
* @param {number} x
* @param {number} y
* @param {boolean} _isCentered
*
* @memberOf button
*/
Poczatek Text
module AnimationParts {
/**
* This creates the text used on the banner
*
* @export
* @class Label
* @extends {createjs.Text}
*/
export class Label extends createjs.Text {
/**
* Creates an instance of Label.
* @param {string} _textContent
* @param {string} _textFont
* @param {string} _textSize
* @param {string} _textColor
* @param {number} x
* @param {number} y
* @param {boolean} _isCentered
*
* @memberOf Label
*/
Funkcja Main()
function Main(): void {
textLabel = new AnimationParts.Label("Hello world", "Arial", "12", 'black', canvasWidth / 2, canvasHeight / 2, true);
stage.addChild(textLabel);
Button.on('click',function(event:createjs.MouseEvent){
textLabel.text='Don\'t worry, be happy';
})
}
Jedyne o czym moge pomyslec to ze nie ma import Button i import Text. Niestety nie wiem za bardzo gdzie je wpakowac