95Roadkill icon

Flash RTS Sound/Music (WIP)

95Roadkill | PRO | 10/27/14 05:20:06 PM UTC | 0 ⭐ | 10878 👁️ | Never ⏰ | []
ActionScript |

2.91 KB

|

None

|

0 👍

/

0 👎

var mVolume:Number = 100
var originalMVolume:Number = 100;
var musicV:Number = 80
var originalMusicVolume:Number = 80;
 
 
menuSound = new Sound ();
menuSound.attachSound("menuIn")
song1 = new Sound ();
song2 = new Sound ();
song3 = new Sound ();
song4 = new Sound ();
song1.attachSound("menu0.wav");
song2.attachSound("menu1.wav");
song3.attachSound("menu2.wav");
song4.attachSound("menu3.wav")
var song1Played:Boolean = false;
var song2Played:Boolean = false;
var song3Played:Boolean = false;
var song4Played:Boolean = false;
var minNum:Number = 0;
var maxNum:Number = 3;
var isPlaying:Boolean = false
 
soundSettings.onEnterFrame = function(){
    trace(originalMVolume)
    song1.setVolume (musicV)
    song2.setVolume (musicV)
    song3.setVolume (musicV)
    song4.setVolume (musicV)
    mBar._xscale = originalMVolume / 4
    musicBar._xscale = originalMusicVolume / 4
    if(mVolume >= 100){
    mVolume = 100
    }
    if(mVolume <= 0){
    mVolume = 0
    }
    if(musicV >= 100){
    musicV = 100
    }
    if(musicV <= 0){
    musicV = 0
    }
    if (musicV > mVolume){
        musicV-=5
    }
    if (originalMVolume > mVolume){
    originalMVolume--
    }
    if (originalMVolume < mVolume){
    originalMVolume++
    }
    if (originalMusicVolume > musicV){
    originalMusicVolume--
    }
    if (originalMusicVolume < musicV){
    originalMusicVolume++
    }
}
soundSettings.masterVolumeNegative.onRelease = function (){
    mVolume -=10
}
soundSettings.masterVolumePlus.onRelease = function (){
    mVolume +=10
}
soundSettings.musicVolumeNegative.onRelease = function (){
    musicV -=10
}
soundSettings.musicVoumePlus.onRelease = function (){
    musicV +=10
}
 
 
 
function menuMusic(){
trace(musicNum);
trace(isPlaying)
if(song1Played == true && song2Played == true && song3Played == true && song4Played == true){
    song1Played = false
    song2Played = false
    song3Played = false
    song4Played = false
}
if (song1.playing == false && song2.playing == false && song3.playing == false && song4Played == false){
    isPlaying = false
}
if(isPlaying == false){
musicNum = Math.floor(Math.random() * (maxNum - minNum + 1));
if (musicNum == 0){
        if(song1Played == false){
        trace("Playing Menu0");
        isPlaying = true
        song1.start(0,1)
        song1.onSoundComplete = function (){
        isPlaying = false
        song1Played = true
        }
   }
}
 
if (musicNum == 1){
        if(song2Played == false){
        isPlaying = true
        song2.start(0,1)
        song2.onSoundComplete = function (){
        isPlaying = false
        song2Played = true
    }
  }
}
 
if (musicNum == 2){
        if(song3Played == false){
        trace("Playing Menu2")
        isPlaying = true
         song3.start(0,1)
         song3.onSoundComplete = function (){
         isPlaying = false
         song3Played = true
         }
     }
 }
 if (musicNum == 3){
        if(song4Played == false){
        trace("Playing Menu3")
        isPlaying = true
         song4.start(0,1)
         song4.onSoundComplete = function (){
         isPlaying = false
         song4Played = true
         }
     }
 }
}
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Cuiznxcn icon
    05/18/26 04:35:37 AM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400