soundControl.setUseTouchEvents(true); closeButton.setUseToucEvents(true); function soundControl::onMouseDown(%this, %modifier, %worldPosition, %clicks) { alxPlay(clickSound); if(%this.on) { alxStop($musicHandle); %this.on = false; %this.setImageMap(sound_offImageMap); } else { $musicHandle = alxPlay(Bgm1); %this.on = true; %this.setImageMap(sound_onImageMap); } } function soundControl::onTouchDown(%this, %event) { alxPlay(clickSound); %this.setImageMap(speakerclickedImageMap); if(%this.on) { alxStop($musicHandle); %this.on = false; %this.setImageMap(sound_offImageMap); } else { $musicHandle = alxPlay(Bgm1); %this.on = true; %this.setImageMap(sound_onImageMap); } } function closeButton:: onMouseDown(%this, %modifier, %worldPosition, %clicks) { alxPlay(clickSound); %this.setTimerOff(); %this.setTimerOn(7000); closeButton.setPosition(7.466,135.964); soundControl.setPosition(-16.052,136.344); yesButton.setPosition(-13.832,110.272); noButton.setPosition(7.130,110.272); } function closeButton::onTouchDown(%this, %event) { alxPlay(clickSound); %this.setTimerOff(); %this.setTimerOn(7000); closeButton.setPosition(7.466,135.964); soundControl.setPosition(-16.052,136.344); yesButton.setPosition(-13.832,110.272); noButton.setPosition(7.130,110.272); } function closeButton:: onTimer(%this) { %this.setTimerOff(); closeButton.setPosition(7.130,110.272); soundControl.setPosition(-13.832,110.272); yesButton.setPosition(-16.052,136.344); noButton.setPosition(7.466,135.964); } function yesButton:: onMouseDown(%this, %modifier, %worldPosition, %clicks) { alxPlay(clickSound); %this.setTimerOff(); alxStop($JungleAmbienceHandle); alxStop($musicHandle); alxStop($Player1HeliHoverHandle); alxStop($Player2HeliHoverHandle); sceneWindow2D.schedule( 0, LoadLevel, expandFileName ("game/data/levels/GameMenu.t2d")); } function yesButton:: onTouchDown(%this, %event) { alxPlay(clickSound); %this.setTimerOff(); alxStop($JungleAmbienceHandle); alxStop($musicHandle); alxStop($Player1HeliHoverHandle); alxStop($Player2HeliHoverHandle); sceneWindow2D.schedule( 0, LoadLevel, expandFileName ("game/data/levels/GameMenu.t2d")); } function noButton:: onMouseDown(%this, %modifier, %worldPosition, %clicks) { alxPlay(clickSound); %this.setTimerOff(); closeButton.setPosition(7.130,110.272); soundControl.setPosition(-13.832,110.272); yesButton.setPosition(-16.052,136.344); noButton.setPosition(7.466,135.964); } function noButton:: onTouchDown(%this, %event) { alxPlay(clickSound); %this.setTimerOff(); closeButton.setPosition(7.130,110.272); soundControl.setPosition(-13.832,110.272); yesButton.setPosition(-16.052,136.344); noButton.setPosition(7.466,135.964); }