function work1() {
var test = document.getElementById("player");
var arr = tracks.split(",");
flashvars="";
for (var i=1; i<=arr.length-1; i++) {
VK.Api.call("audio.search", {q: arr[0] + " " + arr[i] }, function (r) {
flashvars = '<param name="flashvars" value="comment=' + i + '&m=audio&file=' + r.response[1].url + '" />';
});
object = document.createElement("object");
object.type = "application/x-shockwave-flash";
object.data = "player.swf";
object.width = "400";
object.height = "55";
var bgcolor = '<param name="bgcolor" value="#ffffff" />';
var asa = '<param name="allowScriptAccess" value="always" />';
var movie = '<param name="movie" value="player.swf" />';
object.innerHTML = bgcolor + asa + movie + flashvars;
test.appendChild(object);
};
};
function AddParam(name, value) {
if(0 /*@cc_on + 1 @*/) return ['<PARAM name="', name, '" value="', value, '" />'].join('');
else {
param = document.createElement("param");
param.innerHTML = ['<PARAM name="', name, '" value="', value, '" />'].join('');
return param;
};
};
В Firefox 4 beta 7(8) такой вот нефеншуйный код работает.
В Chrome flashvars пропадают(param не создается) где-то по пути. Теряюсь в догадках.