Movieclip Scrubber
hello i'm trying to find to scrub a movieclip forward and backward based on how far right of the clips left edge the mouse is. has anyone seen anything like this before?
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-11-2006, 04:41 AM
View Complete Forum Thread with Replies
Sponsored Links:
Movieclip Scrubber Question
Hello-
I have created a movieclip scrubber that currently works fine for clicking and dragging to scrub the mc, but I also want the scrub_mc to automatically play across the loadBar at the rate of the referenced movieclip. My knowledge of actionscript is fairly beginner so I am not sure how to go about doing this. Here is the script:
this.onEnterFrame = null;
this.onPress = onPressHandler;
this.onRelease = this.onReleaseOutside = onReleaseHandler;
var boundry_mc:MovieClip = loadbar;
var lowerBound:Number = boundry_mc._x;
var upperBound:Number = boundry_mc._width + boundry_mc._x;
var target_mc:MovieClip = _root.display.clip_mc;
function onPressHandler():Void{
this.onEnterFrame = onEnterFrameDown;
}
function onReleaseHandler():Void{
this.onEnterFrame = null;
_root.display.clip_mc.play();
}
function onEnterFrameDown():Void {
dragWithin();
scrubMovie(target_mc);
}
function dragWithin():Void{
var xmousePosition = this._xmouse;
if (xmousePosition > lowerBound && xmousePosition < upperBound){
scrub._x = xmousePosition;
} else if (xmousePosition < lowerBound){
scrub._x = lowerBound;
} else if (xmousePosition > upperBound){
scrub._x = upperBound;
}
}
function scrubMovie(f_target_mc:MovieClip):Void{
var currentFrame:Number = f_target_mc.currentFrame;
var totalFrames:Number = f_target_mc._totalframes -1;
var newFrame:Number = Math.ceil(totalFrames *scrub._x / (upperBound - lowerBound));
f_target_mc.gotoAndStop(newFrame);
scrub._x = currentFrame / totalFrames;
}
The two bold red lines were my attempt to make the the scrub mc follow the x_axis to correspond to the movieclip rate. Can someone help me with this?
Thanks!
View Replies !
View Related
Help With Flv Scrubber
I have been piecing together bit's of code from various examples to build a scrubber for my flv player. The problem I am having is that when I press on the progressBar and scrub from left to right the flv reponds accordingly but the progressBar does not. So I am not sure what I am doing wrong. Hopefully someone can point me in the right direction.
Code:
_root.stop();
var netConn = new NetConnection();
netConn.connect(null);
var ns = new NetStream(netConn);
my_video.attachVideo(ns);
ns.setBufferTime(5);
ns.play("../video/Skiing.flv");
//
getTotalTime = function () {
ns.onMetaData = function(obj) {
_global.videoDuration = obj.duration;
trace(obj.duration);
};
// ns.onMetaData = function(infoObject:Object) {
// for (var propName in infoObject) {
// trace(propName+" = "+infoObject[propName]);
// }
// };
};
// monitors the current position of the playhead against the total playing time
onEnterFrame = function () {
getTotalTime();
totalPlayingTime = Math.round(_global.videoDuration);
currentPlayingTime = Math.round(ns.time);
if (totalPlayingTime == currentPlayingTime) {
ns.close();
}
};
//
percentBar.onEnterFrame = function() {
loaded = ns.bytesLoaded;
total = ns.bytesTotal;
//trace("loaded "+loaded);
//trace("total "+total)
if (loaded == total && loaded>1000) {
progressBar._width = percentBar._width;
delete this.onEnterFrame;
} else {
progressBar._width = Math.round(percentBar._width*loaded/total);
}
};
// play progress
progressBar.onEnterFrame = function() {
progressBar._width = percentBar._width*currentPlayingTime/totalPlayingTime;
//trace(progressBar._width)
};
// start playhead scrubbing
progressBar.onPress = function() {
this.onEnterFrame = function() {
scl = this._xmouse*this._xscale/percentBar._width/100;
ns.seek(scl*totalPlayingTime);
};
};
// stop playhead scrubbing
progressBar.onRelease = progressBar.onReleaseOutside=function () {
delete this.onEnterFrame;
my_video.pause();
};
//
//ns.onStatus = function(infoObject:Object) {
//statusCode_txt.text = infoObject.code;
//};
//
this.createTextField("time_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
time_txt.text = "LOADING";
var time_interval:Number = setInterval(checkTime, 500, ns);
function checkTime(my_ns:NetStream) {
var ns_seconds:Number = my_ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
if (seconds<10) {
seconds = "0"+seconds;
}
time_txt.text = minutes+":"+seconds;
}
View Replies !
View Related
[F8] Scrubber
I have been using Flash for years, but am fairly new to advanced AS.
I have been asked to create a scrubber that starts in the middle and can be dragged both ways. As it is dragged, a sequence of images needs to be shown. Particularly, it needs to show a man gradually losing weight when dragging to the left, and gaining weight when going to the right. I already have the images, but need to know how to create this kind of scrubber.
Thanks for any help!
View Replies !
View Related
Scrubber Bar
I saw a as2 tutorial on how to make a custom skin , i changed the code a little to go for as3, but i don't know how to change one thing
here is their scrubber bar code, i changed it a little
ActionScript Code:
var mdown:Boolean = false;
var dist = controls.scrub._x;
var pct = dist/controls.scrub._width;
var newVol = pct*video.totalTime;
var newX = pct*controls.scrub._width;
controls.knoob.addEventListener(MouseEvent.MOUSE_DOWN, knobd);
controls.knoob.addEventListener(MouseEvent.MOUSE_UP, knobr);
function knobd(event:MouseEvent):void
{
mdown=true;
this.startDrag(false,0, 0, controls.scrub._width, 0);
}
function knobr(event:MouseEvent):void
{
mdown = false;
this.stopDrag();
}
also if anyone knows how to make a volume bar with - and + and also a drag feature, i would really like to know
thanks in advance
View Replies !
View Related
FLV Scrubber
I am struggling with making an FLV Scrubber for my FLV Player, does anyone have any links for tuts or any simple examples that I could take a look at please??
Cheers
View Replies !
View Related
Help With Scrubber For FLV
Hi,
I'm messing with the dynamic video playlist toot from MM. I have the thing working and am trying to add some controls, specifically a scrub bar.
Heres my code (does not work)
Code:
//scrubber
createEmptyMovieClip("vFrame",getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader_mc.loadbar_mc._width = amountLoaded * 239.5;
loader_mc.scrub_mc._x = ns.time / duration * 239.5;
}
loader_mc.scrub_mc.onPress = function() {
vFrame.onEnterFrame = scrubit;
loader_mc.scrub_mc.startDrag(false,0,this._y,239,this._y);
}
loader_mc.scrub_mc.onRelease = loader_mc.scrub_mc.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
loader_mc.scrub_mc.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader_mc.scrub_mc._x/239)*duration));
}
For some reason the scrubber isint getting the info from the netStream object(ns). What am I missing?
Thanks for any help
Greg
View Replies !
View Related
SWF Scrubber
Hi,
I found a script for a swf controller but it only works when I publish out to player 5 or 6. But I need it publish out to player 8. Below is 2 sets of code that I am having probles getting to work in Player 8. They are both for the scrubber. Any help would be great. Thanks
Attach Code
setProperty(_root.player.drag.dragMC, _x, math.floor(Number(getProperty(_root.player.movie, _currentframe))/Number(getProperty(_root.player.movie, _totalframes))*200));
gotoAndPlay(_currentframe - 1);
and
tellTarget (_root.player.movie) {
gotoAndStop(math.floor(Number(getProperty (_root.player.movie, _totalframes )) * (Number(getProperty (_root.player.drag.dragMC, _x )) * .01) / 2));
if (Number(getProperty (_root.player.drag.dragMC, _x ))<5) {
gotoAndStop(1);
}
}
gotoAndPlay(_currentframe - 1);
View Replies !
View Related
Scrubber
I need to create a scrubber that starts in the middle and can be dragged both ways. As it is dragged, a sequence of images needs to be shown. Particularly, it needs to show a man gradually losing weight when dragging to the left, and gaining weight when going to the right. I already have the images, but need to know how to create this kind of scrubber.
Thanks for any help!
My FLA file so far can be seen here: http://www.terrieades.com/in_progress/flash/man.zip
View Replies !
View Related
Scrubber
I have been using Flash for years, but am fairly new to advanced AS.
I have been asked to create a scrubber that starts in the middle and can be dragged both ways. As it is dragged, a sequence of images needs to be shown. Particularly, it needs to show a man gradually losing weight when dragging to the left, and gaining weight when going to the right. I have a series of images that gradually show these changes, and I'm thinking it would work if I put these in a movieclip and had it increase or decrease by one frame in the movieclip, depending on which way the slider is moved. I already have a slider that works, but now I need to know how to connect it to the movieclip to have this kind of functionality.
Thanks for any help!
View Replies !
View Related
Scrubber
Okay I have now made the whole video component system. However my scrubber is starting at the middle on the loader bar. Also my preloader event on loader bar is starting in the middle and loading out wards toward the left and right and not starting in left corner moving right.
I am using Flash 8 to make this and I used sorensons to make the flv what gives?
Here is my AS for this hopefully someone can give me some insight as to why my scrubber starts in the middle and moves off of my player and the loader problem.
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(20);
theVideo.attachVideo(ns);
ns.onStatus = function(info) {
if (info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if (info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if (info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
};
playButton.onRelease = function() {
ns.pause();
};
rewindButton.onRelease = function() {
ns.seek(0);
};
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns.onMetaData = function (obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded/ns.bytesTotal;
loader.loadbar._width = amountLoaded*193;
loader.scrub._x = ns.time/duration*193;
}
loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false,-94,this._y,95,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/193)*duration));
}
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var i1:ContextMenuItem = new ContextMenuItem(":::: Video Controls ::::", trace);
theMenu.customItems[0] = i1;
var i2:ContextMenuItem = new ContextMenuItem("Play / Pause Video", pauseIt, true);
theMenu.customItems[1] = i2;
var i3:ContextMenuItem = new ContextMenuItem("Replay Video", replayIt);
theMenu.customItems[2] = i3;
var i4:ContextMenuItem = new ContextMenuItem("Copyright 2007 RELM Skate Park", trace, true);
theMenu.customItems[3] = i4;
function pauseIt() {
ns.pause();
}
function replayIt() {
ns.seek(0);
}
_root.createEmptyMovieClip("vSound", _root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
mute.onRollOver = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("onOver");
} else {
this.gotoAndStop("muteOver");
}
};
mute.onRollOut = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("mute");
}
};
mute.onRelease = function() {
if (so.getVolume() == 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
} else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
};
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
videoList.addItem(videos[i].attributes.desc, videos[i].attributes.url);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
};
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
};
videoList.addEventListener("change", vidList);
vlist.load("docs/videos.xml");
Any ideas help. Thanks in advance.
Kbear
View Replies !
View Related
Scrubber Bar
In the video tutorial part 4, a scrubber bar is created, but Sorensen Squeeze is used to accomplish this. Is Sorensen Squeeze the only way to go or can I accomplish building a scrubber bar without this.
Thanks...I'm not sure I want to purchase more software right now.
View Replies !
View Related
Timeline Scrubber
Hi,
i wonder if it is possible to create a timeline scrubber (much like in quicktime) which allows you to scroll though an externally loaded swf`s timeline?
any ideas?
G.
View Replies !
View Related
[F8] Scrubber Effect
I have a slider that I want to be able to drag from left to right.
As you drag the slider to the right, I have a movie clip of a circle on a curved path and I want it to be able to move down the path as you drag the slider to the right, and then move up the path as you drag the slider to the left.
The circle and it's guide path are in a separate movie clip where I have it tweened to move it up and down it's guide.
What I'm trying to do is have the slider actually be able to scrub back and forth the movie clip with the circle. Here is the slider code and the movie clip with the circle is called "axisUpDown". Thanks for any suggestions you may have on how to approach this.
slider.slideBar.onPress = function() {
startDrag(this, false, 0, 0, 310, 0);
this.onMouseMove = function() {
_root.axisUpDown.nextFrame();
};
};
slider.slideBar.onRelease = slider.slideBar.onReleaseOutside=function () {
stopDrag();
};
View Replies !
View Related
Problems With Scrubber Bar
I am following the tutorials in gotoandlearn.com, they are awesome,
The problem I have is the scrubber bar does not work in my code. I have looked over it time and time again, but cannot seem to see any errors
any ideas please!
//Set up the list box, call function VideoThumb to create the actual thumbnails
list.rowHeight = 70;
list.cellRenderer = "VideoThumb";
list.selectable = true;
//create new empty listener object
listListener = {};
//Function to handle what happens when an item in the list is selected
listListener.change = function( evtobj ) {
var nav = list.dataProvider[list.selectedIndex];
nc = new NetConnection(); //create a connection
nc.connect( null );//null connection for progressive download
ns = new NetStream(nc); //create a stream
video.attachVideo(ns); //pipe stream to this video object
// walk through the chosen item, build and play it
var reset = true;
for ( var i = 0; i < nav.childNodes.length; i++ ) {
var stream = nav.childNodes[i];
if ( stream.nodeName == "stream" ) {
// build path to flv, and play it
myStreamPath = nav.attributes.url + "/" + stream.attributes.name;
ns.setBufferTime(10);
ns.play( myStreamPath);
reset = false;
}
}
}
//Add an event listener on the list, when it triggers, run the listListener function to repopulate the list
list.addEventListener("change", listListener);
//Function that loads the XML file, parses it, and builds the list of available video clips
var xmllist = new XML(); //setup a variable to hold the XML
xmllist.ignoreWhite = true;
xmllist.load( "playlist-demo-1.xml" ); //load the XML file
//The following gets called when the XML has been loaded
xmllist.onLoad = function( status ) {
if ( !status )
trace( status );
var entries = this.childNodes[0];
var playlists = {};
var nav = [];
for ( var i = 0; i < entries.childNodes.length; i++ ) {
var entry = entries.childNodes[i];
if ( entry.nodeName == "listitem" )
//builds array of video clip names
playlists[entry.attributes.name] = entry;
else if ( entry.nodeName == "menu" ) {
//builds array of available videos
for ( var j = 0; j < entry.childNodes.length; j++ )
nav[j] = playlists[entry.childNodes[j].attributes.name];
} //end else if
} //end if
//sends the array of videos to the listbox UI
list.dataProvider = nav;
} //end xmllist.onload
//resizes the video object to the width and height of the clip
function onVideoResize() {
if ( video.width != video._width || video.height != video._height ) {
video._width = video.width;
video._height = video.height;
//center video in playback area
newx = (460 - video._width)/2;
newy = (470 - video._height)/2;
video._x = newx;
video._y = newy;
}
}
setInterval( onVideoResize, 200 ); //keeps checking video size
rewindButton.onRelease = function() {
ns.seek(0);
}
playButton.onRelease = function() {
ns.pause();
}
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 * 297.9;
loader.scrub._x = ns.time / duration * 297.9;
}
View Replies !
View Related
Timeline Scrubber
Hi Guys,
I am in desperate need of a timeline control in the form of a slider bar or similar. All i need it to do is click and drag the slider button to the right and play frames in a movieclip timeline and slide it to the left reverse the animation. on release i just need it to stop on the frame its at.
I figured this would be easy but as i am a novice i cant work it out.
any help would be appreciated.
thanks
View Replies !
View Related
Scrubber Bar Trouble
Hello everyone,
I am putting together an xml driven mp3 player. I have pretty much the simple functions of the player functioning, for the exception of the scrubber bar. I cannot wait for the new tutorials now being offered at gotoandlearn.com. This project as with everything is on a deadline.
Here's the swf in action:
http://mfkmediaworks.com/lectureCast.html
Here's the link to the .as file:
http://mfkmediaworks.com/lectureCast.as
The scrubber code is mainly found on lines 52 to 68.
When scrubbing the audio to the end of the audio, when you release it the scrubber places itself at a slightly different location.
Secondly, when a sound is complete, the scrubber bar does not reset to its start position. I do not know what I am missing.
Thank you for your help. I really appreciate it.
mfkpro.
View Replies !
View Related
Scrubber Problems.
I hope someone can help me.
I've created my own media player to play an embedded flv. The media player is in its own swf. On my website, I have the 'media' swf playing in my 'website' swf. The scrubber works perfectly when viewed alone (with the '_root' prefix), but when the swf is called into my website (with '_parent' prefix), it does not completely work. I realize that the code needs the _parent and _parent._parent so that the buttons only control the 'media' swf. The video plays and you can skip to another frame by clicking on the slider bar and/or dragging the scrubber button...however, the button does not move on its own.
Here is the script I have directly on the scrubber button mc:
onClipEvent(load){
xPos = _x;
yPos = _y;
}
onClipEvent(enterFrame){
if(!_parent.readyToMove){
_x = _parent.xPos + (_parent._currentframe/_parent._totalframes * 2000);
}
}
Here is the script I have directly on the scrubber button:
on (press){
_parent._parent.readyToMove = true;
startDrag(this,false,xPos,yPos,xPos+2000,yPos)
_parent._parent.gotoAndStop(Math.round((_x+990)/2000*_parent._parent._totalframes));
}
on (release){
_parent._parent.readyToMove = false;
_parent._parent.gotoAndPlay(Math.round((_x+990)/2000*_parent._parent._totalframes));
stopDrag();
}
And here is the script I have directly on the slider/scrub bar:
on (press) {
_parent.readyToMove = true;
_parent.stop();
}
on (release) {
_parent.readyToMove = false;
_parent.gotoAndPlay(Math.round((_xmouse+1000)/2000*_parent._totalframes));
stopDrag();
}
Please Help Me!
View Replies !
View Related
FMS: MP3 Duration And Scrubber
I am playing a mp3 file from FMS. I need to check the duration, and also I need a scrubber so that user can drag the scrubber and jump to any part of audio quickly.
Ideas, codes or examples much appreciated!
Thanks,
Fuzzy
This is the link to my original post http://www.actionscript.org/forums/s....php3?t=145834
View Replies !
View Related
Progression Bar/scrubber
I want to include a progression bar in an .fla/.swf file -- not an .flv -- that the user can click and drag to move forward or back in an animation.
Can you use the same kind of progression bar/scrubber that works for an .flv in an .swf? If not, can anyone recommend a Web site where I might find instructions (AS3) for how to build one that would work with an .swf?
Thanks!
--J
View Replies !
View Related
Can't Get Scrubber To Work
Hello there actionscript experts! I am having a lot of trouble getting my mp3player scrubber to work. Basically when you click and drag on the backgroundBar_mc movieclip a line appears that you can drag across the timeline. When you depress then the song should recalculate and play from that position and the progressBar_mc should re size accordingly.
The problem with my script is that is does this but with the wrong calculations. When I depress near the beginning of the song it works fine. When I depress around the end it gets all messed up! Why?!
Here is what I've got. If you know what would be causing the problem please post back. Thank you!!
ActionScript Code:
var requestSound:URLRequest = new URLRequest("song.mp3");
var sound:Sound = new Sound();
var soundChannel:SoundChannel;
var rectangle = new Rectangle(2,backgroundBar_mc.ghostKnob.y,backgroundBar_mc.width,0);
sound.load(requestSound);
var position:Number = new Number();
pause_btn.visible = false;
progressBar_mc.visible = false;
leftpeak_mc.visible = false;
rightpeak_mc.visible = false;
backgroundBar_mc.ghostKnob.visible = false;
var dragging:Boolean = false;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
backgroundBar_mc.addEventListener(MouseEvent.MOUSE_DOWN, backgroundBarDown);
stage.addEventListener(MouseEvent.MOUSE_UP, backgroundBarUp);
function backgroundBarDown(event:MouseEvent):void
{
dragging = true;
backgroundBar_mc.ghostKnob.visible = true;
backgroundBar_mc.ghostKnob.startDrag(true,rectangle)
progressBar_mc.addEventListener(Event.ENTER_FRAME, adjustBar);
function adjustBar(event:Event):void
{
if (dragging == true)
{
backgroundBar_mc.ghostKnob.width = 2;
soundChannel.stop();
pause_btn.visible = false;
play_btn.visible = true;
}
}
}
function backgroundBarUp(event:MouseEvent):void
{
if (dragging == true)
{
dragging = false;
stopDrag();
backgroundBar_mc.ghostKnob.visible = false;
// Calculate full time of this track
var fullTime:int = Math.floor(sound.length / 1000);
// Claim a var for the position the song is where we release the scrubber after dragging
var newPos:Number = fullTime / 100 * Math.floor(backgroundBar_mc.ghostKnob.x * 1000);
// Important to set new pause position here
position = newPos / 2;
soundChannel = sound.play(position);
play_btn.visible = false;
pause_btn.visible = true;
stage.addEventListener(Event.ENTER_FRAME, animateGraphics);
function animateGraphics(event:Event):void
{
leftpeak_mc.visible = true;
rightpeak_mc.visible = true;
leftpeak_mc.scaleY = soundChannel.leftPeak;
rightpeak_mc.scaleY = soundChannel.rightPeak;
progressBar_mc.visible = true;
progressBar_mc.scaleX = (soundChannel.position / sound.length) * (sound.bytesLoaded / sound.bytesTotal);
backgroundBar_mc.scaleX = sound.bytesLoaded / sound.bytesTotal;
}
}
}
function playSound(event:MouseEvent):void
{
soundChannel = sound.play(position);
play_btn.visible = false;
pause_btn.visible = true;
stage.addEventListener(Event.ENTER_FRAME, animateGraphics);
function animateGraphics(event:Event):void
{
leftpeak_mc.visible = true;
rightpeak_mc.visible = true;
leftpeak_mc.scaleY = soundChannel.leftPeak;
rightpeak_mc.scaleY = soundChannel.rightPeak;
progressBar_mc.visible = true;
progressBar_mc.scaleX = (soundChannel.position / sound.length) * (sound.bytesLoaded / sound.bytesTotal);
backgroundBar_mc.scaleX = sound.bytesLoaded / sound.bytesTotal;
}
}
function pauseSound(event:MouseEvent):void
{
position = soundChannel.position;
soundChannel.stop();
pause_btn.visible = false;
play_btn.visible = true;
}
View Replies !
View Related
Time Scrubber
Anyone know of any good tutorials on how to make a time scrubber for my flash animation?
One that has full control and able to slide my animation back and forth ect?
Or if not even some script to get me started. Im very new to flash and action script, so even if I knew what to call would help.
thanks
View Replies !
View Related
A Scrubber Bar Question
http://video-excel.com/cpso_flash.html
hi - i am cheating on a scrubber bar i made on the above SWF. i basically made a movie clip, then added the frames to it to match the length of the video clip. for example, the video on scene 2 [the scene with the gal signing to you] is about 28 seconds. and the FLA is set at 30 fps. so i did 28 x 30 = ___ to get the number of frames needed to be added to the movie clip.
it seems to have worked ok so far, but there's a lot of hit and miss in trying to get the bar as close to the end of the video. but i am wondering if there's an easier way to make the green scrubber bar function precisely based on the playback of the video? and FYI - i am absolutely horrible with actionscript, so if anyone can send the script snippet, that would be wonderful.
thanks - deaf guy mike
View Replies !
View Related
Position Of Scrubber Bar
We will be running an flv video showing an on-screen video and in turn we will be syncing other screen events to the position of the speaker’s scrubber bar.
(We do not plan to imbed any cue points in the video since this will complicate content development. Instead, we will be storing the list of events and their timing in a data base.)
The application is designed to continually monitor the position of the scrubber bar and then look at the database to see if it needs to change any of the screen events. For example, when the flv reaches 23 seconds, the database will indicate that we need to show a JPEG. Likewise, if the user herself moves the scrubber bar to say 44 seconds, then when she releases the mouse button, we will again check the database and present the appropriate media element.
That said, here is the question: When the student is holding the button down on the scrubber bar, is there a way to continually monitor the bar’s temporal position while she is scrubbing forward or back? If so, then would it be possible to use this time-value to be able to constantly update the synced onscreen activities?
I'd appreciate any help !
View Replies !
View Related
Problems With A Scrubber
I'm building a standard player that plays animations that I can place into a default movieclip. Mainly for animations being used in presentations.
I made a standard controller that has a playbutton, a pause-button and a scrubber that shows the progress of the movieclip being played and enables a user to drag the playhead to scroll trough the animation within the movieclip.
I'm as far so that the scrubber and the play/pause buttons work but after using the scrubber the playbutton does not work.
The main code is attached, can anyone spot what I'm doing wrong?
Any help is much appreciated!
Victor
Attach Code
this._lockroot = true;
stop();
Animation.stop();
//VARS
var aniTime:Number = Math.round(this.Animation._totalframes);
var myScrub:Number = Controller.scrubber.scrubHandle._x;
var AniPosi:Number = Math.round(myScrub / 340 * aniTime);
var progPerc:Number = Math.round((curFrame / aniTime) * 340);
var curFrame:Number = Math.round(this.Animation._currentframe);
//PLAY PAUSE
Controller.playBut.onRelease = function() {
PlayIt();
}
function PlayIt() {
Animation.play();
}
Controller.pauseBut.onRelease = function() {
Animation.stop();
}
//SCRUBBER
onEnterFrame = function() {
handleHandler();
Controller.scrubber.scrubHandle.onPress = function() {
startDrag(this, true, 0,0,340,0);
onEnterFrame = function() {
setAnimationPosition();
PlayIt();
}
}
Controller.scrubber.scrubHandle.onRelease = function() {
stopDrag();
handleHandler();
}
Controller.scrubber.scrubHandle.onReleaseOutside = function() {
stopDrag();
handleHandler();
}
}
function setAnimationPosition() {
Animation.stop();
var aniTime:Number = Math.round(this.Animation._totalframes);
var myScrub:Number = Controller.scrubber.scrubHandle._x;
var AniPosi:Number = Math.round(myScrub / 340 * aniTime);
if(AniPosi < 2){
AniPosi = 2;
}
Animation.gotoAndStop(AniPosi);
handleHandler();
}
function handleHandler() {
var aniTime:Number = Math.round(this.Animation._totalframes);
var curFrame:Number = Math.round(this.Animation._currentframe);
var progPerc:Number = Math.round((curFrame / aniTime) * 340);
Controller.scrubber.scrubHandle._x = progPerc;
}
View Replies !
View Related
Scrubber Jumping
Hi,
I am using the attached code to scrub a video, and the problem I am encountering is that it is not working smoothly. When I grab the players scrubber (scrubKnob_mc) and move it to e.g. halfway through the video and release it, it jumps back to its original position before jumping back to where I released it, and resuming playback from this position.
Also the position indicator (scrubberIndicator_mc) does follow the scrubber only very reluctantly.
Can this have anything to do with the video / flv encoding, or the interval rates I am using?
Thanks,
Nik C
Attach Code
///////////////////////////////////////////////////
/// Scrubber
///////////////////////////////////////////////////
var videoInterval = setInterval(ScrubberUpdate,40);
function ScrubberUpdate() {
scrubber_mc.scrubKnob_mc._x = (ns.time/nsDuration) * 327;
scrubber_mc.scrubberIndicator_mc._width = (ns.time/nsDuration) * 327;
}
var scrubberInterval;
scrubber_mc.scrubKnob_mc.onPress = function() {
clearInterval(videoInterval);
scrubberInterval = setInterval(scrubVideo,50);
this.startDrag(false,0, this._y,327,this._y);
}
scrubber_mc.scrubKnob_mc.onRelease = scrubber_mc.scrubKnob_mc.onReleaseOutside = function() {
clearInterval(scrubberInterval);
videoInterval = setInterval(ScrubberUpdate,40);
this.stopDrag();
}
function scrubVideo() {
ns.seek(Math.floor((scrubber_mc.scrubKnob_mc._x/327)*nsDuration));
scrubber_mc.scrubberIndicator_mc._width = (ns.time/nsDuration) * 327;
}
View Replies !
View Related
FLV Playhead And The Scrubber
Morning everyone...
nearing the end of building my own flv player but have a little concern with the scrubber I have built to manipulate the playhead. Generally the scrubber does as it should - you drag it to a point and the video seeks to the 'corresponding' time. However on rlease of the scrubber the playhead jumps a few pixels away from its release point (most of the time this jump is to the right or a point in time after the release point but it does sometimes jump backwards).
Why is this so? I have read about the seek() method jumping to the nearest keyframe in the video. If this is the issue, what kind of period should I use for keyframe spanning in my mencoder app to yield a smoother experience? (and I suppose the relevant mencoder command ;))
View Replies !
View Related
Mp3 Progress Bar Scrubber
After getting the progress bar working and implementing the scrubber part, I notice that the further I skip into the song, the further away the song gets from where I click. IE when I click about halfway along the bar it skips to nearly the end of the song.
(declared earlier)
blargCast.loaded = theSource.getBytesLoaded()/theSource.getBytesTotal();
scrubber_mc.onPress = function(){
var pos = scrubber_mc._xmouse/100;
blargCast.pauseTime = pos * blargCast.duration/blargCast.loaded;
blargCast.resume ();
}
See anything wrong? I've tried messing with the orientation of the bar to the center of the movie clip but it doesn't seem to do anything but aggravate the situation.
Any suggestions or examples of sound scrubbers that function properly?
Edit: Oh yeah, its Flash MX Pro 2004
View Replies !
View Related
Scrubber Bar Troubles
Hello everyone,
I am putting together an xml driven mp3 player. I have pretty much the simple functions of the player functioning, for the exception of the scrubber bar. I cannot wait for the new tutorials now being offered at gotoandlearn.com. This project as with everything is on a deadline.
Here's the swf in action:
http://mfkmediaworks.com/lectureCast.html
Here's the link to the .as file:
http://mfkmediaworks.com/lectureCast.as
The scrubber code is mainly found on lines 52 to 68.
When scrubbing the audio to the end of the audio, when you release it the scrubber places itself at a slightly different location.
Secondly, when a sound is complete, the scrubber bar does not reset to its start position. I do not know what I am missing.
Thank you for your help. I really appreciate it.
mfkpro.
View Replies !
View Related
Flv Scrubber Position
Here is an example of what I am having problems with when setting up a flv player. With this setup your scrubber has a centered registration point. so half of it extends over the actual scrubber bar on the left side and half on the right side at the end of the movie. If you set it to a left orientation then it works correctly at the beginning of the movie with the scrubber contained with in the scrubber bar but then at the end of the movie it extends completely past the scrubber bar.
Any ideas on how to at all times have the scrubber contained within the scrubber bar and have it work as it should?
View Replies !
View Related
FLV Video Scrubber
Hi all,
First let me thank all those that will reply and answer to this post.
I am playing flv files on a site. The way I am bring them is via the import video from the library (not using flv component). I am loading the videos via using netStream. So far so good. Everything works fine.
Now, here is what I want to do.
I want to be able to scrub through the video by clicking and dragging left or right on the video itself. I plan to make the mouse cursor turn into a symbol that has a left and right arrow when you roll over the video hence letting you know that you can click and drag left or right to forward or rewind through the video. IS this possible? If so, how can I accomplish this? A point in the right direction would be very apprciated. Even more appreciate is the script to how this can be done. Again, if it's possible.
Thank you All!
View Replies !
View Related
Flv Scrubber Problem
Hey everyone. Having a problem w/ a scrubber I made for some flv files.
I followed the gotoandlearn.com tutorials to create it, which was a tremendous help.
I have a page that has multiple videos that the user can watch.
The scrubbers work correctly the first time to seek through the videos, but then once that video(flv file) gets reloaded to watch again the scrubber jumps around and works incorrectly.
Anyone has any idea on why it would work once, then when you reload it, it doesn't?
Any help would be awesome. Thanks a lot.
View Replies !
View Related
Sound Scrubber Help
im thinking in a process to create like a real sound scrubber (you actually hear the sound FF or RW that is streaming), im doing this by starting a startDrag function process and inside it a mouseMove process, and inside it it has something like this:
if mouseMove detected then sound.start(calculation of position of scruber)
so basically it actually play something... my problem is, and maybe you already figured out that lol, since i start again the sound.Start()... when i dont move the mouse WHILE still in the drag process (still has the mouse button down), the sound keeps playing it and theres no mouse movement...
im asking for help HOW to detect the mouse isn't moving lol
View Replies !
View Related
Custom FLV Scrubber
For some reason my scrubber won't scrub correctly while the video is loading, but once it has completed it scrubs just fine. Here is my code
Code:
var scrubInterval;
var videoInterval = setInterval(videoStatus, 100);
var newTime:Number;
var amountLoaded:Number;
ns["onMetaData"] = function (obj) {
duration = obj.duration;
};
mediaPanel.loader_mc.loadbar_mc.onPress = function():Void {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit, 10);
};
mediaPanel.loader_mc.loadbar_mc.onRelease = function():Void {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus, 100);
};
Here is are the videostatus and scrubit functions
Code:
var duration:Number;
function videoStatus():Void {
amountLoaded = ns.bytesLoaded/ns.bytesTotal;
mediaPanel.loader_mc.loadbar_mc._xscale = amountLoaded*100;
mediaPanel.loader_mc.scrub_mc._xscale = (ns.time/duration)*100;
}
function scrubit():Void {
newTime = (mediaPanel.loader_mc.back_mc._xmouse/298)*duration;
trace(newTime);
ns.seek(Math.floor(newTime));
}
Here is the site that im working on http://mav-media.com/Maverick click on portfolio, then the first thumbnail under "motion"
and thoughts welcome.
View Replies !
View Related
Mp3 Progress Bar Scrubber
After getting the progress bar working and implementing the scrubber part, I notice that the further I skip into the song, the further away the song gets from where I click. IE when I click about halfway along the bar it skips to nearly the end of the song.
(declared earlier)
blargCast.loaded = theSource.getBytesLoaded()/theSource.getBytesTotal();
scrubber_mc.onPress = function(){
var pos = scrubber_mc._xmouse/100;
blargCast.pauseTime = pos * blargCast.duration/blargCast.loaded;
blargCast.resume ();
}
See anything wrong? I've tried messing with the orientation of the bar to the center of the movie clip but it doesn't seem to do anything but aggravate the situation.
Any suggestions or examples of sound scrubbers that function properly?
Edit: Oh yeah, its Flash MX Pro 2004
View Replies !
View Related
Progression Bar/scrubber
I'm looking for a "recipe" for how to create a progression bar (in AS3) for an .fla/.swf file -- not an .flv -- that the user can click and drag to move forward or back in an animation.
Can you use the same kind of progression bar/scrubber that works for an .flv for a .swf? If not, can anyone recommend a Web site where I might find instructions for how to build one that would work with an .swf?
Thanks!
--J
View Replies !
View Related
Volume Scrubber
Notes in script explain what I'm trying to do:
ActionScript Code:
onClipEvent (load)
{
currentVolume = _root.audioObject.getVolume();
this._parent.volumeback._height = 90.8;
this._parent.volumeBack._x = 2.4;
// I changed the following code:
//this._y = this._parent.volumeBack._y + this._parent.volumeBack._height / 2 - this._height / 2;
// To this:
this._y = this._parent.volumeBack._y + this._parent.volumeBack._height / 2 - this._height / 2 + 50 - currentVolume;
// To make the scrubber land on the y axis in comparison to the volume (1-100 from bottom to top)
left = this._x -1;
top = this._y + this._parent.volumeBack._height / 2 -8;
right = this._x;
bottom = this._y - this._parent.volumeBack._height / 2 +4;
volCalc = this._y + this._parent.volumeBack._height / 2; // <-this = 128.45
}
onClipEvent (enterFrame)
{
// This needs to be adjusted to account for the change above so when the scrubber is
//moved it adjusts the volume based on it's current position being the actual volume.
volCalc2 = (this._y - volCalc) * (-100 / this._parent.volumeBack._height);
// The above line = 75.3-128.45 (-53.15)*(-100/90.8) = -54.251321585903083700440528634361
// might help with the math?
_root.audioObject.setVolume(volCalc2);
}
onClipEvent (mouseDown)
{
startDrag (this, false, left, top, right, bottom);
}
onClipEvent (mouseUp)
{
this.stopDrag();
}
Any help/insight would be much appreciated!
View Replies !
View Related
Scrubber Weirdness
Hey all,
I searched for the problem I'm having, but all of the posts I've found dealt with AS2, which I'm not familiar with. Hopefully someone can help:
Basically, I'm just having problems with the mouse "letting go" of the scrubber in my video player - that is, my MOUSE_UP listener doesn't seem to be doing the trick. When the mouse button is released, the scrubber still follows the movement of my mouse. Here's my code:
Code:
var loader1:loader = new loader();
var videoInterval = setInterval(videoStatus, 100);
var amountLoaded:Number;
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader1.loadBar1.width = amountLoaded * 326;
}
var scrubInterval;
var scrubBoundary:Rectangle = new Rectangle(0, 0, 325, 0);
loader1.scrubber1.addEventListener(MouseEvent.MOUSE_DOWN, onMousePress, false, 0, true);
loader1.scrubber1.addEventListener(MouseEvent.MOUSE_UP, onMouseRelease, false, 0, true);
loader1.scrubber1.buttonMode = true;
function onMousePress(evt:MouseEvent):void {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit, 10);
loader1.scrubber1.startDrag(false, scrubBoundary);
}
function onMouseRelease(evt:MouseEvent):void {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus, 100);
loader1.scrubber1.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader1.scrubber1.x / 325) * vidDuration));
}
addChild(loader1);
Any help is appreciated!
View Replies !
View Related
Scrubber Bar Coordinates
I am going through the Video Tutorials and I have run across one problem. When creating the scrubber bar, it seems to always use the x coordinate of the total width of the scubber.
By what I mean, is that the scrubber bars x point is where the entire image ends. So that 'up triangle' at the bottom is the 0 point, rather then the rectangle above it.
This initially wouldn't be a problem, as I would set the x point in the actionscript a negative value to make up for it, but when I moved to the tutorial for actually making the scrubber move, it has no way of setting that kind of point.
Hope I explained it well enough, any help?
View Replies !
View Related
Scrubber Problem
hello,I just started to make my flash video player with Flash Professional 8, but my video scrubber don't move anymore.
open url, you can know my problem.
http://asopq12345.110mb.com/
it is meant to start here:
___________________________
|[]________________________|
but video playing it is always stop start here:
___________________________
|[]________________________|
Who can you tell me what my problem is where?
Below is my primitive files.
http://asopq12345.110mb.com/movie.rar
Open primitive files to amend for me.
I'm look Video Basics - Part 4 ,and one to one step do over,but not have same effect
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play("http://www.dic-is.tw/starinfinite/bluezone.flv");
back.onRelease = function() {
ns.seek(0);
};
player.onRelease = function() {
ns.pause(false);
};
playstop.onRelease = function() {
ns.pause(true);
player = true;
};
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*220.6;
loader.scrub._x = ns.time/duration*218.8;
}
View Replies !
View Related
Flv Scrubber Position
I have not been able to find a flv player that has a horizontal scrubber graphic. This might be because no one is sure on how to handle a horizontal scrubber graphic. If you set the registration point to the left side of your scrubber then the hole thing over laps the scrubber progress bar. If you set it in the center it partially overlaps the progress bar, and so on. How can you keep a horizontal scrubber graphic inside of your scrubber bar with out any overlapping? I can upload a graphic if that helps.
Thanks,
Saveth
View Replies !
View Related
Scrubber Bar Not Working
G'day
I am following Lee's tutoril on building a video player from the ground.
encoded the video through flash 8 and added keyframes for every second.
what is happening though is when I move the scrubber the video goes to black and the scrubber snaps back to the start, then the video starts again. here is the code I am using; (have left off the connection code as that must be ok the video is playing)
my_video.attachVideo(my_ns);
my_ns.setBufferTime(10);
my_ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
my_nc.seek(0);
}
}
my_ns.play("movie2.flv");
rewindBut.onRelease = function() {
my_ns.seek(0);
}
playBut.onRelease = function() {
my_ns.pause();
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
my_ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = my_ns.bytesLoaded/my_ns.bytesTotal;
loader.loadbar._width = amountLoaded * 220;
loader.scrub._x = my_ns.time / duration *220;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,4,this._y,217,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
my_ns.seek(math.floor((loader.scrub._x/220)*duration));
}
thanks
easy
if I had eyes I could see
View Replies !
View Related
Scrubber Functionality Is Not Quite Right
I am having some trouble with the streaming video scrubber in AS3.
First problem:
I can not seem to be able to get the duration from the metadata in the video so right now I have hardcoded in the duration in seconds (in this example it is 213).
Second problem:
The absence of the onReleaseOutside mouse event is causing havoc if you try to advance or rewind the video via the scrubber.
Code:
Code:
////////////////////////////////////////////VIDEO CODE
var fileName:String = "pinnacle_high";
var timeText:String = "3:33";
var nc:NetConnection = new NetConnection();
var ns:NetStream;
nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
var counter:int = 0;
function onNetStatus(evt:NetStatusEvent):void {
if (evt.info.code =="NetConnection.Connect.Success") {
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
var myVideo:Video = new Video(384,216);
myVideo.attachNetStream(ns);
addChild(myVideo);
myVideo.x = 128;
myVideo.y = 30;
ns.bufferTime = 5;
ns.play(fileName,true);
}
}
nc.connect("rtmp://server",true);
function asyncErrorHandler(event:AsyncErrorEvent):void{
//ignore error;
}
NetConnection.prototype.onBWDone = function(p_bw) {
//trace("onBWDone: "+p_bw);
}
NetConnection.prototype.onBWCheck = function() {
return ++counter;
}
///////////////////////////////////////VIDEO CONTROLS CODE
rew_btn.addEventListener(MouseEvent.MOUSE_UP, rew);
play_btn.addEventListener(MouseEvent.MOUSE_UP, pla);
stop_btn.addEventListener(MouseEvent.MOUSE_UP, sto);
function rew(e:MouseEvent):void{
ns.seek(0);
}
function pla(e:MouseEvent):void{
ns.resume();
}
function sto(e:MouseEvent):void{
ns.pause();
}
///////////////////////////////////////GOOGLE ANALYTICS TRACKING CODE
play_btn.addEventListener( MouseEvent.CLICK, playClick );
function playClick( event:Event ):void {
tracker.trackPageview( "/pinnacle-play-high");
}
///////////////////////////////////////SOUND CONTROL CODE
mute.buttonMode = true;
mute.addEventListener(MouseEvent.CLICK, muteClick);
mute.addEventListener(MouseEvent.ROLL_OVER, muteOver);
mute.addEventListener(MouseEvent.ROLL_OUT, muteOut);
function muteClick(e:MouseEvent):void{
var c:MovieClip = mute;
if(c.currentFrame == 10){
c.gotoAndStop(30);
ns.soundTransform = new SoundTransform(0);
}
else if(c.currentFrame == 30){
c.gotoAndStop(10);
ns.soundTransform = new SoundTransform(1);
}
}
function muteOver(e:MouseEvent):void{
var c:MovieClip = mute;
if(c.currentFrame == 1){
c.gotoAndStop(10);
}
else if(c.currentFrame == 20){
c.gotoAndStop(30);
}
}
function muteOut(e:MouseEvent):void{
var c:MovieClip = mute;
if(c.currentFrame == 10){
c.gotoAndStop(1);
}
else if(c.currentFrame == 30){
c.gotoAndStop(20);
}
}
///////////////////////////////////////SCRUBBER CODE
var rectangle = new Rectangle(0,0,171,0);
var scrubInterval;
var videoInterval = setInterval(videoStatus,100);
loader.scrub.buttonMode = true;
loader.scrub.addEventListener(MouseEvent.MOUSE_DOWN, MousePress);
loader.scrub.addEventListener(MouseEvent.MOUSE_UP, MouseRelease);
function videoStatus() {
loader.scrub.x = ns.time / 213 * 171;
}
function scrubit() {
ns.seek(Math.floor((loader.scrub.x/171)*213));
}
function MousePress(e:MouseEvent):void {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
loader.scrub.startDrag(true,rectangle);
}
function MouseRelease(e:MouseEvent):void {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
loader.scrub.stopDrag();
}
Everything above "SCRUBBER CODE" works great.
Also here is the error I get when testing the movie, though the general functionality seems okay:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_high_as3_fla::MainTimeline/videoStatus()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at <anonymous>()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
here is the link to see it http://www.maddash.net/testing/as3/as3.htm
View Replies !
View Related
Scrubber Bar Problems
Ok, I've watched the first few tutorials and have understood them all except the two on the scrubber bar.
Here's what I have
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play("MyPassion.flv");
rewind.onRelease = function() {
ns.seek(0);
}
play.onRelease = function() {
ns.pause();
}
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 * 165;
loader.scrub._x = ns.time / duration * 165;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,100);
this.startDrag(false,0,this._y,165,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x / 165) * duration ));
}
Nothing is working, neither my loadboar or my scrubber advancing as they should and when I try to skip around using the scrubber, my movie restarts. Please help me, as I need to do this a lot for my website
http://www.youthlight.net
View Replies !
View Related
Scrubber Bar Troubles
Hello everyone,
I am putting together an xml driven mp3 player. I have pretty much the simple functions of the player functioning, for the exception of the scrubber bar. I cannot wait for the new tutorials now being offered at gotoandlearn.com. This project as with everything is on a deadline.
Here's the swf in action:
http://mfkmediaworks.com/lectureCast.html
Here's the link to the .as file:
http://mfkmediaworks.com/lectureCast.as
The scrubber code is mainly found on lines 52 to 68.
When scrubbing the audio to the end of the audio, when you release it the scrubber places itself at a slightly different location.
Secondly, when a sound is complete, the scrubber bar does not reset to its start position. I do not know what I am missing.
Thank you for your help. I really appreciate it.
mfkpro.
View Replies !
View Related
Another Scrubber Problem...
I followed Lee's video player tutorial series, but I'm having constant problem with the scrubber.
It seems that the onReleaseOutside function doesn't work.
I've tried multiple things, I have used the improved code form Lee's blog, but nothing seems to work.
Maybe you guys can find the problem.
Code:
#include "lmc_tween.as"
screen._alpha = 0;
menuBar.alphaTo(0,3);
var d = 1;
function startTracking() {
if (menuBar.hitTest(_root._xmouse, _root._ymouse) && d) {
d = 0;
menuBar.alphaTo(100,1);
}
if (!menuBar.hitTest(_root._xmouse, _root._ymouse)) {
if (!d) {
menuBar.alphaTo(0,1);
d = 1;
}
}
}
var delay = setInterval(startTracking, 30);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play("diabloIII.flv");
this.menu.rewindButton.onRelease = function(){
ns.seek(0);
}
this.menu.playButton.onRelease = function() {
ns.pause();
}
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns.onMetaData = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
menuBar.loader.loadbar._width = amountLoaded * 280;
menuBarloader.scrub._x = ns.time / duration * 280;
}
menuBar.loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
menuBar.loader.scrub.startDrag(false,0,this._y,280,this._y);
}
menuBar.loader.scrub.onRelease = menuBar.loader.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
menuBar.loader.scrub.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((menuBar.loader.scrub._x/280)*duration));
}
View Replies !
View Related
Scrubber & Movie Clips
Does a scene full of tweens & movie clips need to be saved out at a single movie clip for a scrubber to work? I have stop, start, rewind & fastforward buttons already on the timeline & now need to add in a scrubber and am not sure.
thanks
View Replies !
View Related
Scrubbing Through MC And Animated Scrubber
Thanks for any help,
I am trying to get a moviclip to play/change in relation to the x position of my scrubber as you drag it along the bar. I have the movieclip with 20 frames/instances, and each of them has the action stop();. The problem is I can't find the commands to link them. Are there any tutorials? I have checked and found nothing. The scrubber, and movie are both MC's.
Also, as you drag the scrubber I want it to animate also as you drag it along the bar. So that it starts at the far left of the bar on frame 1 of the MC, and as you get to the end of the bar you also get to the end of the MC animation.
Any help, tutorials or otherwise would be great.
Thanks.
View Replies !
View Related
* Operator Not Performing For Scrubber
hey guys...i am making a scub bar for a video player. Right now, all is fine, except the actual scrub script. When i press the loadBar (dynamically scaling as video loads) the video stops. the crazy thing is on the 3rd line, if i change the operator to "/" it works like i want it to, only mirror image (move the pointer left, the scubber goes right). What's up with that * operator?
Code:
loadBar.onPress = function() {
progressBar.onEnterFrame = scrubIt;
};
loadBar.onRelease = loadBar.onReleaseOutside=function () {
progressBar.onEnterFrame = checkPlayhead;
};
function scrubIt() {
var distance = (_root._xmouse-loadBar._x)/loadBar._width;
newVidPlace = Math.floor(stStreamer.duration * distance);
stStreamer.seek(newVidPlace);
progressBar._xscale = (stStreamer.time/stStreamer.duration)*100;
}
View Replies !
View Related
|