3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 <div id="cls-Ext.FlashComponent"></div>/**
16 * @class Ext.FlashComponent
17 * @extends Ext.BoxComponent
21 Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
22 <div id="cfg-Ext.FlashComponent-flashVersion"></div>/**
23 * @cfg {String} flashVersion
24 * Indicates the version the flash content was published for. Defaults to <tt>'9.0.115'</tt>.
26 flashVersion : '9.0.115',
28 <div id="cfg-Ext.FlashComponent-backgroundColor"></div>/**
29 * @cfg {String} backgroundColor
30 * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
32 backgroundColor: '#ffffff',
34 <div id="cfg-Ext.FlashComponent-wmode"></div>/**
36 * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
40 <div id="cfg-Ext.FlashComponent-flashVars"></div>/**
41 * @cfg {Object} flashVars
42 * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
46 <div id="cfg-Ext.FlashComponent-flashParams"></div>/**
47 * @cfg {Object} flashParams
48 * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
49 * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
51 flashParams: undefined,
53 <div id="cfg-Ext.FlashComponent-url"></div>/**
55 * The URL of the chart to include. Defaults to <tt>undefined</tt>.
62 <div id="cfg-Ext.FlashComponent-expressInstall"></div>/**
63 * @cfg {Boolean} expressInstall
64 * True to prompt the user to install flash if not installed. Note that this uses
65 * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
67 expressInstall: false,
69 initComponent : function(){
70 Ext.FlashComponent.superclass.initComponent.call(this);
73 <div id="event-Ext.FlashComponent-initialize"></div>/**
82 onRender : function(){
83 Ext.FlashComponent.superclass.onRender.apply(this, arguments);
85 var params = Ext.apply({
86 allowScriptAccess: 'always',
87 bgcolor: this.backgroundColor,
89 }, this.flashParams), vars = Ext.apply({
90 allowedDomain: document.location.hostname,
91 YUISwfId: this.getId(),
92 YUIBridgeCallback: 'Ext.FlashEventProxy.onEvent'
95 new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
96 this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
98 this.swf = Ext.getDom(this.id);
99 this.el = Ext.get(this.swf);
102 getSwfId : function(){
103 return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
107 return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
110 onFlashEvent : function(e){
119 this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
122 initSwf : function(){
123 this.onSwfReady(!!this.isInitialized);
124 this.isInitialized = true;
125 this.fireEvent('initialize', this);
128 beforeDestroy: function(){
130 swfobject.removeSWF(this.swf.id);
132 Ext.FlashComponent.superclass.beforeDestroy.call(this);
135 onSwfReady : Ext.emptyFn
138 <div id="prop-Ext.FlashComponent-EXPRESS_INSTALL_URL"></div>/**
139 * Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
143 Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
145 Ext.reg('flash', Ext.FlashComponent);</pre>