I'm not able show an EaselJS (CreateJS) object inside Ext.Container from Sencha Touch (the EaselJS must be inside a canvas element in order to run).
I've successfully created the elements in a Container, but they aren't showed in the screen. After, I have defined the obj stage and listener in window, I add the element in the EaselJL object, but I don't know how to show it in the Ext Container, where the function is defined. Trying to insert the stage obj witn the add method of the Container throws an error.
Resuming: I want to know how to add/show components of other libraries inside a Container in Sencha Touch.
Below is the code of the class where I'm trying to do it:
Ext.define('oa.view.Atividade', {
extend : 'Ext.Container',
stage : null,
initialize: function() {
console.log("Teste initialize!");
this.testEaselJSSenha();
},
testEaselJSSenha : function()
{
var canvas = document.createElement("canvas");
canvas.id = "canvasEasyJS";
canvas.setAttribute('width',350);
canvas.setAttribute('height',400);
document.body.appendChild(canvas);
this.stage = new createjs.Stage(canvas);
console.log(atividade.stage);
createjs.Ticker.setFPS(10);
createjs.Ticker.addListener(window);
var texto = new createjs.Text("All you need is love!", "10px arial", "#f00070");
this.stage.addChild(texto);
//Erro: Uncaught TypeError: Object 7 has no method 'match'
this.add([this.stage]);
},
tick: function()
{
console.log("tick...!");
this.stage.update();
}
});