FORUMS: list search recent posts

New and Need loader/scrub Help

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
New and Need loader/scrub Help
on Mar 5, 2006 at 1:35:26 am

Great Tutorials! I'm completely new to Flash and have just finished the video tutorial. I'm having some trouble with the preloader and scrubber. They appear just fine but they don't move. I can manually move the scrubber along the load bar but it doesn't affect the video playing. Everything else seems to work. I'm using Flash MX 2004 to both create my flv files and create the player as well.

Any help would be really great.
the action script is:

var nc:NetConnection = new NetConnection();

var ns:NetStream = new NetStream(nc);


playButton.onRelease = function() {

var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;

ns["onMetaData"] = function(obj) {
duration = obj.duration;

function videoStatus() {
amountLoaded = ns.bytesLoaded/ns.bytesTotal;
loader.loadbar._width = amountLoaded*273.0;
loader.scrub._x = ns.time/duration*273.0;

var scrubInterval;

loader.scrub.onPress = function() {
scrubInterval = setInterval(scrubit,10);

loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
videoInterval = setInterval(videoStatus,100);

function scrubit() {*duation));

Return to posts index

Re: New and Need loader/scrub Help
on Mar 5, 2006 at 3:10:32 am

A quick look at the code and everything looks OK, (Lee's the expert on this tho, my memory isn't that good...) I'm not sure what you mean as far as the preloader. Since the FLV is not inside the SWF, a preloaded isn't going to include the video data. You need to use the Buffer setting for that (there's a tutorial on Lee's site about that)

As for the scrubber, what are the chances that your FLV is either very short, or encoded with very few if any keyframes? The scrubber can only move to the nearest keyframe, so if you want it to be very resposive as far as where it can be scrubbed to, you need to encode your video with as many keyframes as you can afford.

You might want to also check in here to see Lee's modification to the video player code to avoid a potential problem with using 2 intervals.


I'm filling a need. Without me there would be no bad examples.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved