Visualizzazione dei risultati da 1 a 9 su 9

Discussione: Creare radio online

  1. #1

    Creare radio online

    Ciao a tutti,

    ho bisogno del vostro aiuto per realizzare una cosa che già da un po' di tempo mi "intrippa" parecchio...

    Gestisco un sito dedicato a tutti i musicisti emergenti della mia provincia e volevo creare una radio in streaming che permetta di diffondere 24 ore su 24 i pezzi in formato mp3 dei vari gruppi...

    Il problema è che non so proprio da dove iniziare... conosco vagamente Flash (rimasugli di scuola).

    il portale vero e proprio è fatto in PHP... gli mp3 verranno tutti inseriti in una cartella e rinominati con un numero progressivo 001.mp3, 002.mp3, ecc...

    I dati del file (autore, titolo, ecc...) vengono salvati all'interno di una tabella in un database...

    La mia idea è quella di realizzare un player che vada a creare una playlist (a random o quasi, almeno all'inizio) alla prima visita giornaliera, e poi trasmetta questa playlist in streaming...

    Il problema è che non so da dove iniziare, qualcuno mi da' una mano???

  2. #2
    o fai una cosa tipo questa

    http://www.mediaradio.net/default.asp?pag=codice

    oppure la simuli con un swf che carica gli mp3 uno alla volta da una cartella

    inserisci un file txt con l'elenco, e mandi in esecuzione il brano alla fine dell'esecuzione si carica l'altro ecc..
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  3. #3
    la prima, Mediaradio mi lascia inserire i pezzi che voglio io oppure trasmette i pezzi che vuole lei??

    Se volessi fare un swf da dove devo partire????qualche esempio??

  4. #4
    La prima non so ma credo di si dovresti leggere unpò sul sito.

    La seconda soluzione eccola, devi solo copiare e incollare il codice creare un mc vuoto oche chiami container come istanza sul frame dove metti il codice il primo frame del tuoo movie in pratica e mettere gli mp3 dentro swf a parte allungare la timeline per la durata del mp3 e poi scrivere l'elenco nel txt come da codice di esempio.

    Questo script di and3a legge l'elenco da txt e manda in riproduzione swf

    tu potresti mettere gli mp3 negli swf con la timeline allungata tanto quanto la
    durata del tuo mp3, finito questo legge la seconda e così via per tutto l'elenco,
    finito l'elenco riparte da l primo brano


    codice sul keyframe del file main.fla

    codice:
    // BLOCCO LA ROOT; SUPERFLUO IN QUESTO CASO, UTILE SE QUESTO SWF 
    // E' ALL' INTERNO DI UNA LATRO E CARICATO
    this._lockroot = true;
    
    // CREO IL CONTENITORE CHE E' UN MOVIECLIP CON NOME ISTANZA container DI DEFAULT
    // A POSIZIONE X = 0 / Y = 0 , VISIBLE E ALPHA 100 con ROTATION 0
    this.createEmptyMovieClip( 'container', this.getNextHighestDepth() );
    
    
    // CREO IL GESTORE DI EVENTI, UN OGGETTO CON METODI DEDICATI
    // COME LISTENER DEL MOVIECLIPLOADER ED ALTRI UTILI AL TUO SCOPO
    var swfloader:Object = new Object();
    
    // EVENTO LISTENER: onLoadInit
    // 	Richiamato dal MovieClipLoader a MC caricato e disponibile
    //  [ esiste anche l' onLoadComplete, ma l' MC in quel caso non e' disponibile a keyframe 1 ]
    swfloader.onLoadInit = function( mc:MovieClip ):Void {
    	
    	// POSIZIONO L' SWF CARICATO AL PRIMO FRAME
    	_root['container'].gotoAndStop( 1 );
    	// LO RENDO VISIBILE
    	_root['container']._visible = true;
    	// ASSEGNO IL PATH PER RISALIRE ALL' OGGETTO
    	// swfloader QUANDO MI SERVIRA' ...
    	_root['container'].__path = this;
    	// INIZIO L' ONENTERFRAME:
    	// onEnterFrame e' un loop che ha latenza 1 fotogramma
    	// questo significa che quando e' invocato non parte immediatamente
    	// looppa priam sul primo keyframe del MovieClip sulla quale viene applicato
    	// poi passa al successivo o fa quello che gli viene detto di fare
    	// Nell' onEnterFrame il riferimento di default e' THIS, ovvero il MovieClip
    	// alla quale viene applicato.
    	_root['container'].onEnterFrame = function() {
    		// se il frame di questo MC e' un frame minore del totale frames disponibili ...
    		if( this._currentframe < this._totalframes ) {
    			// vado al frame successivo , ovvero questo frame + 1
    			this.gotoAndStop( ++this._currentframe );
    		}
    		// altrimenti sono a fine frames, ergo timeline finita
    		else {
    			// in questo caso controllo che il contenitore con tutti gli MC
    			// che e' una variabile interna all' oggetto swfloader che e' il path
    			// di riferimento della variabile __path di questo MC assegnata precedentemente
    			// ... se non esiste il prossimo filmato, basato sul fatto che l' array
    			// swfloader.__container sara' giunto al termine
    			if( this.__path.__container[ this.__path.__containerNum ] == undefined ) {
    				// allora reimposto la variabile swfloader.__containerNum a 0, cosi' 
    				// da ricaricare il primo degli SWF disponibili
    				this.__path.__containerNum = 0;
    			}
    			// a questo punto sono sicuro che esistera' il valore contenuto nell' array
    			// swfloader.__container[ this.__path.__containerNum ]
    			// che per comodita' incremento di 1 per passare poi al controlo sul valore contenuto
    			// nel prossimo indice dell' array swfloader.__container
    			this.__path.loadMovie( this.__path.__container[ this.__path.__containerNum++ ] );
    			
    			// qui elimino questo onEnterFrame perche' non mi serve piu' il LOOP su questo movieClip
    			delete this.onEnterFrame;
    		}
    	}
    }
    
    // EVENTO LISTENER: onLoadProgress
    // 	Richiamato dal MovieClipLoader durante il caricamento del MovieClip
    // ci rende noti i bytes caricati e quelli totali
    swfloader.onLoadProgress = function( mc:MovieClip, bl:Number, bt:Number ):Void {
    	
    	// creo la solita perc , magari la usi ma in locale questo metodo non
    	// funzionera' mai, o meglio, non te ne accorgi, solo online servira' a qualcosa
    	var p:Number = Math.floor( ( bl / bt ) * 100 );
    	if( p != NaN && p != infinity && p > 0 ) {
    		trace( mc + ', ' + p );
    	}
    }
    
    // EVENTO LISTENER: onLoadError
    // 	Richiamato dal MovieClipLoader se e' impossibile caricare il file richiesto
    // Rende noto l' errore generato
    swfloader.onLoadError = function( mc:MovieClip, error:String ):Void {
    	trace( error );
    }
    
    // EVENTO PERSONALE, ASSEGNATO PER COMODITA': loadMovie
    // Questo evento dell' oggetto swfloader altro on fa che eliminare
    // il precedente MovieClipLoader per ricrearlo su una variabile interna
    // quale e' __ML__ , allo stesso tempo esegue l' unloadMOvie sul MovieClip
    // container della _root, probabilmente superfluo visto che un loadMovie su
    // un movieClip che ha caricato qualcosa, scarica questo qualcosa in automatico
    // ... ma imho sempre meglio fare le cose in modo ordinato
    swfloader.loadMovie = function( swf:String ):Void {
    	// metto l' MC invisibile, cosi' durante il caricamento, nell' onLoadProgress
    	// sono sicuro che se l' SWF non ha STOP(); a inizio filmato tale filmato non mi parta per
    	// i fatti suoi frame dopo frame , a seconda di cosa carica
    	_root['container']._visible = false;
    	
    	// se e' almeno la seconda volta che richiamo questo metodo __ML__ sara' definito
    	if( this.__ML__ != undefined ) {
    		// quindi scarico il MovieClip container e cancello la variabile __ML__ ....
    		_root['container'].unloadMovie();
    		delete this.__ML__;
    	}
    	// la quale viene riassegnata o creata come MovieClipLoader
    	this.__ML__ = new MovieClipLoader();
    	// per poi aggiungergli swfloader come listener, in modo da far gestire al MovieClipLoader
    	// glie eventi dedicati descritti sopra
    	this.__ML__.addListener( this );
    	// per poi dirgli cosa caricare e dove, in questo caso carica il testo contenuto
    	// in swf sul movieClip _root['container']
    	this.__ML__.loadClip( swf, _root['container'] );
    }
    
    // EVENTO PERSONALE, ASSEGNATO PER COMODITA': preload
    // Questo metodo er' l' inizializzatore di tutto sto' sistemino di caricamento files
    // altro non fara' che leggersi le informazioni sui nomi dei files che andranno a popolare
    // l' array creato per gestire il loop, inizializzare, oltre l' array, una variabile
    // numerica per controllare o sapere sempre a che punto dell' array sono e cosa devo 
    // caricare poi, tale variabile sara' swfloader.__containerNum , mentre l' array sara'
    // swfloader.__container
    swfloader.preload = function( txtFile:String ):Void {
    	
    	// creo l' oggetto LoadVars con scope interno, perche' una volta usato non mi servira' piu'
    	var __lv__:LoadVars = new LoadVars();
    	// dico a questo oggetto il path di riferimento per creare o gestire variabili appartenenti a swfloader
    	// ovviamente essendo dentro un metodo di swfloader il path di riferimento sara' THIS, riferito a se stesso
    	__lv__.__path = this;
    	// scrivo cosa fare all' onLoad
    	__lv__.onLoad = function( s:Boolean ):Void {
    		// se trovo il file ...
    		if( s == true ) {
    			// creo la variabile swfloader.__container come nuovo Array
    			this.__path.__container = new Array();
    			// mi creo una variabile convenzionale per fare il loop delle informazioni nel file di testo
    			var a:Number = 0;
    			// finche' esiste 'fileN' dove N sara' incrementato di 1 in 1 ad ogni loop di questo ciclo ...
    			while( this['file'+String(a)] != undefined ) {
    				// aggiungi all' Array swfloader.__container il nome o il testo di questa variabile
    				// this['file'+String( a )] sara' esattamente this.file0 , this.file1, etc etc
    				// per comodita' incremento la a direttamente in assegnazione
    				this.__path.__container.push( this['file'+String( a++ )] );
    			}
    			// arrivati a this.fileN , inesistente , quindi undefined, quindi usciti dal ciclo precedente ...
    			// creo la variabile numerica swfloader.__containerNum facendola partire da 0 ... poi
    			// sara' questo applicativo stesso a gestirla, incrementarla o riresettarla
    			this.__path.__containerNum = new Number( 0 );
    			
    			// bene, ho le informazioni sull' array, ho il primo elemento da caricare
    			// ... quale momento migliore per far partire il tutto ???
    			this.__path.loadMovie( this.__path.__container[ this.__path.__containerNum++ ] );
    			// per comodita' incremento di uno la variabile swfloader.__containerNum
    			// cosi' al prossimo controllo sull' array verifichero' che esista
    			// swfloader.__container[1] e non zero che gia' so di averlo usato e che quindi e' presente nell' array
    		}
    		else {
    			// impossibile caricare il file di testo
    			this.__path.onLoadError( _root, 'Impossibile caricare il file: ' + txtFile );
    		}
    	}
    	
    	// effettuo il load del file specificato in txtFile
    	__lv__.load( txtFile );
    }
    
    // avvio l' ambaradan ...
    swfloader.preload( 'file.txt' );
    testo all' interno del file file.txt

    codice:
    &file0=pippo.swf&
    &file1=pluto.swf&
    &file2=paperino.swf&


    altri SWF nella stessa carella:
    pippo.swf
    pluto.swf
    paperino.swf
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  5. #5
    Perdona la mia ignoranza ma non sarebbe possibile evitare di creare un swf per ogni file e fargli caricare direttamente il file in formato .mp3?

  6. #6
    se iresci a modificare lo script si, è possibile il concetto di caricamento è qllo, poi per mp3 devi calcolare la sua durata, con swf puoi farlo contando i frame totali della timeline con mp3 devi calcolare la fine del brano
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  7. #7
    questa è una classe mp3 player

    codice:
    // mp3Player class
    _soundbuftime = 1;
    mp3Player = function (songs, interF, reservedDepth) {
    	if (songs != undefined && interF != undefined && reservedDepth != undefined && typeof songs == "object" && typeof interF == "object" && typeof reservedDepth == "number") {
    		this.sound = new Object(new Sound(_root));
    		this.songs = songs;
    		this.player = interF;
    		this.positionDump = 0;
    		this.songs.index = 0;
    		this.sound.paused = false;
    		this.sound.stopped = false;
    		this.curVolume = 100;
    		this.player.songInfo.html = true;
    		this.player.songInfo.condenseWhite = true;
    		this.player.songInfo.autoSize = "left";
    		this.player.volumeNR.autoSize = "center";
    		this.safeDepth = reservedDepth-1;
    		this.player.progressIndicator.offset = this.player.progressIndicator._x;
    		this.loadHandler = _root.createEmptyMovieClip("LH", ++this.safeDepth);
    		this.progressHandler = _root.createEmptyMovieClip("PH", ++this.safeDepth);
    		this.volumeHandler = _root.createEmptyMovieClip("VH", this.safeDepth+3);
    		this.volumeSlideHandler = _root.createEmptyMovieClip("VSH", ++this.safeDepth+4);
    		// Start functions ----------------------------------------------------------------------------------------------------
    		this.setRollOver(1);
    		this.setControls();
    		this.setInitialVolume(100);
    		this.sound.loadSound(this.songs[this.songs.index].url, true);
    		this.showLoaded();
    		this.showSongInfo();
    		this.indicateStatus(1);
    		this.indicateProgress();
    		this.enableDrag();
    		// 
    	} else {
    		trace("Invalid parameter(s) specified.");
    	}
    };
    mp3Player.prototype.stopProgressIndicator = function() {
    	delete this.progressHandler.onEnterFrame;
    };
    mp3Player.prototype.resetProgressIndicator = function() {
    	delete this.progressHandler.onEnterFrame;
    	this.player.progressIndicator._x = this.player.progressIndicator.offset;
    };
    mp3Player.prototype.disableDrag = function() {
    	delete this.player.progressIndicator.onPress;
    	delete this.player.progressIndicator.onRelease;
    	delete this.player.progressIndicator.onReleaseOutside;
    };
    mp3Player.prototype.indicateStatus = function(stat) {
    	var tar;
    	stat>0 ? tar=this.player.playButton : stat+1 ? tar=this.player.pauseButton : tar=this.player.stopButton;
    	this.player.statusIndicator.easeX(tar._x);
    };
    mp3Player.prototype.showSongInfo = function() {
    	var artist = this.songs[this.songs.index].artist;
    	var title = this.songs[this.songs.index].title;
    	var output = artist+" - "+title;
    	this.player.songInfo.htmlText = output;
    };
    mp3Player.prototype.next = function() {
    	this.sound.stop();
    	this.songs.index++;
    	if (this.songs.index>this.songs.length-1) {
    		this.songs.index = 0;
    	}
    	this.showSongInfo();
    	this.sound = new Object(new Sound(_root));
    	this.sound.loadSound(this.songs[this.songs.index].url, true);
    	this.sound.setVolume(this.curVolume);
    	this.showLoaded();
    	this.indicateStatus(1);
    	this.indicateProgress();
    };
    mp3Player.prototype.setInitialVolume = function(x) {
    	var ref = this;
    	var tgt = x/100*this.player.volumeHeight;
    	var vitgt = this.player.volumeBar._y-tgt;
    	this.player.volumeNR.text = 100;
    	this.sound.setVolume(x);
    	this.curVolume = x;
    	this.volumeHandler.onEnterFrame = function() {
    		ref.player.volumeIndicator._y = vitgt-(vitgt-ref.player.volumeIndicator._y)/1.2;
    		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
    		if (ref.player.volumeIndicator._y>vitgt-1 && ref.player.volumeIndicator._y<vitgt+1 && ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.setVolumeDrag = function(x) {
    	if (x>100) {
    		x = 100;
    	}
    	if (x<0) {
    		x = 0;
    	}
    	var ref = this;
    	var tgt = x/100*this.player.volumeHeight;
    	this.sound.setVolume(x);
    	this.curVolume = x
    	this.player.volumeNR.text = Math.round(x);
    	this.volumeHandler.onEnterFrame = function() {
    		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
    		if (ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.dragVolumeSlider = function() {
    	var ref = this;
    	var maxH = this.player.volumeHeight;
    	var vi = this.player.volumeIndicator;
    	var vb = this.player.volumeBar;
    	this.volumeSlideHandler.onEnterFrame = function() {
    		conv = {x:0, y:_root._ymouse};
    		globalToLocal(conv);
    		this._y = conv.y;
    		if (conv.y>=vb._y-maxH-1 && conv.y<=vb._y+1) {
    			vi._y = conv.y;
    			ref.setVolumeDrag((vb._y-conv.y)*100/maxH);
    		}
    	};
    };
    mp3Player.prototype.previous = function() {
    	this.sound.stop();
    	this.songs.index--;
    	if (this.songs.index<0) {
    		this.songs.index = this.songs.length-1;
    	}
    	this.showSongInfo();
    	this.sound = new Object(new Sound(_root));
    	this.sound.loadSound(this.songs[this.songs.index].url, true);
    	this.sound.setVolume(this.curVolume);
    	this.showLoaded();
    	this.indicateStatus(1);
    	this.indicateProgress();
    };
    mp3Player.prototype.indicateProgress = function() {
    	var ref = this;
    	this.progressHandler.onEnterFrame = function() {
    		var played = ref.sound.position;
    		var total = ref.songs[ref.songs.index].duration;
    		ref.player.progressIndicator._x = ref.player.progressIndicator.offset+((played/total)*ref.player.loadWidth);
    		if (played>=total) {
    			delete this.onEnterFrame;
    			ref.resetProgressIndicator();
    			ref.next();
    		}
    	};
    };
    mp3Player.prototype.showLoaded = function() {
    	var ref = this;
    	this.loadHandler.onEnterFrame = function() {
    		var loaded = ref.sound.getBytesLoaded();
    		var total = ref.songs[ref.songs.index].totalbytes;
    		ref.player.loadBar._width = (loaded/total)*ref.player.loadWidth;
    		if (loaded == total) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.setRollOver = function(grow) {
    	if (grow) {
    		this.player.previousButton.onRollOver = this.player.stopButton.onRollOver=this.player.pauseButton.onRollOver=this.player.playButton.onRollOver=this.player.nextButton.onRollOver=function () {
    			this.grow();
    		};
    		this.player.previousButton.onRollOut = this.player.stopButton.onRollOut=this.player.pauseButton.onRollOut=this.player.playButton.onRollOut=this.player.nextButton.onRollOut=function () {
    			this.shrink();
    		};
    	} else {
    		this.player.previousButton._alpha = this.player.stopButton._alpha=this.player.pauseButton._alpha=this.player.playButton._alpha=this.player.nextButton._alpha=30;
    		this.player.previousButton.onRollOver = this.player.stopButton.onRollOver=this.player.pauseButton.onRollOver=this.player.playButton.onRollOver=this.player.nextButton.onRollOver=function () {
    			this.fadeIn();
    		};
    		this.player.previousButton.onRollOut = this.player.stopButton.onRollOut=this.player.pauseButton.onRollOut=this.player.playButton.onRollOut=this.player.nextButton.onRollOut=function () {
    			this.fadeOut();
    		};
    	}
    };
    mp3Player.prototype.setControls = function() {
    	var ref = this;
    	var playB = this.player.playButton;
    	var prevB = this.player.previousButton;
    	var stopB = this.player.stopButton;
    	var nextB = this.player.nextButton;
    	var pauseB = this.player.pauseButton;
    	var volIndic = this.player.volumeIndicator;
    	volIndic.onPress = function() {
    		ref.dragVolumeSlider();
    	};
    	volIndic.onRelease = volIndic.onReleaseOutside=function () {
    		delete ref.volumeSlideHandler.onEnterFrame;
    	};
    	pauseB.onRelease = function() {
    		if (!ref.sound.stopped) {
    			ref.sound.stop();
    			ref.indicateStatus(0);
    			ref.sound.paused = true;
    			ref.sound.stopped = false;
    			ref.sound.pausedPosition = ref.sound.position;
    			ref.stopProgressIndicator();
    		}
    	};
    	stopB.onRelease = function() {
    		ref.sound.stop();
    		ref.indicateStatus(-1);
    		ref.sound.stopped = true;
    		ref.sound.paused = false;
    		ref.sound.pausedPosition = 0;
    		ref.resetProgressIndicator();
    	};
    	playB.onRelease = function() {
    		if (ref.sound.stopped) {
    			ref.indicateProgress();
    			ref.indicateStatus(1);
    			ref.sound.start(0, 1);
    			ref.sound.stopped = false;
    		} else if (ref.sound.paused) {
    			ref.indicateProgress();
    			ref.indicateStatus(1);
    			ref.sound.start(ref.sound.pausedPosition/1000, 1);
    			ref.sound.paused = false;
    		}
    	};
    	nextB.onRelease = function() {
    		ref.resetProgressIndicator();
    		ref.next();
    	};
    	prevB.onRelease = function() {
    		ref.resetProgressIndicator();
    		ref.previous();
    	};
    };
    mp3Player.prototype.enableDrag = function() {
    	var ref = this;
    	this.player.progressIndicator.onPress = function() {
    		ref.sound.stop();
    		ref.stopProgressIndicator();
    		ref.indicateStatus(0);
    		ref.sound.paused = true;
    		ref.sound.stopped = false;
    		total = ref.songs[ref.songs.index].duration;
    		this.onEnterFrame = function() {
    			conv = {x:_root._xmouse};
    			globalToLocal(conv);
    			this._x = conv.x;
    			if (conv.x<ref.player.loadBar._x) {
    				this._x = ref.player.loadBar._x;
    			}
    			if (conv.x>ref.player.loadBar._x+ref.player.loadWidth) {
    				this._x = ref.player.loadBar._x+ref.player.loadWidth;
    			}
    			var percent = ((this._x-ref.player.loadBar._x)/ref.player.loadWidth)*100;
    			this.newPosition = (percent*total)/100;
    		};
    	};
    	this.player.progressIndicator.onRelease = this.player.progressIndicator.onReleaseOutside=function () {
    		if (this.newPosition>=ref.songs[ref.songs.index].duration) {
    			this.newPosition = ref.songs[ref.songs.index].duration-1;
    		}
    		delete this.onEnterFrame;
    		ref.sound.start(ref.player.progressIndicator.newPosition/1000, 1);
    		ref.sound.paused = false;
    		ref.sound.stopped = false;
    		ref.indicateStatus(1);
    		ref.indicateProgress();
    	};
    };
    //prototypes
    MovieClip.prototype.fadeIn = function() {
    	this.onEnterFrame = function() {
    		this._alpha += 2;
    		this._alpha>=100 ? delete this.onEnterFrame : null;
    	};
    };
    MovieClip.prototype.fadeOut = function() {
    	this.onEnterFrame = function() {
    		this._alpha -= 2;
    		this._alpha<=30 ? delete this.onEnterFrame : null;
    	};
    };
    MovieClip.prototype.grow = function() {
    	var t = 150;
    	this.onEnterFrame = function() {
    		this._xscale = this._yscale=t-(t-this._xscale)/1.2;
    		if (this._xscale>t-1 && this._xscale<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    MovieClip.prototype.shrink = function() {
    	var t = 100;
    	this.onEnterFrame = function() {
    		this._xscale = this._yscale=t-(t-this._xscale)/1.2;
    		if (this._xscale>t-1 && this._xscale<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    MovieClip.prototype.easeX = function(t) {
    	this.onEnterFrame = function() {
    		this._x = t-(t-this._x)/1.2;
    		if (this._x>t-1 && this._x<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    // creation of mp3Player class instance and junk
    songsArray = new Array();
    playerInterface = new Object();
    playerInterface.playButton = this.playButton;
    playerInterface.stopButton = this.stopButton;
    playerInterface.pauseButton = this.pauseButton;
    playerInterface.previousButton = this.previousButton;
    playerInterface.nextButton = this.nextButton;
    playerInterface.loadBar = this.loadbar;
    playerInterface.loadWidth = 165;
    playerInterface.progressIndicator = this.proIndic;
    playerInterface.statusIndicator = this.statusIndic;
    playerInterface.songInfo = this.songInfo;
    playerInterface.volumeBar = this.volumeBar;
    playerInterface.volumeNR = this.volumeNR;
    playerInterface.volumeIndicator = this.volumeIndic;
    playerInterface.volumeHeight = 60;
    //---------------------------------------------------
    
    XMLRetrieve = new XML();
    XMLRetrieve.ignoreWhite = true;
    XMLRetrieve.load("http://www.miosito.com/playlist.xml");
    XMLRetrieve.onLoad = function() {
    	for (var j = 0; j<this.firstChild.childNodes.length; j++) {
    		/* Handle duration and convert to milliseconds */
    		dur = this.firstChild.childNodes[j].attributes.duration;
    		dblPnt = dur.indexOf(":");
    		mins = Number(dur.substr(0, dblPnt));
    		sec = Number(dur.substr(dblPnt+1, dur.length));
    		ms = ((mins*60)+sec)*1000;
    		/* Handle filesize and convert to bytes */
    		songsArray.push({title:this.firstChild.childNodes[j].attributes.title, artist:this.firstChild.childNodes[j].attributes.artist, url:this.firstChild.childNodes[j].firstChild.nodeValue, duration:ms, totalbytes:Number(this.firstChild.childNodes[j].attributes.filesize)});
    	}
    	player = new mp3Player(songsArray, playerInterface, 1);
    };
    Devi fare l'elenco in xml

    modifica questa parte per partire in pausa, ora va in play direttamente
    codice:
    // Start functions 
    		this.setRollOver(1);
    		this.setControls();
    		this.setInitialVolume(100);
    		this.sound.loadSound(this.songs[this.songs.index].url, false);
    		this.showLoaded();
    		this.showSongInfo();
    		this.indicateStatus(1);
    		this.indicateProgress();
    		this.enableDrag();
    		
    			this.sound.stop();
    			this.indicateStatus(0);
    			this.sound.paused = true;
    			this.sound.stopped = false;
    			this.sound.pausedPosition = ref.sound.position;
    			this.stopProgressIndicator(); 		
    		//
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  8. #8
    ok, grazie, appena ho tempo provo a buttare giù qualcosa...

    Vi terrò informati

    Grazie 1000!!!

  9. #9
    facii sapere mi raccomando

    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.