0
Using allowScriptAccess with Flash MP3 Player
Community Beginner
,
/t5/animate-discussions/using-allowscriptaccess-with-flash-mp3-player/td-p/135700
Nov 01, 2008
Nov 01, 2008
Copy link to clipboard
Copied
I am working on a music web site and have an AS3 MP3 player
that effectively plays from an XML list. However, I need to be able
to direct the player to play from a list of songs in an html page.
To do this I have included the parameter to allowScriptAccess always. I have embedded the MP3 player using swfObject (see the attached code) but there is some kind of communication missing between the script and the player.
Any suggestions will be greatly appreciated.
Thanks.
To do this I have included the parameter to allowScriptAccess always. I have embedded the MP3 player using swfObject (see the attached code) but there is some kind of communication missing between the script and the player.
Any suggestions will be greatly appreciated.
Thanks.
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/animate-discussions/using-allowscriptaccess-with-flash-mp3-player/m-p/135701#M3855
Nov 01, 2008
Nov 01, 2008
Copy link to clipboard
Copied
I am not sure you can communicate with swf via reference to
the object.
A native way to accomplish what you need would be to use ExternalInterface.addCallback() method.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html#addC...
A native way to accomplish what you need would be to use ExternalInterface.addCallback() method.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html#addC...
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Rouviere Media
AUTHOR
Community Beginner
,
LATEST
/t5/animate-discussions/using-allowscriptaccess-with-flash-mp3-player/m-p/135702#M3856
Nov 03, 2008
Nov 03, 2008
Copy link to clipboard
Copied
Andrei1,
I am using the ExternalInterface.addCallback() method as follows:
ExternalInterface.addCallback("playSong", loadTrack);
I reviewed the livedocs reference you provided above, but I am not sure how to adapt this code:
<script language="JavaScript">
var jsReady = false;
function isReady() {
return jsReady;
}
function pageInit() {
jsReady = true;
document.forms["form1"].output.value += "\n" + "JavaScript is ready.\n";
}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function sendToActionScript(value) {
thisMovie("ExternalInterfaceExample").sendToActionScript(value);
}
function sendToJavaScript(value) {
document.forms["form1"].output.value += "ActionScript says: " + value + "\n";
}
</script>
to my situation. Is it possible to get some guidance on this? In my current project I am working with mp3 sound files.
Any guidance you can provide would be greatly appreciated.
Thank you.
I am using the ExternalInterface.addCallback() method as follows:
ExternalInterface.addCallback("playSong", loadTrack);
I reviewed the livedocs reference you provided above, but I am not sure how to adapt this code:
<script language="JavaScript">
var jsReady = false;
function isReady() {
return jsReady;
}
function pageInit() {
jsReady = true;
document.forms["form1"].output.value += "\n" + "JavaScript is ready.\n";
}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function sendToActionScript(value) {
thisMovie("ExternalInterfaceExample").sendToActionScript(value);
}
function sendToJavaScript(value) {
document.forms["form1"].output.value += "ActionScript says: " + value + "\n";
}
</script>
to my situation. Is it possible to get some guidance on this? In my current project I am working with mp3 sound files.
Any guidance you can provide would be greatly appreciated.
Thank you.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

