-
Requesting help tkx?!
hey guys,
im not a flash coder/designer and i already asked for help on this question but i only used the code once in my life-time, and, ive took some tutorials from internet that strangly i cannot find anymore..so basicaly i lost my knowlege about this in the past 1 or 2 years and i need some help on this again:
The thing is im building a small mp3 player to my webpage and i need some help on 2 things:
1 - my playbar extends very long: i have a 200 width graphic converted to movie clip but i cannot get the code to make it width along...this is the code im using but for sure misses someting:
Code:
var position = Math.floor(sound.position/1000)
_root.AreaS.playbar._width = position
2 - this one is realy realy realy amateur that i do not know how i forgot...how the hell do we put the mp3 time on a dynamic text????
well i know is some basic formula considering "getBytesLoaded" and "getBytesTotal" but ive tried to / it and *60 etc and i cannot set the time for the dynamic text..it always get "0" has number???!!!!
Thanks guys and sorry to be such a dumb sometimes, all the time, NEVER ...
Duarte V.
-
Senior Member
1 well obviously you need to know exact maximum of position. then your _width could be 200 * position / max_position.
2 getBytesLoaded is bytes loaded not time. you could be downloading bytes faster than sound plays.
-
Originally Posted by realMakc
1 well obviously you need to know exact maximum of position. then your _width could be 200 * position / max_position.
2 getBytesLoaded is bytes loaded not time. you could be downloading bytes faster than sound plays.
1-> Beatuy hint man... i tried out and remebered...200*position/duration...yeah! Thanks...
2-> im gonna try to figure this out cause i really would like that my player had the time on it...cause it also gonna plays mixsets despite of my original tracks and is always good to have the time for those cause they are always + than 40 minutes....i would like help on this ....if i find out i will warn you.....
Thanks again for the tip and for the quick answer...
Duarte V.
-
ok..i made it...i could get the time for my mp3s....since im not run the time and its there just to tell how much time the mp3 has im ok on this one... now i have a small problem with another thing..well...it can be bypassed if there is no reply to this but i will try to have one anyway...
i have a scroller on my player, but is now fixed and it only moves when i try to find a part of the mp3 ...i tried to put in on move with the playbar and it worked but when i try to scrub it it works ..lets say 1/2 of it.... what i mean is i can scrub but not perfectly as when its quiet waiting for a drag... when i put it on moving along with the playbar and try to drag it it just goes back and foward from the position of the playbar to where i have the mouse, and its not precise, although i can drag it foward but with no precision......this is the code im using:
Code:
onClipEvent (enterFrame) {
loadbar = Math.floor(_root.mysound.getBytesLoaded/200);
var position = Math.floor(_root.mysound.position/1000);
var duration = Math.floor(_root.mysound.duration/1000);
var pos = Math.floor((200*_root.mysound.position)/_root.mysound.duration);
scroller._x = pos;
scroller.onPress = function (){
_root.mysound.stop();
startDrag("scroller", true, 0, 0, 200, 0);
scroller.onRelease = function (){
stopDrag();
var cue = Math.floor((scroller._x*duration)/200);
_root.mysound.start(cue, true);
scroller.onReleaseOutside = function (){
stopDrag();
var cue = Math.floor((scroller._x*duration)/200);
_root.mysound.start(cue, true);
};
};
};
}
Well this is just to try to mmake it better but its not properly very needed...despite of im a complete amateur i dont expect many visitors in my webpage :s
Thanks:
Duarte V.
Last edited by Alienoiz; 02-28-2013 at 12:46 AM.
-
.
Hi,
Without seeing your set up and stuff is this any help to you
PHP Code:
onClipEvent (load) { BarWidth = 200; //BarWidth = MyBar._width;// sets it to whatever width the bar is }
onClipEvent (enterFrame) { loadbar = Math.floor(_root.mysound.getBytesLoaded / BarWidth); var position = Math.floor(_root.mysound.position / 1000); var duration = Math.floor(_root.mysound.duration / 1000); var pos = Math.floor((BarWidth * _root.mysound.position) / _root.mysound.duration); scroller._x = pos; cue = Math.floor((scroller._x * duration) / BarWidth); //cue = Math.floor(((scroller._x * duration) / BarWidth) / 1000);// probably better !! scroller.onPress = function() { startDrag(scroller, true, 0, 0, BarWidth, 0); _root.mysound.stop(); }; scroller.onRelease = scroller.onReleaseOutside = function () { stopDrag(); _root.mysound.start(cue,true); }; }
Last edited by fruitbeard; 02-28-2013 at 03:04 AM.
-
Originally Posted by fruitbeard
Hi,
Without seeing your set up and stuff is this any help to you
PHP Code:
onClipEvent (load) { BarWidth = 200; //BarWidth = MyBar._width;// sets it to whatever width the bar is }
onClipEvent (enterFrame) { loadbar = Math.floor(_root.mysound.getBytesLoaded / BarWidth); var position = Math.floor(_root.mysound.position / 1000); var duration = Math.floor(_root.mysound.duration / 1000); var pos = Math.floor((BarWidth * _root.mysound.position) / _root.mysound.duration); scroller._x = pos; cue = Math.floor((scroller._x * duration) / BarWidth); //cue = Math.floor(((scroller._x * duration) / BarWidth) / 1000);// probably better !! scroller.onPress = function() { startDrag(scroller, true, 0, 0, BarWidth, 0); _root.mysound.stop(); }; scroller.onRelease = scroller.onReleaseOutside = function () { stopDrag(); _root.mysound.start(cue,true); }; }
hi.. thanks for the attention...i believe it does not works...ive tried the code and i cannot drag the scroller...the code i gave seems to work but i cannot drag the scroller smoothly... it kinda drags in "long blocks" through the loadbar.. Thanks again:
Duarte V.
-
.
Hi,
Perhaps if you can attach your fla here then we can help you further, its hard to try and imitate how things are set up and draw everything.
I have a player you can try to de-compile here
or this one, under music here
-
Originally Posted by fruitbeard
Hi,
Perhaps if you can attach your fla here then we can help you further, its hard to try and imitate how things are set up and draw everything.
I have a player you can try to de-compile here
or this one, under music here
hey bro...here it is my small fla code...i will not try to decompile your stuff..i dont know if this looks good to you or not ..anyway when things are tutorials i try to understand and copy some parts of the code but normaly tutorials are very basic for this, i dont saw your code but im sure its has more than 100 thisng i will not understand and will confuse my code and my head if i try to understand it.... anyway... you can easly inspect this and gimme some hints : http://dl.dropbox.com/u/37638606/Untitled.zip
Thanks
Duarte V.
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
|