Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    <div id="carbon_app" class="carbon-app">
    ...
    </div>
    <script type="text/javascript">
    // <![CDATA[

    var so = new SWFObject("/modules/carbon/CarbonFlash.swf?fileName=/modules/carbon/mannequin_list.php", "CarbonFlash", "100%", "100%", "8", "#cccccc","high");
    so.addVariable("allowScriptAccess", "sameDomain");
    so.write("carbon_app");

    // ]]>
    </script>

    --The above code get's an error in firefox that 'var n' is not defined - that's in the function so.write(). Using the source(uncompressed) version works fine.
  2.  
    Sorry didn't mention, this is the 1.5 version
    • CommentAuthorblackkite
    • CommentTimeApr 6th 2007
     
    check these first. Is this a variable or parameter?
    so.addVariable("allowScriptAccess", "sameDomain");

    and what is this ---> "high")
  3.  
    ======function in swfobject_source.js============
    write: function(elementId){
    if(this.getAttribute('useExpressInstall')) {
    // check to see if we need to do an express install
    var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
    if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
    this.setAttribute('doExpressInstall', true);
    this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    this.addVariable("MMdoctitle", document.title);
    }
    }
    if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
    var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
    n.innerHTML = this.getSWFHTML();
    return true;
    }else{
    if(this.getAttribute('redirectUrl') != "") {
    document.location.replace(this.getAttribute('redirectUrl'));
    }
    }
    return false;
    }
    ======================================
    The line that causes the error is this... var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; - it's in bold above.

    var n should be true/false but the error says it's not defined - this must be a bug with the compressor their using.
  4.  
    sorry var n should equal the DOM object that was passed in as an argument to the function...
    • CommentAuthorGeoff
    • CommentTimeApr 6th 2007
     
    it should be fine as long as you have an element in your document with an id of "carbon_app"

    that line referenced above just lets you pass in either a string or an html element reference to write the swf into.
    • CommentAuthorAran
    • CommentTimeApr 6th 2007
     
    OneStiffRod

    I have tested the below with Firefox and the compress 1.5 js, and it gets no errors. Try this simple test case, then re-introduce you css classes etc. Notice the addPram rather than addVariable, and removeal of "high" as that is the default value set by swfObject anyhow.

    <html>
    <head>
    <script type="text/javascript" src="swfobject.js"></script>
    </head>

    <body>
    <div id="carbon_app">
    test this
    </div>
    <script type="text/javascript">
    // <![CDATA[
    var so = new SWFObject("("/modules/carbon/CarbonFlash.swf?fileName=/modules/carbon/mannequin_list.php", "CarbonFlash", "100%", "100%", "8", "#cccccc");
    so.addParam("allowScriptAccess", "sameDomain");
    so.write("carbon_app");
    // ]]>
    </script>
    </body>
    </html>
    • CommentAuthorblackkite
    • CommentTimeApr 6th 2007
     
    The following decleration is more simple and readable.

    // <![CDATA[
    var so = new SWFObject("("/modules/carbon/CarbonFlash.swf", "CarbonFlash", "100%", "100%", "8", "#cccccc");
    so.addParam("allowScriptAccess", "sameDomain");
    so.addVariable("fileName","/modules/carbon/mannequin_list.php");
    so.write("carbon_app");
    // ]]>