Jump to content


Photo

MP3 Player with XML - PAUSE BUTTON!


  • Please log in to reply
44 replies to this topic

#21 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 31 July 2006 - 04:36 PM

textdisplay transparent: disable the border and background from properties panel when you select the textfield

Swap pause and play:
btn_pause._visible = false;
btn_play.onRelease = function() {
btn_pause._visible = true;
btn_play._visible = false;
...
}
btn_pause.onRelease = function(){
btn_play._visible = true;
btn_pause._visible = false;
....
}

note that you need to enter the "visible" lines of code to the already given code.

PS: thanks for the nice comments :D

#22 Wowzers

Wowzers

    Young Padawan

  • Members
  • Pip
  • 40 posts

Posted 01 August 2006 - 03:22 AM

I'm sorry I'm being lazy and Didn't feel like trying it, untill i knew for sure. But will the play button be hidden if paused and the pause hidden when playing?? lol. If not thats fine im sure i can alter it so it works like that.

#23 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 01 August 2006 - 04:37 AM

seems like it :(

btw.. dont' forget to swap the buttons around if autostart is off ;)

Edited by funkysoul, 01 August 2006 - 04:38 AM.


#24 Oimi

Oimi

    Young Padawan

  • Members
  • Pip
  • 33 posts

Posted 23 October 2006 - 07:02 AM

Okay, I am stuck. I have looked through the whole of the code and compared it to the original but cannot identify why they do not behave the same. I have managed to get to Part III of the tutorial and have most of the features I want integrated. However, what I discovered was that my scrolling text only displays once, and then never appears again. Why could this be? If you could help me resolve this issue I would be very grateful. My other query is that I would like a section on my MP3 player, which drops down (like in WinAMP when you click on the down arrow button), which then displays the song/track listings with a scrollbar down the side.

Can you save me? Please?

Thank you so much for your time,
Shaun.

#25 Oimi

Oimi

    Young Padawan

  • Members
  • Pip
  • 33 posts

Posted 23 October 2006 - 07:15 AM

Oh yeah, here is the code I am using for the script:

stop();
title_txt.autoSize = "right";
timeDisplay_txt.autoSize = "right";
toolTip._visible = false;
var amountLoaded:Number;
var duration:Number;

playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songband = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
attachMovie("butTemp","but"+i,i+50);
eval("but"+i).id=i;
_root["but"+i]._x = 5;
_root["but"+i]._y = 40 + (i*15);
_root["but"+i].but_txt.text = songname[i];
if (i >= 3){
_root["but"+i]._x = 160
_root["but"+i]._y = -5 + (i*15);
}
_root["but"+i].onRelease = function(){
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
_root.sound_mc.songStarter(songfile[this.id]);
}
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_global.song_nr = (0);
};

function timer(sound_obj) {
time = sound_obj.position/1000;
min = Math.floor(time/60);
min = (min<10) ? "0"+min : min;
sec = Math.floor(time%60);
sec = (sec<10) ? "0"+sec : sec;
timeDisplay_txt.text = min+":"+sec+"/"+totalDuration;
}
function duration (){
timed = _root.sound_mc.sound_obj.duration/1000;
mind = Math.floor(timed/60);
mind = (mind<10) ? "0"+mind : mind;
secd = Math.floor(timed%60);
secd = (secd<10) ? "0"+secd : secd;
totalDuration = mind+":"+secd;
}
MovieClip.prototype.songStarter = function(file) {
if (this.sound_obj) {
this.sound_obj.stop();
delete this.sound_obj;
}
this.sound_obj = new Sound(this);
this.sound_obj.loadSound(file, true);
this.sound_obj.setVolume(100);
this.onEnterFrame = function() {
if (this.sound_obj.position>0) {
delete this.onEnterFrame;
timeInterval = setInterval(timer, 1000, this.sound_obj);
track = this.sound_obj.id3.songname;
artist = this.sound_obj.id3.artist;
this._parent.title_txt.text =artist+"/"+track;
} else {
this._parent.title_txt.text = "Song Loading";
}

};
this.sound_obj.onSoundComplete = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr]);
};
this._parent.volume1.dragger.onPress = function() {
startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
_root.toolTip._visible = true;
setInterval(draggableTip,100);
function draggableTip(){
_root.toolTip._x = _root._xmouse;
}
this.onEnterFrame = function() {
var p = (this._x/this._parent.volBG._width)*100;
this._parent._parent.sound_mc.sound_obj.setVolume(p);

};
};
this._parent.volume1.dragger.onRelease = function() {
delete this.onEnterFrame;
stopDrag();

};
this._parent.volume1.dragger.onReleaseOutside = function() {
_root.toolTip._visible = false;
stopDrag();

};
};

function soundStatus(){
var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();
_root.loader.loadBar._width = amountLoaded * 212.4;
duration = _root.sound_mc.sound_obj.duration;
position = _root.sound_mc.sound_obj.position;
_root.playHead._x = position / duration * 24.4 + 5;
}
btn_pause.onRelease = function() { //pause button function
this._parent.sound_mc.sound_obj.stop(); //stop the current sound
posiP = _root.sound_mc.sound_obj.position / 1000; // save the current position in a new variable and divide by 1000 (ms -> sec)
pause = true;//set the variable pause to true
}
btn_play.onRelease = function() {
if (pause == true){ // no comment....
this._parent.sound_mc.sound_obj.start(posiP) // start sound from the previously saved position
}
else {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
this._parent.sound_mc.songStarter(songfile[song_nr]);
}
};
btn_stop.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
this._parent.sound_mc.sound_obj.stop();
};
btn_fw.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr]);
};
btn_rev.onRelease = function() {
clearInterval(timeInterval);
_root.timeDisplay_txt.text = "00:00/00:00";
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr]);
};
playlist.load("removedforanonymity(nothing wrong with the playlist)");
setInterval(duration,100);
setInterval(soundStatus,100);

Could you please also tell me how I would integrate the Play/Pause crossover using the code provided 4 posts above this one?

Thank you, Shaun.

If you want to see the player, please PM me.

#26 LegaLega

LegaLega

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 22 January 2007 - 11:21 AM

I am using Flash MX... and for some reason can not get the pause button to work. I attempted to debug by creating a button that has the following applicable actionscript:

TEST.onRelease = function() {
_root.sound_mc.sound_obj.stop();
_root.sound_mc.sound_obj.start(45);
};

It acts the same way. I get no sound. what am I doing wrong with the "start" code?

#27 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 23 January 2007 - 03:11 AM

Shouldn't it be
this._parent.sound_mc.sound_obj.start(posiP);


#28 LegaLega

LegaLega

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 23 January 2007 - 11:18 AM

Shouldn't it be

this._parent.sound_mc.sound_obj.start(posiP);


I had it that way and it was the same result: no sound. I tried to debug by using "_root".

Here's the .fla file.

I have no idea what I'm doing wrong.

Any assistance is greatly appreciated.

-James

#29 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 23 January 2007 - 11:36 AM

hmm funny.. I've tested out your fla file and everything is working how it should..
I'm running flash 8 pro, but I've outputted the file as a mx 2004 fla.

#30 LegaLega

LegaLega

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 24 January 2007 - 01:30 AM

hmm funny.. I've tested out your fla file and everything is working how it should..
I'm running flash 8 pro, but I've outputted the file as a mx 2004 fla.


ahhh... i'm running flashmx.. is this the issue?

#31 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 24 January 2007 - 04:04 AM

actually it shouldn't be since I'm using AS 2.0..

I don't have any possibility to check it on flash mx :)

#32 dlusion

dlusion

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 04 March 2007 - 09:33 AM

anyone managed to make a Mute button?

I made one, but doesnt work anymore if i use volumecontroller again :-/ so basicly it works for 1 time only.

Does any1 know how to make correct one?

#33 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 04 March 2007 - 01:24 PM

if on release of the mute button, you should just be able to set:

if(!this.bMuted){
sound_obj.setVolume(0);
this.bMuted = true;
} else {
sound_obj.setVolume(100);
this.bMuted = false;
}


The volume slider should still work. It will need more work if you'd like it to change the location of the volume slider, or when you unmute to go to the previously selected volume.

#34 dlusion

dlusion

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 04 March 2007 - 03:34 PM

thanks Pax, but it still didn't fix my problem.

With your code i end up having the same problem as before, the button won't mute anymore when i've used to volumeslider :-/

it sounds like its being overruled by something else :-/ i discovered that as soon as the volumeslider has been touched, the button doenst work anymore!

this is my code... any ideas?


stop();
var amountLoaded:Number;
var duration:Number;

playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
	if (success) {
		_global.songname = [];
		_global.songband = [];
		_global.songfile = [];
		for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
			_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
			_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
			_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
			//trace(songname[i]+" "+songfile[i]+" "+songband[i]);
		}
	}
	_root.createEmptyMovieClip("sound_mc", 1);
	_root.sound_mc.sound_obj = new Sound();
	_global.song_nr = random(songfile.length);
	_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[
song_nr]); 
};
MovieClip.prototype.songStarter = function(file, name, band) {
	this.sound_obj.loadSound(file, true);
	this.onEnterFrame = function() {
		if (this.sound_obj.position>0) {
			delete this.onEnterFrame;
			displaytags.display_txt.text = name;
			displaytags.artist_txt.text = band;
		} else {
			displaytags.display_txt.text = "loading...";
			displaytags.artist_txt.text = "loading...";
		}
	};
this.sound_obj.onSoundComplete = function() {
	clearInterval(timeInterval);
	timeDisplay_txt.text = "00:00/00:00";
	(song_nr == songfiles.length-1) ? _global.song_nr=0 : _global.song_nr++;
	_root.sound_mc.songStarter(songfiles[song_nr], songname[song_nr], songband[
song_nr]);
	};
	
volume1.dragger.onPress = function() {
	startDrag(this, true, 0, this._y, this._parent.volBG._width - 7, this._y);
	this.onEnterFrame = function() {
		var p = (this._x/this._parent.volBG._width)*100;
		_root.sound_mc.sound_obj.setVolume(p);
};
}
volume1.mute.onRelease = function() {
	//startDrag(this, true, 0, this._y, this._parent.volBG._width , this._y);
	this.onEnterFrame = function() {
		//var p = (this._x/this._parent.volBG._width)*100;
		_root.sound_mc.sound_obj.setVolume(0);
};
}

volume1.dragger.onRelease = function() {
	delete this.onEnterFrame;
	stopDrag();
};
volume1.dragger.onReleaseOutside = function() {
	stopDrag();
};
function timer(sound_obj) {
	time = sound_obj.position/1000;
	min = Math.floor(time/60);
	min = (min<10) ? "0"+min : min;
	sec = Math.floor(time%60);
	sec = (sec<10) ? "0"+sec : sec;
	timeDisplay_txt.text = min+":"+sec+"/"+totalDuration;
}
function duration (){
	timed = _root.sound_mc.sound_obj.duration/1000;
	mind = Math.floor(timed/60);
	mind = (mind<10) ? "0"+mind : mind;
	secd = Math.floor(timed%60);
	secd = (secd<10) ? "0"+secd : secd;
	totalDuration = mind+":"+secd;
}


function soundStatus(){
	var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();
	loader.loadBar._width = amountLoaded*181;
	duration = _root.sound_mc.sound_obj.duration;
	position = _root.sound_mc.sound_obj.position;
	playHead._x = position / duration*193-5;
}

};
mute_.onRelease = function() {
	if(!this.bMuted){
		_root.sound_mc.sound_obj.setVolume(0);
		this.bMuted = true;
	} else {
		_root.sound_mc.sound_obj.setVolume(100);
		this.bMuted = false;
	}
}

btn_play.onRelease = function() {
	clearInterval(timeInterval);
	if (pause == true){ // no comment....
		_root.sound_mc.sound_obj.start(posiP) // start sound from the previously saved position
	}
	else {  
	_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]); 
	}
};
btn_pause.onRelease = function() { //pause button function
	clearInterval(timeInterval);
	_root.sound_mc.sound_obj.stop(); //stop the current sound
	posiP = _root.sound_mc.sound_obj.position / 1000; // save the current position in a new variable and divide by 1000 (ms -> sec)
	pause = true;//set the variable pause to true
}
btn_stop.onRelease = function() {
	clearInterval(timeInterval);
	_root.sound_mc.sound_obj.stop();
	pause = false;
};
btn_fw.onRelease = function() {
	clearInterval(timeInterval);
	(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
	_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[
song_nr]);
};
btn_rev.onRelease = function() {
	clearInterval(timeInterval);
	(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
	_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[
song_nr]);
};
playlist.load("playlist.xml");
setInterval(duration, 100);
setInterval(soundStatus,100);

Edited by dlusion, 04 March 2007 - 03:46 PM.


#35 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 04 March 2007 - 04:17 PM

Looks like you missed clearing an onEnterFrame. Try the following:

volume1.dragger.onReleaseOutside = function() {
	stopDrag();
	delete this.onEnterFrame;
};

volume1.mute.onRelease = function() {
	//startDrag(this, true, 0, this._y, this._parent.volBG._width , this._y);
	//this.onEnterFrame = function() {
		//var p = (this._x/this._parent.volBG._width)*100;
		_root.sound_mc.sound_obj.setVolume(0);
//};
}


#36 pelicansfly

pelicansfly

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Gender:Male
  • Location:United States
  • Interests:Computer Animation, Film, Photography, Programming, Reading, Going to The Movies.

Posted 04 March 2007 - 04:51 PM

It worked perfectly, thanks..

#37 dlusion

dlusion

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 05 March 2007 - 03:31 AM

yeeeeeey! that worked for me as well!

Sorry for the misser :-)

Thanks a bunch, Pax.. really appriciate it!

#38 dlusion

dlusion

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 05 March 2007 - 08:15 AM

alright.. another problem showed up...

i don't know what's wrong, but on start-up i dont hear shit but mp3 is running (proof is the secondscounter).. when i touch the volumeslider the sounds popsop outtanowhere and nothing is wrong. So basicly the sound is turned off onload.

i already tryed putting "_root.sound_mc.sound_obj.setVolume(100);" at the top of my code, but wouldnt help.

anyone who knows a solution? thanks in advance!

(it's basicly the same sourcecode from the example audioplayer3.fla, just some paths has been chanced... _root stuff)


stop();
btn_play._visible = 0;

title_txt.autoSize = "left";
timeDisplay_txt.autoSize = "left";
toolTip._visible = false;
var amountLoaded:Number;
var duration:Number;
playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
	if (success) {
		_global.songname = [];
		_global.songband = [];
		_global.songfile = [];
		for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
			_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
			_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
			_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
			attachMovie("butTemp", "but"+i, i+50);
			eval("but"+i).id = i;
			_root["but"+i]._x = 5;
			_root["but"+i]._y = 40+(i*15);
			_root["but"+i].but_txt.text = songname[i];
			if (i>=3) {
				_root["but"+i]._x = 160;
				_root["but"+i]._y = -5+(i*15);
			}
			_root["but"+i].onRelease = function() {
				clearInterval(timeInterval);
				_root.timeDisplay_txt.text = "00:00/00:00";
				_root.sound_mc.songStarter(songfile[this.id]);
			};
		}
	}
	_root.createEmptyMovieClip("sound_mc", 1);
	_global.song_nr = random(songfile.length);
	_root.sound_mc.songStarter(songfile[song_nr]);
};
function timer(sound_obj) {
	time = sound_obj.position/1000;
	min = Math.floor(time/60);
	min = (min<10) ? "0"+min : min;
	sec = Math.floor(time%60);
	sec = (sec<10) ? "0"+sec : sec;
	timeDisplay_txt.text = min+":"+sec+"/"+totalDuration;
}
function duration() {
	timed = _root.sound_mc.sound_obj.duration/1000;
	mind = Math.floor(timed/60);
	mind = (mind<10) ? "0"+mind : mind;
	secd = Math.floor(timed%60);
	secd = (secd<10) ? "0"+secd : secd;
	totalDuration = mind+":"+secd;
}
MovieClip.prototype.songStarter = function(file) {
	if (this.sound_obj) {
		this.sound_obj.stop();
		delete this.sound_obj;
	}
	_root.sound_mc.sound_obj = new Sound(this);
	_root.sound_mc.sound_obj.loadSound(file, true);
	_root.sound_mc.sound_obj.setVolume(0);
	this.onEnterFrame = function() {
		if (_root.sound_mc.sound_obj.position>0) {
			delete this.onEnterFrame;
			timeInterval = setInterval(timer, 1000, this.sound_obj);
			track = this.sound_obj.id3.songname;
			artist = this.sound_obj.id3.artist;
			displaytags.display_txt.text = artist+" - "+track;
		} else {
			displaytags.display_txt.text = "loading...";
			displaytags.artist_txt.text = "loading...";
		}
	};
	_root.sound_mc.sound_obj.onSoundComplete = function() {
		clearInterval(timeInterval);
		_root.timeDisplay_txt.text = "00:00/00:00";
		(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
		_root.sound_mc.songStarter(songfile[song_nr]);
	};
	volume1.dragger.onPress = function() {
		startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
		_root.toolTip._visible = true;
		setInterval(draggableTip, 100);
		function draggableTip() {
			_root.toolTip._x = _root._xmouse;
		}
		this.onEnterFrame = function() {
			var p = (this._x/this._parent.volBG._width)*100;
			_root.sound_mc.sound_obj.setVolume(p);
		};
	};
	volume1.dragger.onRelease = function() {
		delete this.onEnterFrame;
		stopDrag();
	};
	volume1.dragger.onReleaseOutside = function() {
		_root.toolTip._visible = false;
		stopDrag();
	};

};
function soundStatus() {
	var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded()/_root.sound_mc.sound_obj.getBytesTotal();
	loader.loadBar._width = amountLoaded*181;
	duration = _root.sound_mc.sound_obj.duration;
	position = _root.sound_mc.sound_obj.position;
	playHead._x = position/duration*181-5;
}
mute_.onRelease = function() {
	if(!bMuted){
		_root.sound_mc.sound_obj.setVolume(0);
		bMuted = true;
	} else {
		_root.sound_mc.sound_obj.setVolume(80);
		bMuted = false;
	}
};
btn_play.onRelease = function() {
	if (pause == true) {
		// no comment....
		_root.sound_mc.sound_obj.start(posiP);
		// start sound from the previously saved position
	} else {
		_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
	}
	btn_play._visible = 0;
	btn_pause._visible = 1;
};
btn_stop.onRelease = function() {
	clearInterval(timeInterval);
	timeDisplay_txt.text = "00:00/00:00";
	_root.sound_mc.sound_obj.stop();
	pause = false;
	btn_play._visible = 1;
	btn_pause._visible = 0;
};
btn_pause.onRelease = function() {
	//pause button function
	_root.sound_mc.sound_obj.stop();
	//stop the current sound
	posiP = _root.sound_mc.sound_obj.position/1000;
	// save the current position in a new variable and divide by 1000 (ms -> sec)
	pause = true;
	btn_play._visible = 1;
	btn_pause._visible = 0;
	//set the variable pause to true
};
btn_fw.onRelease = function() {
	clearInterval(timeInterval);
	_root.timeDisplay_txt.text = "00:00/00:00";
	(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
	_root.sound_mc.songStarter(songfile[song_nr]);
};
btn_rev.onRelease = function() {
	clearInterval(timeInterval);
	_root.timeDisplay_txt.text = "00:00/00:00";
	(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
	_root.sound_mc.songStarter(songfile[song_nr]);
};
playlist.load("playlist.xml");
setInterval(duration, 100);
setInterval(soundStatus, 100);

Edited by dlusion, 05 March 2007 - 09:04 AM.


#39 Pax

Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 05 March 2007 - 09:43 AM

MovieClip.prototype.songStarter = function(file) {
	if (this.sound_obj) {
		this.sound_obj.stop();
		delete this.sound_obj;
	}
	_root.sound_mc.sound_obj = new Sound(this);
	_root.sound_mc.sound_obj.loadSound(file, true);
	//_root.sound_mc.sound_obj.setVolume(0);  This line is probably the issue

Comment out the line shown in the code above. That should fix it.

#40 dlusion

dlusion

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 06 March 2007 - 06:31 AM

damn, should've seen that one..

thanks bro




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users