|
-
kinda auto scrubbing How to?
Hey guys, i know i might not be welcome for some reasons but here i am licking your ass ... so here we go!
I have a modest website .... www.thebeastpost.com ... and all i know about flash was learned by myself with code parts of tuturials (since ppl dont give the exact code...whatever) ..and in this site i have a simple mp3 player.... with a loadbar, playbar and scroller.
The scroller is moved by the mouse and its position defines the position of the song...the playbar moves alone and also follows it foward and backwards...welll... i took almost 5 days to figure out this code:
onClipEvent (enterFrame) {
var position = Math.floor(_root.mySound.position/1000)
var duration = Math.floor(_root.mySound.duration/1000)
scroller.onPress = function (){
_root.mySound.stop()
startDrag("scroller", true, 0, 0, 300, 0)
scroller.onRelease = function (){
stopDrag()
var cue = Math.floor((scroller._x*duration)/300)
_root.playbar._width = scroller._x
_root.mySound.start(cue, true)
scroller.onReleaseOutside = function (){
stopDrag()
var cue = Math.floor((scroller._x*duration)/300)
_root.playbar._width = scroller._x
_root.mySound.start(cue, true)
}
}
}
}
now the question is:
when i scroll, the scroller mantains the same positions and what i wish is when i press another play button of the player it makes the scroller comes back to 0 position...cause what is happening is that the scroller appears in the same position that was left in the last song played..... remember that this scroller is not "auto-moveable"...just moves with the mouse.
Everything works fine .... even when the scroller is in the end of the bar (300) and i start playing another song and move it, it defines the tempo correctly for the new song but i would like it to rollback automaticaly when i push another play button....
any help?
Thank You!
Duarte v.
Last edited by Alienoiz; 02-21-2012 at 05:51 AM.
Tags for this Thread
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
|