Storyboard don't work on device but work on simulator

Hi!

I have some problem, on simulator everythink was ok but on device i can’t click Play and end other button credits and exit does’t render. So far seemed to me that I made the wrong database, but when i delete all source related with db my problem is not resolved

my sources

local storyboard = require( "storyboard" ) local scene = storyboard.newScene() system.activate("multitouch") if(storyboard.IsAllowPlay == true) then local backgroundMusic = audio.loadStream("\_sound/background.mp3") local backgroundMusicChannel = audio.play( backgroundMusic, {channel=1, loops=-1 } ) end local function StartPlay( self, event ) if event.phase == "began" then storyboard.gotoScene("onFirstRun", "crossFade", 200 ) end end local function GoToCredits( self, event ) if event.phase == "began" then storyboard.gotoScene("tworcy", "crossFade", 200 ) end end local function ExitGame( self, event ) if event.phase == "began" then os.exit(); end end local Play, Exit, Creditsy function scene:createScene( event ) local menu = self.view local background = display.newImage("\_img/background.png", 382, 510); menu:insert(background); local title = display.newImage("\_img/title.png", 382, 120); menu:insert(title); Play.touch = StartPlay; menu:insert(Play); Creditsy = display.newImage( "\_img/credits.png",400, 710, true) Creditsy.touch = GoToCredits; menu:insert(Creditsy); Exit = display.newImage( "\_img/exit.png",400, 950, true) Exit.touch = ExitGame; menu:insert(Exit); end function scene:enterScene( event ) local menu = self.view Play:addEventListener("touch", Play) Creditsy:addEventListener("touch", Creditsy) Exit:addEventListener("touch", Exit) storyboard.purgeAll(); end function scene:exitScene( event ) local menu = self.view Play:removeEventListener("touch", Play) Creditsy:removeEventListener("touch", Creditsy) Exit:removeEventListener("touch", Exit) end function scene:destroyScene( event ) local menu = self.view end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) scene:addEventListener( "destroyScene", scene ) return scene

Any ideas?

Thanks in Advice

 

Pardon Play of course have

Play = display.newImage( "\_img/play.png",400, 470, true)

Any can help?

Play:addEventListener(“touch”, Play)

Play doesn’t seem to exist as a function so how are you assigning it to the play button?
 

Play have :

Play.touch = StartPlay;

i think that’s enough :slight_smile:

Um no because if you meant to use the built in touch on the display object, then it would be play: touch and not play.Touch

I had this problem where it worked in the simulator and not on the device.  The problem was the spelling (or capitalization) of the scene name I wished to go to.   If the scene name was  sceneOne and I put  sceneone it would work in the simulator but not on the device. 

@Fernker

Thst’s usually caused by a difference between unity naming and windows. Windows will usually ignore case in filenames but, unity does not so on unity or android/ios Fred is not the same as fred where as on windows they are!

With ‘m zap’ I’m not sure why his listeners would work as in lua play: touch is not the same function as play.Touch for a start one will pass in a reference to self and the other will not. So calling a function with signature (self, event) would cause issues if self isn’t being passed in as a parameter.

:slight_smile: i can’t belive. My graphic after “Play” beginning with a capital letter when i change this to small letter app starts working:)

Pardon Play of course have

Play = display.newImage( "\_img/play.png",400, 470, true)

Any can help?

Play:addEventListener(“touch”, Play)

Play doesn’t seem to exist as a function so how are you assigning it to the play button?
 

Play have :

Play.touch = StartPlay;

i think that’s enough :slight_smile:

Um no because if you meant to use the built in touch on the display object, then it would be play: touch and not play.Touch

I had this problem where it worked in the simulator and not on the device.  The problem was the spelling (or capitalization) of the scene name I wished to go to.   If the scene name was  sceneOne and I put  sceneone it would work in the simulator but not on the device. 

@Fernker

Thst’s usually caused by a difference between unity naming and windows. Windows will usually ignore case in filenames but, unity does not so on unity or android/ios Fred is not the same as fred where as on windows they are!

With ‘m zap’ I’m not sure why his listeners would work as in lua play: touch is not the same function as play.Touch for a start one will pass in a reference to self and the other will not. So calling a function with signature (self, event) would cause issues if self isn’t being passed in as a parameter.

:slight_smile: i can’t belive. My graphic after “Play” beginning with a capital letter when i change this to small letter app starts working:)