0

Hi,
I have created a Flash MP3 player with a timeline, at the moment you have to click on the place in the timeline to move to but I would like people to be able to click and drag the time slider.
The code I have for setting the position in the time slider is

function setNewProgress(e:MouseEvent):void {
	var p:int = sndObject.length * e.currentTarget.mouseX / 166;
	chaObject.stop();
	chaObject = sndObject.play(p);
	this.btnPlay.visible = false;
	this.btnPause.visible = true;
}

which is called by

this.progressbar.addEventListener(MouseEvent.CLICK, setNewProgress);

How do I make it click and drag
Thanx,
Sam Rudge

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by rajarajan07
0
btnProgressScrubber.addEventListener(MouseEvent.MOUSE_DOWN, progressScrubberClicked);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);

function progressScrubberClicked(e:MouseEvent):void 
{
	bolProgressScrub = true;

	mcProgressScrubber.startDrag(false, new Rectangle(0, 2, 432, 0));
}

function mouseReleased(e:MouseEvent):void 
{
bolProgressScrub = false;
	mcProgressScrubber.stopDrag();
}

Hope this helps! Add the functionality as per your design

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.