3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.FlashComponent"></div>/**
10 * @class Ext.FlashComponent
11 * @extends Ext.BoxComponent
15 Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
16 <div id="cfg-Ext.FlashComponent-flashVersion"></div>/**
17 * @cfg {String} flashVersion
18 * Indicates the version the flash content was published for. Defaults to <tt>'9.0.45'</tt>.
20 flashVersion : '9.0.115',
22 <div id="cfg-Ext.FlashComponent-backgroundColor"></div>/**
23 * @cfg {String} backgroundColor
24 * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
26 backgroundColor: '#ffffff',
28 <div id="cfg-Ext.FlashComponent-wmode"></div>/**
30 * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
34 <div id="cfg-Ext.FlashComponent-flashVars"></div>/**
35 * @cfg {Object} flashVars
36 * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
40 <div id="cfg-Ext.FlashComponent-flashParams"></div>/**
41 * @cfg {Object} flashParams
42 * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
43 * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
45 flashParams: undefined,
47 <div id="cfg-Ext.FlashComponent-url"></div>/**
49 * The URL of the chart to include. Defaults to <tt>undefined</tt>.
56 <div id="cfg-Ext.FlashComponent-expressInstall"></div>/**
57 * @cfg {Boolean} expressInstall
58 * True to prompt the user to install flash if not installed. Note that this uses
59 * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
61 expressInstall: false,
63 initComponent : function(){
64 Ext.FlashComponent.superclass.initComponent.call(this);
67 <div id="event-Ext.FlashComponent-initialize"></div>/**
76 onRender : function(){
77 Ext.FlashComponent.superclass.onRender.apply(this, arguments);
79 var params = Ext.apply({
80 allowScriptAccess: 'always',
81 bgcolor: this.backgroundColor,
83 }, this.flashParams), vars = Ext.apply({
84 allowedDomain: document.location.hostname,
85 elementID: this.getId(),
86 eventHandler: 'Ext.FlashEventProxy.onEvent'
89 new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
90 this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
92 this.swf = Ext.getDom(this.id);
93 this.el = Ext.get(this.swf);
96 getSwfId : function(){
97 return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
101 return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
104 onFlashEvent : function(e){
113 this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
116 initSwf : function(){
117 this.onSwfReady(!!this.isInitialized);
118 this.isInitialized = true;
119 this.fireEvent('initialize', this);
122 beforeDestroy: function(){
124 swfobject.removeSWF(this.swf.id);
126 Ext.FlashComponent.superclass.beforeDestroy.call(this);
129 onSwfReady : Ext.emptyFn
132 <div id="prop-Ext.FlashComponent-EXPRESS_INSTALL_URL"></div>/**
133 * Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
137 Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
139 Ext.reg('flash', Ext.FlashComponent);</pre>
\r