Using swfObject with MooTools

javascript code:

window.addEvent('domready', function() {

var flashcontainer = $('flashcontainer');

var file = 'file.swf';
var moviename = 'nameMyFlash';
var width = '640';
var height = '424';
var version = '9';
var bgcolor = '#000000';

var embedFlash = function(){
var so = new SWFObject(file, moviename, width, height, version, bgcolor);
so.addParam('quality', 'high');
so.addParam('align', 'middle');
so.addParam('play', 'true');
so.addParam('loop', 'true');
so.addParam('scale', 'exactfit');
so.addParam('allowFullScreen', 'true');
so.addVariable('variable1', 'variable 1 value goes here');
so.addVariable('variable2', 'variable 1 value goes here');
so.write(flashcontainer);
}

var myButton = $('mybutton');
myButton.addEvent('click', embedFlash);

});