PDA

Volledige versie bekijken : change bg color


damarez
%Europe/Berlin %843 %2005, 21:14
Hey beste flashers
Ik heb een tutorial gevolgd op actionscript.org
over het veranderen van de achtergrondkleur met java script
en het werkt.
Alleen werkt het niet als ik het voor flash 7 publiceer.
dit gebruik ik voor een button

on (press) {
getURL("JavaScript:changeBgColor('#0066ff')");
}

en dit is het html gedeelte gedeelte

<SCRIPT LANGUAGE=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function bgColorMovie_DoFSCommand(command, args) {
var bgColorMovieObj = InternetExplorer ? bgColorMovie : document.bgColorMovie;
//
//I add my code here

// We evaluate the string contained in the "command" variable ("newBgColor")

//and if it contains the desired value we assign the argument

//(the hex value) as the value of bgColor property of the document object


if (command == "newBgColor")
{
document.bgColor=args
}
//OK I'm done
}
// Hook for Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub bgColorMovie_FSCommand(ByVal command, ByVal args)\n');
document.write(' call bgColorMovie_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</SCRIPT\> \n');
}
//-->
</SCRIPT>

wat doe ik fout of wat gaat er mis

alvast bedankt
weet niemand dit?????

damarez
%Europe/Berlin %378 %2005, 10:04
hartelijk bedankt
voor de vele reacties!!

mknol
%Europe/Berlin %463 %2005, 12:07
[html]function bgColorMovie_DoFSCommand[html]
on (press) {
getURL("javascript:changeBgColor('#0066ff')");
}
Sorry dat ik het zeg, maar je hebt in je javascript een hele andere functie, dan die je aanroept op je script.
Post eens een link naar die actionscript.org.

Ps. wat bedoel je met je laatste post?