function createSWF(attObj, parObj, id) {
        var r,
            el = getElementById(id);
        id = getId(id); // ensure id is truly an ID and not an element

        if (ua.wk && ua.wk < 312) {
            return r;
        }

        if (el) {
            var o = ua.ie ? createElement("div") : createElement(OBJECT),
                attr,
                attrLower,
                param;

            if (typeof attObj.id === UNDEF) {
                // if no 'id' is defined for the object element, it will inherit the 'id' from the fallback content
                attObj.id = id;
            }

            //Add params
            for (param in parObj) {
                //filter out prototype additions from other potential libraries and IE specific param element
                if (parObj.hasOwnProperty(param) && param.toLowerCase() !== "movie") {
                    createObjParam(o, param, parObj[param]);
                }
            }

            //Create IE object, complete with param nodes
            if (ua.ie) {
                o = createIeObject(attObj.data, o.innerHTML);
            }

            //Add attributes to object
            for (attr in attObj) {
                if (attObj.hasOwnProperty(attr)) {
                    // filter out prototype additions from other potential libraries
                    attrLower = attr.toLowerCase();

                    // 'class' is an ECMA4 reserved keyword
                    if (attrLower === "styleclass") {
                        o.setAttribute("class", attObj[attr]);
                    } else if (attrLower !== "classid" && attrLower !== "data") {
                        o.setAttribute(attr, attObj[attr]);
                    }
                }
            }

            if (ua.ie) {
                objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
            } else {
                    o.setAttribute("type", FLASH_MIME_TYPE);
                    o.setAttribute("data", attObj.data);
                }

            el.parentNode.replaceChild(o, el);
            r = o;
        }

        return r;
    }
/* Cross-browser dynamic SWF creation
    */
Cross-browser dynamic SWF creation
Cross - browser dynamic SWF creation
function createSWF(attObj, parObj, id) {
        var r,
            el = getElementById(id);
        id = getId(id); 
        if (ua.wk && ua.wk < 312) {
            return r;
        }
        if (el) {
            var o = ua.ie ? createElement("div") : createElement(OBJECT),
                attr,
                attrLower,
                param;
            if (typeof attObj.id === UNDEF) {
                attObj.id = id;
            }
            for (param in parObj) {
                if (parObj.hasOwnProperty(param) && param.toLowerCase() !== "movie") {
                    createObjParam(o, param, parObj[param]);
                }
            }
            if (ua.ie) {
                o = createIeObject(attObj.data, o.innerHTML);
            }
            for (attr in attObj) {
                if (attObj.hasOwnProperty(attr)) {
                    attrLower = attr.toLowerCase();
                    if (attrLower === "styleclass") {
                        o.setAttribute("class", attObj[attr]);
                    } else if (attrLower !== "classid" && attrLower !== "data") {
                        o.setAttribute(attr, attObj[attr]);
                    }
                }
            }
            if (ua.ie) {
                objIdArr[objIdArr.length] = attObj.id; 
            } else {
                    o.setAttribute("type", FLASH_MIME_TYPE);
                    o.setAttribute("data", attObj.data);
                }
            el.parentNode.replaceChild(o, el);
            r = o;
        }
        return r;
    }
function createSWF ( attObj , parObj , id ) { var r , el = getElementById ( id ) ; id = getId ( id ) ; if ( ua . wk && ua . wk < 312 ) { return r ; } if ( el ) { var o = ua . ie ? createElement ( "div" ) : createElement ( OBJECT ) , attr , attrLower , param ; if ( typeof attObj . id === UNDEF ) { attObj . id = id ; } for ( param in parObj ) { if ( parObj . hasOwnProperty ( param ) && param . toLowerCase ( ) !== "movie" ) { createObjParam ( o , param , parObj [ param ] ) ; } } if ( ua . ie ) { o = createIeObject ( attObj . data , o . innerHTML ) ; } for ( attr in attObj ) { if ( attObj . hasOwnProperty ( attr ) ) { attrLower = attr . toLowerCase ( ) ; if ( attrLower === "styleclass" ) { o . setAttribute ( "class" , attObj [ attr ] ) ; } else if ( attrLower !== "classid" && attrLower !== "data" ) { o . setAttribute ( attr , attObj [ attr ] ) ; } } } if ( ua . ie ) { objIdArr [ objIdArr . length ] = attObj . id ; } else { o . setAttribute ( "type" , FLASH_MIME_TYPE ) ; o . setAttribute ( "data" , attObj . data ) ; } el . parentNode . replaceChild ( o , el ) ; r = o ; } return r ; }
Cross-browser dynamic SWF creation
Cross - browser dynamic SWF creation
// ensure id is truly an ID and not an element // if no 'id' is defined for the object element, it will inherit the 'id' from the fallback content //Add params //filter out prototype additions from other potential libraries and IE specific param element //Create IE object, complete with param nodes //Add attributes to object // filter out prototype additions from other potential libraries // 'class' is an ECMA4 reserved keyword // stored to fix object 'leaks' on unload (dynamic publishing only)