PDA

View Full Version : Problem with next and previous buttons. Movies donot get displayed in order.


roshankolar
09-14-2007, 12:48 PM
Hi All,

I have written the code below. I want to use the previous and next buttons for selecting the movies to be played. This is the selection part of the code. I have another button in my main code which i use to shuffle between the videos. I can get random videos displayed and the program works fine.

Now here, when I go next --> i sometimes dont get videos in sequence, and same problem in previous. If i go previous from a video and click next, the video last displays changes to some other video.

I think there is some problem in the codes for previous and next. can anyone please help me out? I want all videos in order, i.e to be displayed from vid1 ..to vid n.

Can anyone give me a clue??


var nextplay:Number = 0;
var maxplay:Number = 23;
var minplay:Number = 0;
previous_btn.onRelease = function() {
vid.contentPath = "C:/RANDOM/VIDEOS/vid"+nextplay+".flv";
vid.stop();
nextplay -= 1;
if (nextplay<minplay) {
nextplay = maxplay;
}
};
next_btn.onRelease = function() {
vid.contentPath = "C:/RANDOM/VIDEOS/vid"+nextplay+".flv";
vid.stop();
nextplay += 1;
if (nextplay>maxplay) {
nextplay = minplay;
}
};



Thanks in advance...:eek:
Regards
Roshan Kolar