/**
 * Ext.ux.SlideShow
 *
 * @author    Kristof Torfs
 * @copyright (c) 2010, by Kristof Torfs
 * @date      11. January 2011
 * @version   $Id$
 */
 
/* global Ext */

Ext.ns('Ext.ux');

/**
 *
 * @class Ext.ux.SlideShow
 * @extends Ext.FlashComponent
 */
Ext.ux.SlideShow = Ext.extend(Ext.FlashComponent, {
    // soft config (can be changed from outside)
    basePath: ''
    ,height: 480
    ,imageXml: ''
    ,settingsXml: 'settings.xml'
    ,width: 640
 
    // {{{
    // uncomment constructor if you need it, e.g. if you need listeners
//    ,constructor:function(config) {
//        // constructor pre-processing - configure listeners here
//        config = config || {};
//        config.listeners = config.listeners || {};
//        Ext.applyIf(config.listeners, {
//             expand:{scope:this, fn:function() {
//            }}
//            ,collapse:{scope:this, fn:function() {
//            }}
//        });
//
//        // call parent contructor
//        AnExtension.superclass.constructor.apply(this, arguments);
//
//        // constructor post-processing
//
//    } // eo function constructor
    // }}}
    // {{{
    ,initComponent:function() {
        // {{{

        // hard coded (cannot be changed from outside)
        var config = {
            flashParams: {
                scale: 'noscale',
                salign: 'tl',
                bgcolor: "#000000"
            },
            url: this.basePath + '/BannerRotatorFX.swf',
            wmode: 'opaque'
        };
 
        // apply config
        Ext.apply(this, config);
        Ext.apply(this.initialConfig, config);
        // }}}
 
        // call parent
        Ext.ux.SlideShow.superclass.initComponent.apply(this, arguments);
 
        if (!this.flashParams) this.flashVars = {};
        Ext.apply(this.flashParams, {
        });
        if (!this.flashVars) this.flashVars = {};
        var xml = String.format('/{0}?p={1},{2},{3}', this.settingsXml, this.width, this.height, this.imageXml);
        Ext.apply(this.flashVars, {
            settingsXML: this.basePath + xml
        });
 
        // after parent code here, e.g. install event handlers
    } // eo function initComponent
    // }}}
    // {{{
    ,onRender:function() {
 
        // before parent code
 
        // call parent
        Ext.ux.SlideShow.superclass.onRender.apply(this, arguments);
 
        // after parent code, e.g. install event handlers on rendered components
 
    } // eo function onRender
    // }}}
    // any other added/overrided methods
}); // eo extend
 
// register xtype
Ext.reg('slideshow', Ext.ux.SlideShow); 
 
// eof
