Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 4th, 2003, 07:55 AM
mish mish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 47 mish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 28 m 45 sec
Reputation Power: 6
dynamic jukebox

Hey Guys,

Im building and online jukebox that loads mp3 dynamically from the server. its set in this website. as you can see im having trouble preloading the sounds properly. You can see on an initial click the sound dosnt seem to preload proplery. after a few clicks things start to work.

the jukbox works fine if the sounds are streamed, but i need them to preload, not stream. heres the code that handles the sounds. its placed on the first frame of a single framed movie clip.


Code:
this.onLoad = function() {
	soundLoading = 0;
};
this.onEnterFrame = function() {
	soundTotal = eval(curPath).getBytesTotal();
	soundLoaded = eval(curPath).getBytesLoaded();
	if (preloadNow == 1 && soundLoaded == 0) {
		_root.percentLoadedText = "loading track 0%";
	}
	if (preloadNow == 1 && soundLoaded>0) {
		soundLoading = Math.round((soundLoaded/soundTotal)*100);
		if (soundLoading == 100) {
			preloadNow = 0;
			eval(curPath).start("0","9999");
			_root.percentLoadedText = "playing "+curLoop;
		} else {
			_root.percentLoadedText = "loading track "+soundLoading+"%";
		}
	}
};
_parent.button1.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop1") {
		_root.percentLoadedText = "funk hip hop";
	}
};
_parent.button1.onRelease = function() {
	eval(curPath).stop();
	curLoop = "funk hip hop";
	curPath = "_parent._parent.loop1";
	_root.rootCurLoop = "loop1";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop1.loadSound("../sounds/loop1.mp3", false);
		preloadNow = 1;
	}
};
_parent.button1.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
_parent.button2.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop2") {
		_root.percentLoadedText = "hip hop";
	}
};
_parent.button2.onRelease = function() {
	eval(curPath).stop();
	curLoop = "hip hop";
	curPath = "_parent._parent.loop2";
	_root.rootCurLoop = "loop2";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop2.loadSound("../sounds/loop2.mp3", false);
		preloadNow = 1;
	}
};
_parent.button2.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
_parent.button3.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop3") {
		_root.percentLoadedText = "r & b";
	}
};
_parent.button3.onRelease = function() {
	eval(curPath).stop();
	curLoop = "r & b";
	curPath = "_parent._parent.loop3";
	_root.rootCurLoop = "loop3";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop3.loadSound("../sounds/loop3.mp3", false);
		preloadNow = 1;
	}
};
_parent.button3.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
_parent.button4.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop1") {
		_root.percentLoadedText = "reggae";
	}
};
_parent.button4.onRelease = function() {
	eval(curPath).stop();
	curLoop = "reggae";
	curPath = "_parent._parent.loop4";
	_root.rootCurLoop = "loop4";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop4.loadSound("../sounds/loop4.mp3", false);
		preloadNow = 1;
	}
};
_parent.button4.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
_parent.button5.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop1") {
		_root.percentLoadedText = "reggae 2";
	}
};
_parent.button5.onRelease = function() {
	eval(curPath).stop();
	curLoop = "reggae 2";
	curPath = "_parent._parent.loop5";
	_root.rootCurLoop = "loop5";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop5.loadSound("../sounds/loop5.mp3", false);
		preloadNow = 1;
	}
};
_parent.button5.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
_parent.button6.onRollOver = function() {
	if (preloadNow != 1 && _root.rootCurLoop != "loop1") {
		_root.percentLoadedText = "hip hop";
	}
};
_parent.button6.onRelease = function() {
	eval(curPath).stop();
	curLoop = "hip hop";
	curPath = "_parent._parent.loop6";
	_root.rootCurLoop = "loop6";
	if (playing != curPath) {
		playing = curPath;
		_parent._parent.loop6.loadSound("../sounds/loop6.mp3", false);
		preloadNow = 1;
	}
};
_parent.button6.onRollOut = function() {
	if (soundLoading == 100) {
		_root.percentLoadedText = "playing "+curLoop;
	} else {
		_root.percentLoadedText = "Select your music";
	}
};
stop();


any help would be great, its really got me stumped!

thanks

mish

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > dynamic jukebox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT