Author Topic: Can't entry to game while add on_signal( sig ) case "select":  (Read 6081 times)

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Dear All,

I want to play sound while click select button. Then, I added below code on default grid theme. A sound is working, but it can't entry the game. Please help to fix it.


case "select":
         local previewClick = fe.add_sound("selectclick.mp3")   
         previewClick.playing=true   
         return true;

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #1 on: May 01, 2017, 01:22:58 AM »
yeah, i have the same problem some time ago,

try to put this,

case "select":
         local previewClick = fe.add_sound("selectclick.mp3")   
         previewClick.playing=true   

         enable=true;

         return true;

its work with any variable non declare

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #2 on: May 01, 2017, 06:09:53 AM »
Not working  :'(

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #3 on: May 01, 2017, 11:37:38 AM »

popoklo

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #4 on: May 04, 2017, 10:11:08 AM »
return false. not true ;)

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #5 on: May 04, 2017, 11:19:11 AM »
qqplayer, popoklo

both not ok  :(

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #6 on: May 04, 2017, 11:22:04 AM »
Well, I have tested as below 4 codes. 1 & 3 can play sound and do  fe.signal action. But 2 & 4 is not ok and will be hang. I don't why, may be it is a bugs for AM  :(
 


1. case "select":
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         fe.signal( "add_favourite" );   
         return true;

2. case "select":
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         fe.signal( "select" );   
         return true;

3. case "add_favourite":
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         fe.signal( "select" );   
         return true;

4. case "add_favourite":
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         fe.signal( "add_favourite" );   
         return true;
« Last Edit: May 04, 2017, 11:24:37 AM by kent79 »

popoklo

  • Full Member
  • ***
  • Posts: 50
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #7 on: May 05, 2017, 11:59:27 PM »
case "select":
{
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         
         return false;
}

tried this?

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #8 on: May 06, 2017, 05:38:12 AM »
case "select":
{
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         
         return false;
}

tried this?

not working.  :(

bjose2345

  • Sr. Member
  • ****
  • Posts: 107
    • View Profile
Re: Can't entry to game while add on_signal( sig ) case "select":
« Reply #9 on: May 06, 2017, 05:03:01 PM »
Well maybe i can give you another idea, try to dont overwrite the select case, instead use the default case

example

default:
         local previewClick = fe.add_sound("selectclick.mp3")   
         previewClick.playing=true 

hope this idea work for you Kent.