loadMovie that sometimes won't load

  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

I'm having a problem getting loadMovie to load my external SWF consistantly. The problem is intermitant (maybe a cache issue, though I clear it). When the problem happens, it can usually be fixed by hitting refresh. I'm using loadMovie to load an external SWF file, which is listed in an XML file. It's an XML audio player. I've had my buddies test it, and it happens about 1/4 of the time.

When it loads, I've created two dynamic text boxes to track the frame number of the movie that contains the code for my XML loader and loadMovie loader - and the number of frames loaded for my audio. I've divided the code up into more frames than needed, just to try and isolate it.

Here's the player (it's embedded below, but here's the link if you want to refresh it):
http://www.aspirin99.com/mp3/bluePlayer.html

Here's the code giving me trouble:

Code: [ Select ]

//Frame One
// Load XML Data
_root.songList = new XML();
_root.songList.ignoreWhite = true;
_root.songList.load("song_list.xml");
_root.songList.onLoad = function(success) {
    _root.nodeNum=0;
    _root.listLoaded=1;
_root.musicHolder.loadMovie(_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src);
}
//I have the loadMovie in here twice because if fails less often with it in the code twice.
//
//Frame Two:
//
if (_root.listLoaded==1) {
checkForEnd=_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src;
  if (checkForEnd==undefined) {
   _root.nodeNum=0;
  }
} else {
    gotoAndPlay(1);
}
//
//Frame Four: Labeled "wait"
//
_root.musicHolder.loadMovie(_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src);    
//
//Frame Six: // Does an animation if at least 10 frames are loaded or keeps trying to load.
//
if (_root.musicHolder._framesLoaded>10) {
_root.cover.gotoAndPlay(10);
} else {
    gotoAndPlay("wait");
}
//
//Frame Seven:
stop();
  1. //Frame One
  2. // Load XML Data
  3. _root.songList = new XML();
  4. _root.songList.ignoreWhite = true;
  5. _root.songList.load("song_list.xml");
  6. _root.songList.onLoad = function(success) {
  7.     _root.nodeNum=0;
  8.     _root.listLoaded=1;
  9. _root.musicHolder.loadMovie(_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src);
  10. }
  11. //I have the loadMovie in here twice because if fails less often with it in the code twice.
  12. //
  13. //Frame Two:
  14. //
  15. if (_root.listLoaded==1) {
  16. checkForEnd=_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src;
  17.   if (checkForEnd==undefined) {
  18.    _root.nodeNum=0;
  19.   }
  20. } else {
  21.     gotoAndPlay(1);
  22. }
  23. //
  24. //Frame Four: Labeled "wait"
  25. //
  26. _root.musicHolder.loadMovie(_root.songList.firstChild.childNodes[_root.nodeNum].attributes.src);    
  27. //
  28. //Frame Six: // Does an animation if at least 10 frames are loaded or keeps trying to load.
  29. //
  30. if (_root.musicHolder._framesLoaded>10) {
  31. _root.cover.gotoAndPlay(10);
  32. } else {
  33.     gotoAndPlay("wait");
  34. }
  35. //
  36. //Frame Seven:
  37. stop();


Here's the file embed here, but you'll probable need to see it at the link above so you can refresh it.

[flash width=500 height=100 loop=false]http://www.aspirin99.com/mp3/bluePlayer.swf[/flash]

edit to add one more thing- It's early in the build. The buttons will change, the font will change, etc. I'm just trying to get it functional.

edit- changed height of embedded swf
  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

I determined that even though the playlist.xml file loads fine as a new xml object, there are times that the contents are unavailble to the flash file. I've created a text box to trace the file name that should load. If it's not working, the box says "undefined".

Would would the xml not be made available to some and it would to others?
  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

Well, I think I fixed it by changing the urls to the MP3 to absolute URL's and changing the urls to the XML playlist to an absolute URL. I think that was it. Either that or some other tinkering I should have been paying closer attention to.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.