Clear Up
SharpKit Reference

Component Class

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 and then simply import it into the head of your HTML document:

  
<script type="text/javascript" src="path/to/local/swfobject.js"></script>
            

Configuration

This component allows several options for configuring how the target Flash movie is embedded. The most important is the required url which points to the location of the Flash movie to load. Other configurations include:

  • backgroundColor
  • wmode
  • flashVars
  • flashParams
  • 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 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';
            

Namespace: Ext.flash

Fields

Name Description
backgroundColor The background color of the SWF movie. Defaults to: "#ffffff"
expressInstall 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. Defaults to: false
flashAttributes A set of key value pairs to be passed to the flash object as attributes.
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
flashVars A set of key value pairs to be passed to the flash object as flash variables.
flashVersion Indicates the version the flash content was published for. Defaults to: "9.0.115"
swfHeight The height of the embedded SWF movie inside the component. Defaults to "100%" so that the movie matches the height of the component. Defaults to: "100%"
swfWidth The width of the embedded SWF movie inside the component. Defaults to "100%" so that the movie matches the width of the component. Defaults to: "100%"
url The URL of the SWF file to include.
wmode The wmode of the flash object. This can be used to control layering. Set to 'transparent' to ignore the backgroundColor and make the background of the Flash movie transparent. Defaults to: "opaque"

Properties

Name Description
EXPRESS_INSTALL_URL The url for installing flash if it doesn't exist. This should be set to a local resource. See http://www.adobe.com/devnet/flashplayer/articles/express_install.html for details.
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.

Methods

Name Description
getSwfId() Retrieves the id of the SWF object/embed element.
© Copyright 2005-2011 SharpKit. All rights reserved.