Hi,
I found a post about detecting focus for an HTML page containing a flash movie. I have a problem with buttons in an MP3 player not working correctly when changeing HTML pages. However, when I test this code…
<HTML>
<BODY onFocus=“alert(‘you have focus’);” onBlur=“alert(‘blur’);”>
test focus
</BODY>
</HTML>
If I select the page, it traces I have focus. If I select the player that is embedded in the HTML page, it traces blur. I am not sure this is my issue with the buttons not responding correctly when changing pages as it also seems to be from the initial load. The play button must be selected, then stopped, then selected again. After that, everything works until you change page focus and return to the player.If I load the player by itself, it works fine. Although, I need the HTML page to allow users to load their own MP3’s into the player. Here is a demo of the player embedded in an HTML page…
[color=#696f7c]http://www.ntdesigns.net/demo/NTplayer.html[/color]
Is focus one of my issues here?
I also seem to have an issue with my random play function. It works when testing in author mode, but doesn’t work with either the .swf or the .swf embedded in an HTML page. Here is what I have for the random play function…
_root.onLoad = function() {
randomPlay();
}
randomPlay = function () {
list = _root.lBox.labels.length;
_root.lBox.setSelectedIndex(random(list));
myRandomSong = _root.lBox.getSelectedItem().label;
myRandomArtist = _root.lBox.getSelectedItem().data;
newSound(targetPath+myRandomSong+".mp3");
_root.status.text = "Playing";
_root.artist.text = myRandomArtist;
_root.song.text = myRandomSong;
}
Anyone have any ideas of what I have done wrong?
Thanks in advance
NTD