Apr 29, 2009, 3:55 PM
Load Flash in Window
I would you like if is possible open the flash(.swf) in <ext:Window>?
The example attached.
Thanks for attention!
Ext.ux.FlashPlugin = function() {
this.init = function(ct) {
ct.flashTemplate = new Ext.XTemplate(
'',
'<object id="flash-{id}" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...ersion=6,0,0,0" width="{swfWidth}" height="{swfHeight}">',
'<param name="movie" value="{swf}" />',
'<param name="quality" value="high" />',
'<param name="wmode" value="transparent" />',
'<param name="flashvars" value="{computedflashvars}" />',
'<param name="allowScriptAccess" value="domain" />',
'<param name="align" value="t" />',
'<param name="salign" value="TL" />',
'<param name="swliveconnect" value="true" />',
'<param name="scale" value="noscale" />',
'<embed name="flash-{id}" src="{swf}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="{computedflashvars}" type="application/x-shockwave-flash" width="{swfWidth}" height="{swfHeight}" wmode="transparent" allowScriptAccess="always" swliveconnect="true" align="t" salign="TL" scale="noscale"></embed>',
'</object>',
'
'
);
ct.flashTemplate.compile();
ct.renderFlash = function() {
if (this.flashvars && (typeof this.flashvars == 'object')) {
var tempflashvars = Ext.apply({}, this.flashvars);
for (var key in tempflashvars) {
if (typeof tempflashvars[key] == 'function') {
tempflashvars[key] = tempflashvars[key].call(this, true);
}
};
this.computedflashvars = Ext.urlEncode(tempflashvars);
}
this.swfHeight = this.body.getSize().height -2;
this.swfWidth = this.body.getSize().width -2;
if (this.body.first()) this.flashTemplate.overwrite(this.body.first(),this);
else this.flashTemplate.insertFirst(this.body,this);
};
ct.loadFlash = function(config) {
Ext.apply(this,config);
this.renderFlash();
};
ct.on('afterlayout',ct.renderFlash, ct);
};
};
Thanks for attention!
Ext.ux.FlashPlugin = function() {
this.init = function(ct) {
ct.flashTemplate = new Ext.XTemplate(
'',
'<object id="flash-{id}" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...ersion=6,0,0,0" width="{swfWidth}" height="{swfHeight}">',
'<param name="movie" value="{swf}" />',
'<param name="quality" value="high" />',
'<param name="wmode" value="transparent" />',
'<param name="flashvars" value="{computedflashvars}" />',
'<param name="allowScriptAccess" value="domain" />',
'<param name="align" value="t" />',
'<param name="salign" value="TL" />',
'<param name="swliveconnect" value="true" />',
'<param name="scale" value="noscale" />',
'<embed name="flash-{id}" src="{swf}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="{computedflashvars}" type="application/x-shockwave-flash" width="{swfWidth}" height="{swfHeight}" wmode="transparent" allowScriptAccess="always" swliveconnect="true" align="t" salign="TL" scale="noscale"></embed>',
'</object>',
'
'
);
ct.flashTemplate.compile();
ct.renderFlash = function() {
if (this.flashvars && (typeof this.flashvars == 'object')) {
var tempflashvars = Ext.apply({}, this.flashvars);
for (var key in tempflashvars) {
if (typeof tempflashvars[key] == 'function') {
tempflashvars[key] = tempflashvars[key].call(this, true);
}
};
this.computedflashvars = Ext.urlEncode(tempflashvars);
}
this.swfHeight = this.body.getSize().height -2;
this.swfWidth = this.body.getSize().width -2;
if (this.body.first()) this.flashTemplate.overwrite(this.body.first(),this);
else this.flashTemplate.insertFirst(this.body,this);
};
ct.loadFlash = function(config) {
Ext.apply(this,config);
this.renderFlash();
};
ct.on('afterlayout',ct.renderFlash, ct);
};
};
Thanks for attention!