/** * A simple Component for displaying an Adobe Flash SWF movie. The movie will be sized and can participate * in layout like any other Component. * * This component requires the third-party SWFObject library version 2.2 or above. It is not included within * the ExtJS distribution, so you will have to include it into your page manually in order to use this component. * The SWFObject library can be downloaded from the [SWFObject project page](http://code.google.com/p/swfobject) * and then simply import it into the head of your HTML document: * * * * ## Configuration * * This component allows several options for configuring how the target Flash movie is embedded. The most * important is the required {@link #url} which points to the location of the Flash movie to load. Other * configurations include: * * - {@link #backgroundColor} * - {@link #wmode} * - {@link #flashVars} * - {@link #flashParams} * - {@link #flashAttributes} * * ## Example usage: * * var win = Ext.widget('window', { * title: "It's a tiger!", * layout: 'fit', * width: 300, * height: 300, * x: 20, * y: 20, * resizable: true, * items: { * xtype: 'flash', * url: 'tiger.swf' * } * }); * win.show(); * * ## Express Install * * Adobe provides a tool called [Express Install](http://www.adobe.com/devnet/flashplayer/articles/express_install.html) * that offers users an easy way to upgrade their Flash player. If you wish to make use of this, you should set * the static EXPRESS\_INSTALL\_URL property to the location of your Express Install SWF file: * * Ext.flash.Component.EXPRESS_INSTALL_URL = 'path/to/local/expressInstall.swf'; */ Ext.define('Ext.flash.Component', { extend: 'Ext.Component', alternateClassName: 'Ext.FlashComponent', alias: 'widget.flash', /** * @cfg {String} [flashVersion="9.0.115"] * Indicates the version the flash content was published for. */ flashVersion : '9.0.115', /** * @cfg {String} [backgroundColor="#ffffff"] * The background color of the SWF movie. */ backgroundColor: '#ffffff', /** * @cfg {String} [wmode="opaque"] * The wmode of the flash object. This can be used to control layering. * Set to 'transparent' to ignore the {@link #backgroundColor} and make the background of the Flash * movie transparent. */ wmode: 'opaque', /** * @cfg {Object} flashVars * A set of key value pairs to be passed to the flash object as flash variables. */ /** * @cfg {Object} flashParams * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here: * http://kb2.adobe.com/cps/127/tn_12701.html */ /** * @cfg {Object} flashAttributes * A set of key value pairs to be passed to the flash object as attributes. */ /** * @cfg {String} url (required) * The URL of the SWF file to include. */ /** * @cfg {String/Number} [swfWidth="100%"] * The width of the embedded SWF movie inside the component. * * Defaults to "100%" so that the movie matches the width of the component. */ swfWidth: '100%', /** * @cfg {String/Number} [swfHeight="100%"] * The height of the embedded SWF movie inside the component. * * Defaults to "100%" so that the movie matches the height of the component. */ swfHeight: '100%', /** * @cfg {Boolean} [expressInstall=false] * True to prompt the user to install flash if not installed. Note that this uses * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. */ expressInstall: false, /** * @property {Ext.dom.Element} swf * A reference to the object or embed element into which the SWF file is loaded. Only * populated after the component is rendered and the SWF has been successfully embedded. */ // Have to create a placeholder div with the swfId, which SWFObject will replace with the object/embed element. renderTpl: ['
'], /** * @event success * Fired when the Flash movie has been successfully embedded * @param {Ext.flash.Component} this */ /** * @event failure * Fired when the Flash movie embedding fails * @param {Ext.flash.Component} this */ initComponent: function() { //