all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

Handle/icon instead of progress/bar



Handle/icon instead of progress/bar veverica
2/28/2007 10:06:00 PM
flash actionscript: Anybody got a tip for connecting just a little icon instead of having the
seek/progress bar. I want to replace the normal _xscale property with just an
_x coordinate to move the icon as the progress bar would. I'm almost there
but...

var handlePos:Number = (_root._xmouse-loadBar._x);

function videoUpdate () {
handle._x = (ns.time/ns.duration) *100-handlePos;
}

okay, there, it's moving

but the scrub is kiling me... can't get the formula right to keep the cursor
and the handle together when you drag and seek.

function vidScrub() {
var distance:Number = (_root._xmouse-loadBar._x)/loadBar._width;
ns.seek(Math.floor(ns.duration*distance));
handle._x = (ns.time/ns.duration) *100-handlePos;

thanks for any help

jg
Re: AS for seek icon instead of progress/seek bar tonyhigham
3/1/2007 6:24:19 PM
I may have misunderstood something about your setup, but wouldn't this work?

function vidScrub() {
var distance:Number =
Math.min(1,(_root._xmouse-loadBar._x)/loadBar._width);
ns.seek(ns.duration*distance);
handle._x = loadBar._x + (distance* loadBar._width)
Re: AS for seek icon instead of progress/seek bar veverica
3/1/2007 10:13:28 PM
Tony, Thanks much. That did the trick for the scrub function , just the one
line was needed

[Q]handle._x = loadBar._x + (distance* loadBar._width)[/Q]

feel like a dope but I still can't figure the syntax for the icon to move at
the front of the progress bar

function videoUpdate () {
progressBar._xscale = (ns.time/ns.duration) *100;
timecode.text = getTimeCode(ns.time);
handle._x = HELP

Here's what it looks like now, http://smashography.com/flv_players/

Let me know if I can return the favor

Jeff Giberson
Re: AS for seek icon instead of progress/seek bar tonyhigham
3/1/2007 11:01:02 PM
try:

Re: AS for seek icon instead of progress/seek bar veverica
3/2/2007 3:26:59 PM
Perfect, thanks again.

jg
AddThis Social Bookmark Button