Re: [Flashcoders] MP3 Streaming Player check

2006-05-02 Thread Jonathan Berry

Thanks for the e-mail, Eric. Hey I just wanted to ask everyone to look at my
code and tell me if there is anything that you can see that might be able to
be optimised or changed. I have not used a streaming media source before and
wanted to see if you think I am doing everything as best as possible or even
just correctly:

System.security.allowDomain("http://www.live365.com";);
var up:Boolean = false;
var reloadInt:Number;
function createLoaderText(output){
   _root.createEmptyMovieClip("loader_mc",1000);
   loader_mc.createTextField("p_txt",1100,60,6,160,20);
   loader_mc.p_txt.text = output;
   var loadingFmt:TextFormat = new TextFormat();
   loadingFmt.font = "My Font";
   loadingFmt.color = 0xFF9900;
   loadingFmt.bold = true;
   loader_mc.p_txt.embedFonts = true;
   loader_mc.p_txt.setTextFormat(loadingFmt);
   loader_mc.onEnterFrame = function(){
   if(up == false){
   this.p_txt._alpha -= 5;
   if(this.p_txt._alpha <= 0){
   up = true;
   }
   }else{
   this.p_txt._alpha += 5;
   if(this.p_txt._alpha >= 100){
   up = false;
   }
   }
   }
}
var radio:Sound = new Sound();
var volume:Number = 50;
var marker:MovieClip = volume_mc.slider_mc;
var volTrackFactor = volume_mc.track_mc._width/100;
var stopped:Boolean = false;
var trackLoaded:Boolean;
var stopped:Boolean = false;
vumeter_mc.stop();
function playRadio(){
   if(!loader_mc){
   createLoaderText("loading");
   }
   mute_mc.gotoAndStop(1);
   volume_mc.slider_mc._x = volume_mc.track_mc._x +
volume_mc.track_mc._width/2 - 10;
   if (typeof radio == "object") {
   radio.stop();
   delete radio;
   }
   stopped = false;
   radio = new Sound(this);
   radio.setVolume(volume);
   radio.loadSound("http://www.live365.com/play/signonsandiego/pro",true);
   stop1_btn.enabled = true;
   stop1_btn._alpha = 100;
   play1_btn.enabled = false;
   play1_btn._alpha = 30;
   var lastPosition = 0;
   vumeter_mc.onEnterFrame = function(){
   if(radio.position > 1 && stopped==false && radio.position >
lastPosition){
   lastPosition = radio.position;
   clearInterval(reloadInt);
   loader_mc.removeMovieClip();
   vumeter_mc.play();
   //delete this.onEnterFrame;
   }else{
   if(!loader_mc){
   createLoaderText("buffering");
   }
   vumeter_mc.gotoAndStop(1);
   }
   }
   reload();
}
play1_btn.onRelease = function(){ playRadio(); }
stop1_btn.onRelease = stopPlay;
function stopPlay(){
   delete vumeter_mc.onEnterFrame;
   clearInterval(reloadInt);
   loader_mc.removeMovieClip();
   mute_mc.gotoAndStop(1);
   vumeter_mc.gotoAndStop(1);
   stopped = true;
   radio.stop();
   play1_btn.enabled = true;
   play1_btn._alpha = 100;
   stop1_btn.enabled = false;
   stop1_btn._alpha = 30;
}
marker.onPress = function ():Void {
   this.startDrag(false, 0, this._y, volume_mc.track_mc._width-20,
this._y);
   this.onMouseMove = function():Void {
   mute_mc.gotoAndStop(1);
   volume = Math.floor(this._x/volTrackFactor);
   radio.setVolume(volume);
   updateAfterEvent();
   }
}
marker.onRollOver = function(){
   marker.gotoAndStop(2);
}
marker.onRollOut = function(){
   marker.gotoAndStop(1);
}
marker.onRelease = marker.onReleaseOutside = function():Void {
   this.stopDrag();
   delete this.onMouseMove;
}
var mute:Boolean = false;
mute_mc.onRollOver = function(){
   mute_mc.gotoAndStop(2);
}
mute_mc.onRollOut = function(){
   if(mute){
   mute_mc.gotoAndPlay(3);
   }else{
   mute_mc.gotoAndStop(1);
   }
}
mute_mc.onRelease = function(){
   if(mute==true){
   mute_mc.gotoAndStop(1);
   mute = false;
   marker._x = volume_mc.track_mc._x +
(volume_mc.track_mc._width/(100/volume));
   radio.setVolume(volume);
   }else{
   mute_mc.gotoAndPlay(3);
   mute = true;
   radio.setVolume(0);
   marker._x = volume_mc.track_mc._x;
   }
}
playRadio();
function reload(){
   reloadInt = setInterval(function(){if(((getTimer()/1000)>4)&&(
radio.position < 1)){stopPlay(); playRadio();}},4000);
}
stop();


Thanks in advance.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] MP3 Streaming Player check

2006-05-02 Thread Éric Thibault

Error onload :

line : 1503
car : 2
error : g365CurVer undefined
Code: 0
URL .../sosdradio/index.html

Runs OK on both Firefox (1.5.0.2) and IE (6.0.29 SP2) on my XP pro with 
all the patches.


The music stats then stops then restats again...

A+

Jonathan Berry a écrit :

Hello all,
I wondered if some of you could check on a radio player I created for 
one of
our sites. It uses live365 and we chose Flash because of the 
cross-browser
compatibility. It streams from my computer, my home computers, and a 
lot of

other people's computers that we have tested, but for a few only does it
not. I am just looking for streaming problems across a wider sweep of the
possible user base.
http://www.amplifysd.com - if you had the time perhaps some of you could
check in both browsers as well. Thanks in advance.

--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
===

Éric Thibault
Programmeur analyste
Réseau de valorisation de l'enseignement
Université Laval, pavillon Félix-Antoine Savard
Québec, Canada
Tel.: 656-2131 poste 18015
Courriel : [EMAIL PROTECTED]

===

Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de 
confidencialidad 

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] MP3 Streaming Player check

2006-05-02 Thread Jonathan Berry

Hello all,
I wondered if some of you could check on a radio player I created for one of
our sites. It uses live365 and we chose Flash because of the cross-browser
compatibility. It streams from my computer, my home computers, and a lot of
other people's computers that we have tested, but for a few only does it
not. I am just looking for streaming problems across a wider sweep of the
possible user base.
http://www.amplifysd.com - if you had the time perhaps some of you could
check in both browsers as well. Thanks in advance.

--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com