Not sure if i should post this here, or in another form but anyways i nned some help with a prograss bar. Im not sure how to do it, and i dont have a graphic made for it yet, but if some one can help or show me the way then please do. oh and here is my file http://www.tatteredzdesign.climbingxtreme.com/Untitled-1.fla
With any Sound object, you have the duration and position properties which are, as you would expect, the total time (in ms) of the sound and the position (also in ms) that it is currently playing, respectively. Now from this you could get a percentage of how much of the sound has been played through a ratio (position/duration)*100%. Now you can apply this percentage to the scale of some graphic which you would use as a progress indicator. Simply set the _xscale (or _yscale if you wanna be funky) to that percentage in an onEnterFrame or something and as the song progresses, the bar grows in accordance.
The only problem with this is that in most cases, your bar will be centered meaning the bar would grow from the center instead of some side. To compensate, simply move the bar in the movieclip so that the registration point (the little crosshair) is at the point where you want it to grow from.
what is your question exactly? do you need the code to create a preloader for your mp3s? if so i fought that battle a few weeks ago so id be glad to help, just not sure what you need.
I want a bar like on win amp or somen else. I just want a load bar to show its loading and then when it plays I want a little bar to movie across the bar that was loaded. Do you understand what I am trying tto say now??
*Originally posted by Tattered *
** when it plays I want a little bar to movie across the bar that was loaded. Do you understand what I am trying tto say now?? **
not really…do you have an example of what you want?
yes I do heres two actually
http://www.awamusic.com/index_main.html
www.davidusher.com
well, as far as your mp3 preloader goes, the script i use goes like this:
myMusic = new Sound(this);
myMusic.loadSound(“whatever.mp3”)
loadBar._width = 0;
this.onEnterFrame = function() {
total = myMusic.getBytesTotal();
loaded = myMusic.getBytesLoaded();
percent = Math.round((loaded/total)*100);
loadText = percent+"%";
this.loadBar._width = percent;
if (loaded == total && total > 0) {
myMusic.start(0,1);
delete this.onEnterFrame;
}
};
thats what i used to load my mp3’s dynamically. it works pretty nice. as for your progress bar…it shouldn’t be too hard to figure out. im guessing you’ll just create an MC of a progress bar, give it an instance name like"progressBar", then use
this.progressBar._width = (and im not quite sure what to put here)…
anyone else???
ill see if i can figure it out
Yhea that would be cool. If you get it, I would love an example of how to do it. Im just total lost with this prograss bar, and besides that I just woke up from a power nap.
Something like this?
[SIZE=1]/*link removed[/SIZE]
scotty(-:
Yhea man thats just like the one I want.
Just check the code to see what I’ve added and changed.
scotty(-:
Thanks very much man. that helped a lot. not to put it up on-line and check it out!!!
no problem:thumb:
the load bar doesnt move across the sreen (the gradient), but the whit box works great. not really sure on the other part, but Im still looking at the code.
-thanks
If you upload it to your server, it still doesn’t work?
scotty(-:
yhea i uploaded it on the surver and it doest work. :S i dunno. heres the link for it to load
I see, a little mistake at my side:)
change
[AS]per = Math.floor(Math.round(lo/to)*100);[/AS]
in
[AS]per = Math.floor(Math.round((lo/to)*100));[/AS]
Math.round (in the wrong code) will return 0 till more as 50% is loaded.
scotty(-:
Ahhh thanks. I just changed it that time. I have one more question well 2 actually, then maybe Ill leave you alone hehee
What If I wanted to slide the position_mc ahead in the song
and
"position_mc should sort of grow, instead of staying the same size as that little rectangle".
Thats what my friend wants it to do, but I think it will look stupid but, I got to do it :S.
Well I was looking at tutorials to try and help me on that part but I seem to be going no place with em, so if you could help me once more that would be great, and thanks alot for you time in helping me.
How much do you want it to grow and on what base?
scotty(-:
I want it to grow as far as the first load bar is. I want it to grow on how far the song is, and if you drak it it will jump to some part of the song.