Skip to main content
Known Participant
March 4, 2007
Question

parts of an audio slider

  • March 4, 2007
  • 11 replies
  • 732 views
this is probably easier than i'm making it, but i'm not sure what my code needs to be for the previous button. i'm thinking i'll be able to use the next button script and just edit it a little. if someone could please look at this script and let me know what it needs to be that would be great (point me in the right direction). the script for the next button should be noticeable. i've tried to edit it to make it apply to the previous button, but i can't get it. as i said in my other post, my actionscript knowledge is minimal.
This topic has been closed for replies.

11 replies

kglad
Community Expert
Community Expert
March 8, 2007
you're welcome.
kglad
Community Expert
Community Expert
March 7, 2007
ohhhh. remove the double equal in previous. there's no need for that enabled stuff, either.
Known Participant
March 8, 2007
that works great! thank you! i know you had to put up with a lot there. now i'm going to start working on the preloader/position bar thing. lol. real descriptive name. so i'm going to be in search of a good tutorial for that. if i have anymore questions i'll be sure to post them.
Known Participant
March 7, 2007
when you click the previous button while on the first song it says that the mp3 file is undefined. it works fine when not on the first song. but it does that everytime when it is on the first song.
kglad
Community Expert
Community Expert
March 7, 2007
what's undefined and when is it undefined?
Known Participant
March 7, 2007
undefined.
Known Participant
March 7, 2007
i copied and pasted that and it stills says that it's indefined.
Known Participant
March 7, 2007
b/c of my lack of knowledge i'm not sure what that script would be. but would it be something close to this idea?

xml.onLoad = function()
visibitlity.previous = true
else ();
visibility.previous = false

i know that probably isn't even close.
kglad
Community Expert
Community Expert
March 7, 2007
something like that:

kglad
Community Expert
Community Expert
March 7, 2007
disable your previous button until your xml.onLoad method completes.
Known Participant
March 7, 2007
well, that goes to an undefined.
kglad
Community Expert
Community Expert
March 5, 2007
where is cps initialized? you can decrement cps (check if it's negative and, if so, set it to sa.length - 1) and call playSong() to play the previous song in queue.
Known Participant
March 6, 2007
alright, i think might understand the basic jist of what you're saying. are you saying that the cps value needs to be -1 (to go to the previous song?) and then i call the playSong () function? i'm not sure i know exactly what to do here. why is the cps originally -1? or isn't it? wait. it would go up by 1 every song right? so that it knows what line of the xml doc. to read? so i need it to read the previous line? how would i do that? i need to somehow figure out what song it's on right? sorry, i'm so confused. thank you for being willing to help me out. i greatly appreciate it. (although it tries my patience sometimes, i appreciate how you don't just hand me the script. that helps me actually learn. thank you.)
kglad
Community Expert
Community Expert
March 6, 2007
sa is an array that stored all the information from your xml file. you don't need to ever re-read the xml file after its contents are read and stored in sa. you just need to access the information stored in sa.

the next button calls playSong() which increments cps, the sa array index and loads the sound and information at that array position.