/** * @classdescription: * @author: Sebastian Martens; sebastian@sebastian-martens.de: blog.sebastian-martens.de * @copyright: Creative Commons. Free to use "as is" * @svn: $Id: swfJSPreLoader.js 3 2010-05-17 21:01:19Z dinnerout $ * @uses: jQuery, swfObject */ var swfJSPreLoader = { _nodeId: 'swfJSPreLoaderNode', _jsLoaderSWF: null, _container:null, _flashVersion:"9.0.0", // minimum version of test flash _swfPath:'./', _flashVars:{}, // flash vars _params:{ menu:false, wmode:'transparent', scale:'noScale' }, // flash parameters _attributes:{ id: this._nodeId, name: this._nodeId, style:'position:absolute;right:0px;bottom:0px' }, // flash atributes _isInitialized: false, _swfInstance: null, assets:[], loadComplete: null, loadError: null, callback: null, assetLoaded: null, _assetsMap: [], /** * @public * * init method, called on init * @param {Object} obj - parameter object */ init:function( obj ){ // mixes given parameter into this this.mixIn( obj ); this._isInitialized = false; this.createNode(); return true; }, /** * @private * * mix a given object into this object * @param {Object} obj - given object with parameters */ mixIn: function( obj, scope ){ var item; if(!scope) scope = this; for(item in obj){ scope[ item ] = obj[item]; } }, /** * @private * * load handler, called after document is fully loaded * adds flash node via swfObjects into DOM * @param {Object} obj - event parameter */ createNode:function( obj ){ // var node = document.createElement('DIV'); // node.setAttribute('id',this._nodeId); // document.body.appendChild( node ); // this._jsLoaderSWF = node; new Swiff(this._swfPath+"swfJSPreLoader.swf",{id:this._nodeId,width:1,height:1,container:this._container,params: this._params}); //swfobject.embedSWF(this._swfPath+"swfJSPreLoader.swf", this._nodeId, 1, 1, this._flashVersion,"expressInstall.swf", this._flashvars, this._params, this._attributes); }, /** * @private * * init function called from flash, flash is ready * adds all initial assets to loading queue */ swfJSPreLoaderInit:function( ){ // get swf instance if (navigator.appName.indexOf("Microsoft") != -1) { this._swfInstance = window[this._nodeId]; } else { this._swfInstance = document[this._nodeId]; } // add assets to queue for(var i=0;i