Jump to content


Photo

MP3 Player Part I+II addon


  • Please log in to reply
47 replies to this topic

#41 nodeNode

nodeNode

    Young Padawan

  • Members
  • Pip
  • 6 posts

Posted 12 April 2006 - 10:01 AM

point it to: _root.movieincludingmp3player.player.on.......blah blah


do that in the main movie that loads the player.swf ?
switch out the "_level0." with _root.movieincludingmp3player.player.on.... ?

nodeNode

#42 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 12 April 2006 - 10:21 AM

yep, exactly..

#43 nodeNode

nodeNode

    Young Padawan

  • Members
  • Pip
  • 6 posts

Posted 12 April 2006 - 11:37 AM

yep, exactly..


ok since it's still not working - please help me see what I don't understand correctly

I've got your main script for the mp3 player in the host swf.
I load mp3player.swf into host.swf with loadMovie("mp3player.swf", player);

the mp3player.swf has no code in it.
the host.swf has the main script with the path like this...

_root.mp3player.player.createEmptyMovieClip("sound_mc", 1);

_root is the host.swf
mp3player is the mp3player.swf
player is the instance name of the empty movieclip

I'm sure I'm all turned around here. thanks for your help
nodeNode

#44 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 12 April 2006 - 12:03 PM

what about making a movie out of the complete mp3player swf, and then load it into your mainmovie?

then your pathing would look like this:

_root.mp3player.

#45 nodeNode

nodeNode

    Young Padawan

  • Members
  • Pip
  • 6 posts

Posted 13 April 2006 - 02:17 PM

what about making a movie out of the complete mp3player swf, and then load it into your mainmovie?

then your pathing would look like this:

_root.mp3player.


cool !
at the beginning of the script I wrote > myPath = _root.mp3player;
and did a find a replace for _root and replaced with _root.mp3player

in the parent swf I wrote > loadMovie("audioplayer.swf", mp3Player);
and named the instance of an empty movieclip to "mp3Player"

...funny thing is ... while writing this out I realized that it's not case sensitive, because I put a capital P on 'mp3Player' in the host swf, but in the audioplayer swf it's lower case.. but it still works...

#46 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 13 April 2006 - 03:13 PM

if you working with actionscript 1, it isn't, as soon as you start using strict data typing and AS 2.0 you need to watch out :)

#47 3dsign

3dsign

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 18 April 2006 - 11:12 PM

edit: Please ignore my question... I'm such an idiot lol... I just didn't have the path pointing correctly.. it was point to the root for the display_txt instants when in fact it's no long in the root it's in the player instance.

sorry.
thanks again for the tutorial!!!
peace

--------
Hey everyone...

First off cool tutorials Funky!! Much appreciated.

I feel kinda stupid asking this question cuz I have used ur tutorial before and had this problem and figured it out for myself but stupid me i must have deleted the original file where I fixed my issues so now I am redesigning a site and the player and I am stuck. lol

anyway, I can't get the name and band of the song to display in the display_txt box I created for it. everything else I have got working.. the sound plays it stops and I can skip and rewind. just not song name and band display.

I have the players controls inside one MC that will eventually be loaded in to another movie via the loadMovie action.

Any suggestions. I have named the instance correctly and there is not a case issue.

Thanks in advance for your help!!

Edited by 3dsign, 19 April 2006 - 12:00 AM.


#48 jius

jius

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 31 May 2006 - 07:35 PM

Hi i have this player, i have a movie that loads another movie with the player and it doesn't works rigth, i can make it play the songs and everythings works except for the playlist buttons i think the target paths are the problem because thats how i fixed everything else but i cant make that part work. here is the code i'm using

Here you can see it working
And here you download the fla

stop();
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+10);
		eval("but"+i).id=i;
		_root["but"+i]._x = 450;
		_root["but"+i]._y = 550 + (i*15);
		_root["but"+i].but_txt.text = songname[i];
		trace (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;
	}
	this.sound_obj = new Sound(this);
	this.sound_obj.loadSound(file, true);
	this.sound_obj.setVolume(0);
	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;
			title_txt.text =artist+" - "+track;
		} else {
			title_txt.text = "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]);
	};
	volume1.dragger.onPress = function() {
		startDrag(this, true, 0, this._y, this._parent.volBG._width, this._y);
		toolTip._visible = true;
		//-----Para hacer el drag del Volumen
		//setInterval(draggableTip,100);
		/*function draggableTip(){
			toolTip._x = _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() {
		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 * 260;
	duration = _root.sound_mc.sound_obj.duration;
	position = _root.sound_mc.sound_obj.position;
	playHead._x = 135 + position / duration * 272 + 5;
}

btn_play.onRelease = function() {
	clearInterval(timeInterval);
	this._parent.timeDisplay_txt.text = "00:00/00:00";
	_root.sound_mc.songStarter(songfile[song_nr]);
};
btn_stop.onRelease = function() {
	clearInterval(timeInterval);
	this._parent.timeDisplay_txt.text = "00:00/00:00";
	_root.sound_mc.sound_obj.stop();
};
btn_fw.onRelease = function() {
	clearInterval(timeInterval);
	this._parent.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);
	this._parent.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 jius, 31 May 2006 - 07:37 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users