Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Player - Brano che parte in automatico

    Salve gente, avrei un quesito da porvi. Ho beccato tramite un motore di ricerca un player in flash, l'ho customizzato al sito e l'ho inserito. L'unico problema è che la musica si avvia da sola all'apertura della home, ed inoltre al passaggio dalla home ad un'altra pagina riparte nuovamente un brano (random). Io vorrei che all'apertura della home page non partisse il brano in automatico, ma che sia io a dover cliccare sul simbolo "play" per farlo partire. Di seguito vi posto l'action script


    codice:
    stop();
    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);
    	_global.song_nr = random(songfile.length);
    	_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[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;
    }
    MovieClip.prototype.songStarter = function(file, name, band) {
    	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.onEnterFrame = function() {
    		if (this.sound_obj.position>0) {
    			delete this.onEnterFrame;
    			this._parent.display_txt.text = name+" / "+band;
    			timeInterval = setInterval(timer, 1000, this.sound_obj);
    		} else {
    			this._parent.display_txt.text = "loading...";
    		}
    	};
    	this.sound_obj.onSoundComplete = function() {
    		clearInterval(timeInterval);
    		this._parent.timeDisplay_txt.text = "00:00";
    		(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]);
    	};
    	this._parent.volume1.dragger.onPress = 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;
    			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() {
    		stopDrag();
    	};
    };
    btn_play.onRelease = function() {
    	clearInterval(timeInterval);
    	this._parent.timeDisplay_txt.text = "00:00";
    	this._parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr]);
    };
    btn_stop.onRelease = function() {
    	clearInterval(timeInterval);
    	this._parent.timeDisplay_txt.text = "00:00";
    	this._parent.sound_mc.sound_obj.stop();
    };
    btn_fw.onRelease = function() {
    	clearInterval(timeInterval);
    	this._parent.timeDisplay_txt.text = "00:00";
    	(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);
    	this._parent.timeDisplay_txt.text = "00:00";
    	(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");
    Per aspera ad astra

  2. #2
    Nessuno che sappia aiutarmi?
    Per aspera ad astra

  3. #3
    Help me please!
    Per aspera ad astra

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.