Over a million developers have joined DZone.

Adding a Flash File Inside an ExtJS 4 Component

DZone's Guide to

Adding a Flash File Inside an ExtJS 4 Component

· Web Dev Zone
Free Resource

Make the transition to Node.js if you are a Java, PHP, Rails or .NET developer with these resources to help jumpstart your Node.js knowledge plus pick up some development tips.  Brought to you in partnership with IBM.

Today we are going to learn how to add a flash file (.swf) inside an ExtJS 4 Component.

First, let’s check out what we are going to implement:

extjs4 flash video loiane 01 Tutorial: Adding a Flash file inside an ExtJS 4 Component

What we are going to need for this example:

The first thing to do is to create the project structure. Unzip the SWFObject lib inside the project and also add the flash file you want to display inside the project directory as well (mine is called airballoon). I also unzipped the ExtJS 4 SDK inside the directory and created a file named index.html. When everything is ready, this is how it is going to look:

extjs4 flash video loiane 02 Tutorial: Adding a Flash file inside an ExtJS 4 Component

Finally, inside the index.html file we are going to add the following content:

    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <script type="text/javascript" src="swfobject/swfobject.js"></script>
    <script type="text/javascript">
        var win = Ext.widget('window', {
            title: "Flash animation inside an ExtJS 4 Component!",
            layout: 'fit',
            width: 700,
            height: 500,
            resizable: true,
            items: {
                xtype: 'flash',
                url: 'airballoon/AIRBALLOON.swf'

The flash animation will be displayed inside an ExtJS 4 Window. The class Ext.flash.Component (xtype: ‘flash’) does all the ‘magic’ we need, and in the config url you just need to add the full path to the flash file (.swf).


Complete source codehttps://github.com/loiane/extjs4-flash-video

Happy Coding! icon smile Tutorial: Adding a Flash file inside an ExtJS 4 Component

Learn why developers are gravitating towards Node and its ability to retain and leverage the skills of JavaScript developers and the ability to deliver projects faster than other languages can.  Brought to you in partnership with IBM.


Published at DZone with permission of Loiane Groner, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}