Peter Elst

Flash Platform Consultant
  • Home
  • About me
  • Articles
  • Downloads
  • Contact me

Publish template for JavaScript solution

10 10 2003

I’ve just finished a publish template for Flash to use with the “insertFlash” generic JavaScript solution for the upcoming IE changes. You can download the file here, simply drop it in the First Run/HTML folder of your Flash install directory and restart Flash.

You can then specify the “IE Changes Workaround” publish template in the publish settings dialog (File > Publish Settings). The exported HTML requires the file insertFlash.js to be located in the same directory for the JavaScript Flash embed to work.

There has also been an update to “insertFlash” itself, it now supports setting the required Flash player version and align property by specifying the “version” and “align” properties in the params argument.

insertFlash(”mySWF.swf”,550,400,”#FFFFFF”,{menu:false,version:”7,0,0,0″,align:”right”});

[Update] The “insertFlash” JavaScript code was just updated due to a problem with not specifying a value for the version attribute.

« IE changes, what to do next? Extending Flash MX 2004 »



Actions

Informations

  • Date : 10 October 2003
  • Categories : Flash

6 responses to “Publish template for JavaScript solution”

10 10 2003
aSH (20:53:05) :

Great contribution Peter.
Thank you.
Respectfully,
aSH

30 10 2003
Martijn de Visser (17:53:59) :

nice one!

now, on to updating my sites… ;-)

12 11 2003
B (01:34:13) :

excellent.. best solution so far :o)

14 12 2003
Alex (15:09:17) :

Here’s a suggested update to deal with flashvars and includes the color in the embed tag - I think this was missed..

function insertFlash(swf,width,height,bgcolor,params,pairs) {
// set default bgcolor if not provided
if(!bgcolor || bgcolor==”") bgcolor = “#FFFFFF”;

//parse pairs
var flashvars=”";
var writeAmp=false;
for(var i in pairs){
if (writeAmp){flashvars=flashvars+”&”;}else{writeAmp=true;}
flashvars=flashvars+i+”=”+escape(pairs[i]);
}

if(!params) params = new Object();
if(!params.version) params.version = “6,0,0,0″;
if(!params.FlashVars) params.FlashVars=flashvars;

// parse parameters
var objectParams = “”;
var embedParams = “”;
for(var i in params) {
objectParams += “\n”;
embedParams += i+”=”+params[i];
}

// write the object
document.write(”");
document.write(”");
document.write(”");
document.write(”");
document.write(objectParams);
document.write(”");
document.write(”");
}

14 12 2003
Alex (15:10:34) :

er…the code in that post above didn’t come out quite right…

14 12 2003
Peter Elst (15:16:41) :

Thanks for the suggestion Alex, the code came through alright, I’ll see what’s going wrong with it in the comments section.

Ofcourse FlashVars could already be used by specifying them in the object that gets passed to the script as an object. Color in the embed tag is an ommision on my part, that will soon get fixed. Thanks for the feedback!





Conferences

Flash on the Beach Speaker

Training Partners

multimediacollege

SkillsMatter

  • Categories

    • AIR RSS category feed
    • Ajax RSS category feed
    • CSS RSS category feed
    • Eclipse RSS category feed
    • Events RSS category feed
    • Flash RSS category feed
    • Flash Lite RSS category feed
    • Flex RSS category feed
    • Gadgets RSS category feed
    • General RSS category feed
    • JSFL RSS category feed
    • Mac RSS category feed
    • Open Source RSS category feed
    • PHP RSS category feed
    • Podcasts RSS category feed
    • Publications RSS category feed
    • Rants RSS category feed
    • Reviews RSS category feed
    • Thought of the Day RSS category feed
    • Training RSS category feed
    • Twitter RSS category feed
    • Video RSS category feed
  • Resources

    • Sam Robbins
    • Ted Patrick
    • Peter Hall
    • Matthew David
    • Owen van Dijk
    • Branden Hall
    • Marco Casario
    • Peldi Guilizzoni
    • Jonathan Kaye
    • Ralf Bokelberg
    • Keith Peters
    • Abdul Qabiz
    • Guy Watson
    • Jon Williams
    • Josh Tynjala
    • Aral Balkan
    • Stefan Richter
    • Jesse Warden
    • Mario Klingemann
    • AndrĂ© Michelle

     
     

    Adobe Community Expert

    See my profile on LinkedIn



    Harz Ferienwohnung Suchmaschinenoptimierung Geschenkideen Harz Ferienwohnung Pagerank Webkatalog Webhosting