Hi all,
I’m trying to make a volume button for my site and it looks something like this:
- ||||| +
i want the volume bar to start filled and when the user hits the minus button it lowers the volume and when it hit plus it takes the volume up
well when I go down and up the volume bars start to get crazy…it just works when I go down the whole way and after it goes up the whole way, when I change direction on the midle of the path it jumps some bars… here is the code i’m using any ideias?
thanks a lot
volDown.addEventListener(MouseEvent.CLICK, menosVol);
volUp.addEventListener(MouseEvent.CLICK, maisVol);
var cliques:uint = 0
if (cliques == 7){
cliques = 6
}
if (cliques == -1){
cliques = 0
}
function menosVol(e:MouseEvent):void{
cliques ++
if (cliques == 1){
volBar.vol5.alpha = 0.5
}
if (cliques == 2){
volBar.vol4.alpha = 0.5
}
if (cliques == 3){
volBar.vol3.alpha = 0.5
}
if (cliques == 4){
volBar.vol2.alpha = 0.5
}
if (cliques == 5){
volBar.vol1.alpha = 0.5
cliques = 6
}
}
function maisVol(e:MouseEvent):void{
cliques --
if (cliques == 1){
volBar.vol5.alpha = 1
cliques = 0
}
if (cliques == 2){
volBar.vol4.alpha = 1
}
if (cliques == 3){
volBar.vol3.alpha = 1
}
if (cliques == 4){
volBar.vol2.alpha = 1
}
if (cliques == 5){
volBar.vol1.alpha = 1
}
}
thanks a lot!!!