3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.FlashComponent"></div>/**
9 * @class Ext.FlashComponent
10 * @extends Ext.BoxComponent
14 Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
15 <div id="cfg-Ext.FlashComponent-flashVersion"></div>/**
16 * @cfg {String} flashVersion
17 * Indicates the version the flash content was published for. Defaults to <tt>'9.0.45'</tt>.
19 flashVersion : '9.0.45',
21 <div id="cfg-Ext.FlashComponent-backgroundColor"></div>/**
22 * @cfg {String} backgroundColor
23 * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
25 backgroundColor: '#ffffff',
27 <div id="cfg-Ext.FlashComponent-wmode"></div>/**
29 * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
33 <div id="cfg-Ext.FlashComponent-url"></div>/**
35 * The URL of the chart to include. Defaults to <tt>undefined</tt>.
42 <div id="cfg-Ext.FlashComponent-expressInstall"></div>/**
43 * @cfg {Boolean} expressInstall
44 * True to prompt the user to install flash if not installed. Note that this uses
45 * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
47 expressInstall: false,
49 initComponent : function(){
50 Ext.FlashComponent.superclass.initComponent.call(this);
52 this.addEvents('initialize');
55 onRender : function(){
56 Ext.FlashComponent.superclass.onRender.apply(this, arguments);
59 allowScriptAccess: 'always',
60 bgcolor: this.backgroundColor,
63 allowedDomain: document.location.hostname,
64 elementID: this.getId(),
65 eventHandler: 'Ext.FlashEventProxy.onEvent'
68 new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
69 this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
71 this.swf = Ext.getDom(this.id);
72 this.el = Ext.get(this.swf);
75 getSwfId : function(){
76 return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
80 return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
83 onFlashEvent : function(e){
92 this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
96 this.onSwfReady(!!this.isInitialized);
97 this.isInitialized = true;
98 this.fireEvent('initialize', this);
101 beforeDestroy: function(){
103 swfobject.removeSWF(this.swf.id);
105 Ext.FlashComponent.superclass.beforeDestroy.call(this);
108 onSwfReady : Ext.emptyFn
111 <div id="prop-Ext.FlashComponent-EXPRESS_INSTALL_URL"></div>/**
112 * Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
116 Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
118 Ext.reg('flash', Ext.FlashComponent);</pre>
\r