PDA

View Full Version : [FIXED-100][3.0.0] FlashComponent not showing in FF3



RomAnoX
31 Jul 2009, 7:41 AM
I look in the forums and i didn't find anything about it... i have these piece of code in my project



(new Ext.Window({
title : 'Administración Web - Equipo de Desarrollo',
layout : 'fit',
width : 620,
height : 420,
resizable : false,
plain : true,
border : false,
modal : true,

items : [{
xtype : 'flash',
swfId : 'iiweegg',
url : 'resources/eeint.swf',
wmode : 'transparent',
expressInstall : true
}]
})).show();


I dont have the version required of flash (9.0...) and the expressInstall set to true doesn't seem to work in FF3.5 because the windows doesn't prompt to install the correct flash version... the firebug trows this



rz is null
rz.setSize(aw, ah);

in ext-all-debug.js (línea 16236)


it's this a bug? or i'm missing something??

mjlecomte
31 Jul 2009, 7:57 AM
Do the chart examples work for you?

RomAnoX
31 Jul 2009, 9:50 AM
No... they doen't work in my FF3.5... and a don't get the error "rz is null" because the property expressInstall (i think) is not set to true in the examples or in the chart component...

debuging in my firebug... i found that the hasFlashPlayer returns false because my version of flash installed is 7.0.14 and no 9.0... if i add the flashVersion set to 7.0.14 it works great... but i think the bug is important to be fixed...

mjlecomte
1 Aug 2009, 4:57 PM
I removed my flash player and installed version 7.

Upon doing that I saw the screenshot attached, prompting me to update my flash player.

mjlecomte
1 Aug 2009, 5:11 PM
I uninstalled yet again and reinstalled. This time around I did see the flash update dialog again, but I cancelled it. After cancelling it I got the error you did. I have since refreshed the page, restarted firefox, cleared cache and restarted and no matter what I do I get the error you report.

mjlecomte
1 Aug 2009, 5:13 PM
Also a little weird, the title of the page says its trying to install flash player even, see screenshot attached.

mjlecomte
1 Aug 2009, 5:19 PM
Not sure if wrapping with a check is unsafe, but this prevented the error being thrown:



setSize : function(w, h){
// support for standard size objects
if(typeof w == 'object'){
h = w.height;
w = w.width;
}
// not rendered
if(!this.boxReady){
this.width = w;
this.height = h;
return this;
}

// prevent recalcs when not needed
if(this.cacheSizes !== false && this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
return this;
}
this.lastSize = {width: w, height: h};
var adj = this.adjustSize(w, h);
var aw = adj.width, ah = adj.height;
if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
var rz = this.getResizeEl();
if (rz){
if(!this.deferHeight && aw !== undefined && ah !== undefined){
rz.setSize(aw, ah);
}else if(!this.deferHeight && ah !== undefined){
rz.setHeight(ah);
}else if(aw !== undefined){
rz.setWidth(aw);
}
this.onResize(aw, ah, w, h);
this.fireEvent('resize', this, aw, ah, w, h);
}
}
return this;
},

mjlecomte
1 Aug 2009, 5:33 PM
There is some notation on the swfobject site about handler only getting called once which may be some of the problem I noticed if you decline accepting the express install it wouldn't prompt on refresh (had to restart firefox). Basically it was a tad finicky...

RomAnoX
3 Aug 2009, 6:48 AM
Thanks mjlecomte for your replys... i restarted my firefox and nothing happend... i install version 9 of flash and everything it's great... maybe i have a problem with my firefox installation... i will continue and if some client report the problem... i will post it again... till then... thank you so much!!... :D (sorry for my english but i'm a mexican developer)

mjlecomte
3 Aug 2009, 10:22 AM
Going to mark this OPEN though so someone can confirm/deny if that rz should be checked before assuming it's there. Nice to have the safety to prevent the error, but also makes it more difficult to sniff out if a problem arises later perhaps.

Animal
3 Aug 2009, 11:00 AM
It looks like the test has to be there.

FlashComponent can end up without an el property if a Flash Object cannot be instantiated and inserted into the DOM.

I don't know if it's worth adding the test though, because I don't see how the Component can "recover" from this.

The popup asking you to do some installing of Flash is seperate, and the FlashComponent can't know to go back and try again to retrieve its el Element.

Animal
3 Aug 2009, 11:01 AM
onRender : function(){
Ext.FlashComponent.superclass.onRender.apply(this, arguments);

var params = Ext.apply(this.flashParams || {}, {
allowScriptAccess: 'always',
bgcolor: this.backgroundColor,
wmode: this.wmode
}), vars = Ext.apply(this.flashVars || {}, {
allowedDomain: document.location.hostname,
elementID: this.getId(),
eventHandler: 'Ext.FlashEventProxy.onEvent'
});

new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);

this.swf = Ext.getDom(this.id);
this.el = Ext.get(this.swf);
},



I'm not sure what happens, but either onRender drops out before if gets to "this.el = ", or that getDom call returns null because the swfobject was not created.

Maybe there should be more testing in there?

mjlecomte
3 Aug 2009, 12:58 PM
It is definitely finicky to test. I uninstalled flash a few times trying to test it.

I'm not sure, but I thought there might be an issue where the firebug error thrown because of no "rz" that might prevent the flash install message from showing up.

mjlecomte
3 Aug 2009, 1:03 PM
Not specific to this issue, looks like YUI suggests (http://developer.yahoo.com/yui/charts/#knownissues) updating the version number from 45 to 115:



Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
/**
* @cfg {String} flashVersion
* Indicates the Flash player version the flash content was published for
* (format is: "major.minor.release" or "major"). Defaults to <tt>'9.0.115</tt>.
*/
flashVersion : '9.0.115',