Hello
I have purchase a template and need some help with changing the music in the template. I have never seen this type of action script before so I am not sure how the music is loading. I am used to seeing it in the time line and library which it is not.
I don't see a icon for the music in the libary. I only see a movie clip called player and a movie clip called sound componet that both have some action script ing that reads the following:
var numtrack = 1;
var maxTracks = 3;
var my_sound:Sound = new Sound();
var _this:MovieClip = this;
var txt:TextField = this.txt;
txt.autoSize = true;
//
my_sound.onLoad = function(success:Boolean) {
if (success) {
_this.txt.text = "";
my_sound.start();
_this.txt._x = 0;
clearInterval(_this.interval);
}
};
my_sound.loadSound("music/track1.mp3", false);
function loader(sound:Sound) {
if (sound.getBytesLoaded() != undefined && sound.getBytesTotal() != undefined){
var gbl:Number = sound.getBytesLoaded();
var gbt:Number = sound.getBytesTotal();
} else {
var gbl:Number = 0;
var gbt:Number = 100;
}
_this.txt.text = "track "+numtrack+" "+"loading "+Math.round(gbl/gbt*100)+"%";
//_this.txt._x = -15 - _this.txt._width;
if (gbl >= gbt){
_this.txt.text = "";
}
}
my_sound.onSoundComplete = function() {
numtrack++;
if (numtrack == 4) {
numtrack = 1;
}
my_sound.loadSound("music/track"+numtrack+".mp3", false); var interval:Number = setInterval(_this, "loader", 1, my_sound); } // var interval:Number = setInterval(_this, "loader", 1, my_sound); // player controls btnNext.onRelease = function() {
numtrack++;
if (numtrack == maxTracks+1) {
numtrack = 1;
}
my_sound.loadSound("music/track"+numtrack+".mp3", false);
_this.interval = setInterval(_this, "loader", 1, my_sound); };
btnPrev.onRelease = function() {
numtrack--;
if (numtrack == 0) {
numtrack = 3;
}
my_sound.loadSound("music/track"+numtrack+".mp3", false);
_this.interval = setInterval(_this, "loader", 1, my_sound); };
btnStop.onRelease = function() {
my_sound.start();
my_sound.stop();
};
btnPlay.onRelease = function() {
my_sound.stop();
my_sound.start();
};
THIS WAS ALSO SOME ADDED SCRIPT IN A MOVIE CLIP CALL SOUND- COMPONET
var s_volume = 40;
var widthVolumeLine = s._width;
s._width = s_volume*widthVolumeLine/100; var mySound = new Sound(); var maxvolume = 100; var minvolume = 0; var soundFlag = false; controlSound.onEnterFrame = function() {
mySound.setVolume(s_volume);
if (soundFlag == true) {
s._width = _xmouse;
if (s._width>69) {
s._width = 69;
}
// end if
if (s._width<0 || _xmouse<0) {
s._width = 0;
}
// end if
s_volume = s._width*1.520000;
}
};
var mouseListenerVolume:Object = new Object(); mouseListenerVolume.onMouseDown = function() {
if (controlSound.hitTest(_root._xmouse, _root._ymouse)) {
soundFlag = true;
}
};
mouseListenerVolume.onMouseUp = function() {
soundFlag = false;
};
Mouse.addListener(mouseListenerVolume);
Hopefully this is something simple. I just want to change the song and I am not sure what is happening here.
Please help anyone.
I am new at this which I sure you can tell.
Thanks
Mary