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) { } function closeButton::onTouchDown(%this, %event) { }