-
Embedded Video SWF won't play: corrupted?
hi all. I have an embedded video SWF file, with a preloader, that plays fine on the hard drive, but no matter what I try it won't play on the server. The preloader loads to 100%, but won't engage the video.
Here's the catch: the same files used to play fine, now they won't.
So i strongly believe the problem does NOT lie with the preloader.
What else might be wrong, besides the preloader?
is the file corrupted somehow? Anyone have any experience with this?
thanks for venturing a guess.
fp
-
Flash Video Moderator
What is your preloader script?
-
hi Wheels. I sure HOPE it's only a matter a faulty preloader script.
that would fill me with hope. Here's the preload code.
code:
function preload(preloadContent){
//turns on and initializes the preloader
preloader._visible = 1;
preloader.bar._yscale = 0;
preloader.display.text = "0% loaded";
//sets an interval to update the loading progress
intervalId = setInterval(preloadCallback,10,preloadContent);
}
function preloadCallback(preloadContent){
//initializes variables to track the loading progress
var download = 0;
var downloaded = 0;
var percentLoaded = 0;
//grabs the total and loaded bytes
download = preloadContent.getBytesTotal();
downloaded = preloadContent.getBytesLoaded();
percentLoaded = Math.ceil(downloaded/download*100);
//updates the preloader display
preloader.display.text = percentLoaded + "% loaded";
preloader.bar._yscale = percentLoaded;
updateAfterEvent();
//sees if it's finished
if (downloaded == download && download > 0){
preloadContent.gotoAndPlay(2);
//deletes the interval and turns off the preloader
clearInterval(intervalId);
preloader._visible = 0;
}
}
I also have a stop action on the first frame, where the function is called. There aren't any scenes. when it's loaded the playhead jumps
to frame 2, the first frame of my video. the video is 778K.
thanks for taking a look!
fp
-
Flash Video Moderator
I would use an onEnterFrame instead of the setInterval - this may be the reason you are jumping to frame 2.
I think this is the culprit:
Code:
percentLoaded = Math.ceil(downloaded/download*100);
try Math.floor
-
thanks, Wheels. I'll tinker around with it and show up when I have some results.
fp
-
Flash Video Moderator
Here's a link to a solution I posted a few weeks ago.
http://www.flashkit.com/board/showth...hreadid=548903
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|