chitos
27.04.2018, 09:32
короче говоря нужно сделать что бы действие происходило при нажимании кнопкой , а при отпускании обратное действие
а у меня сейчас получается , что надо 2 раза нажать что бы эти дейтвия произошли
var myMusic = new Sound();
myMusic.attachSound("nasos");
myMusic.stop();
myMusic.onSoundComplete = function ()
{
myMusic.stop();
};
var isPlay = false;
ttt.onPress = function()
{
if (isPlay)
{
isPlay = false;
myMusic.stop();
this.gotoAndStop(3)
}
else
{
isPlay = true;
myMusic.start();
this.gotoAndStop(2)
}
};
а у меня сейчас получается , что надо 2 раза нажать что бы эти дейтвия произошли
var myMusic = new Sound();
myMusic.attachSound("nasos");
myMusic.stop();
myMusic.onSoundComplete = function ()
{
myMusic.stop();
};
var isPlay = false;
ttt.onPress = function()
{
if (isPlay)
{
isPlay = false;
myMusic.stop();
this.gotoAndStop(3)
}
else
{
isPlay = true;
myMusic.start();
this.gotoAndStop(2)
}
};