problem with 2013.1031 corona build

hello , i have a problem with 2013.1031 build, more specificaly this block of code returns me a runtime error … this code worked succesfuly with 2013.1008 build.

function scene:enterScene( event )  
 local group = self.view  
 local function onKeyEvent( event )  
  
 local phase = event.phase  
 local keyName = event.keyName  
  
 if( (keyName == "back") and (phase == "down") ) then   
 local function onComplete( event )  
 if "clicked" == event.action then  
 local i = event.index  
 if 1 == i then  
 native.cancelAlert( alert )  
 elseif 2 == i then  
 native.requestExit()  
 end  
 end  
 end  
 local alert = native.showAlert( "??????", "????? ???????? ??? ?????? ?? ???????? ??? ??? ????????;", { "???", "???" }, onComplete )  
 group:insert(alert); --line 450  
  
  
 return true  
 end   
  
 -- for default behavior, return false.  
 return false   
 end   
 Runtime:addEventListener( "key", onKeyEvent );  
 -----------------------------------------------------------------------------  
  
 -- INSERT code here (e.g. start timers, load audio, start listeners, etc.)  
  
 -----------------------------------------------------------------------------  
  
end  
  

the message said : Runtime error , menu.lua:450:ERROR:table expected.If this is a function call, youmight have used ‘.’ instead of ‘:’

Please help!!! [import]uid: 185094 topic_id: 36083 reply_id: 336083[/import]

I don’t think alerts can be inserted into groups. Alert pop-up display over everything on the screen. [import]uid: 114363 topic_id: 36083 reply_id: 143324[/import]

ok… maybe you are right… but why this worked on 2013.1008 ?? what has changed? [import]uid: 185094 topic_id: 36083 reply_id: 143326[/import]

Not sure what changed or why it worked before. Strange that something changed though.

I did look at this page for ShowAlert() and it does state that it cannot be inserted into a group [import]uid: 114363 topic_id: 36083 reply_id: 143328[/import]

well you are right… i changed to comment the line number 450… then it work at first sight, but then it gets me another error on function cancelAlert(native.Alert expected, got nil) … Something very very strange is happening here… and i dont know what is it… i will comment both lines now… i hope it will work. [import]uid: 185094 topic_id: 36083 reply_id: 143330[/import]

That error might be a scope problem… at first glance, [lua]alert[/lua] is defined after your cancel statement. [import]uid: 114363 topic_id: 36083 reply_id: 143333[/import]

of course … it must be after… because this alert is indeed a function -onComplete- call…
and the cancelation of alert object is inside of that function… [import]uid: 185094 topic_id: 36083 reply_id: 143458[/import]

I don’t think alerts can be inserted into groups. Alert pop-up display over everything on the screen. [import]uid: 114363 topic_id: 36083 reply_id: 143324[/import]

ok… maybe you are right… but why this worked on 2013.1008 ?? what has changed? [import]uid: 185094 topic_id: 36083 reply_id: 143326[/import]

Not sure what changed or why it worked before. Strange that something changed though.

I did look at this page for ShowAlert() and it does state that it cannot be inserted into a group [import]uid: 114363 topic_id: 36083 reply_id: 143328[/import]

well you are right… i changed to comment the line number 450… then it work at first sight, but then it gets me another error on function cancelAlert(native.Alert expected, got nil) … Something very very strange is happening here… and i dont know what is it… i will comment both lines now… i hope it will work. [import]uid: 185094 topic_id: 36083 reply_id: 143330[/import]

That error might be a scope problem… at first glance, [lua]alert[/lua] is defined after your cancel statement. [import]uid: 114363 topic_id: 36083 reply_id: 143333[/import]

of course … it must be after… because this alert is indeed a function -onComplete- call…
and the cancelation of alert object is inside of that function… [import]uid: 185094 topic_id: 36083 reply_id: 143458[/import]

I don’t think alerts can be inserted into groups. Alert pop-up display over everything on the screen. [import]uid: 114363 topic_id: 36083 reply_id: 143324[/import]

ok… maybe you are right… but why this worked on 2013.1008 ?? what has changed? [import]uid: 185094 topic_id: 36083 reply_id: 143326[/import]

Not sure what changed or why it worked before. Strange that something changed though.

I did look at this page for ShowAlert() and it does state that it cannot be inserted into a group [import]uid: 114363 topic_id: 36083 reply_id: 143328[/import]

well you are right… i changed to comment the line number 450… then it work at first sight, but then it gets me another error on function cancelAlert(native.Alert expected, got nil) … Something very very strange is happening here… and i dont know what is it… i will comment both lines now… i hope it will work. [import]uid: 185094 topic_id: 36083 reply_id: 143330[/import]

That error might be a scope problem… at first glance, [lua]alert[/lua] is defined after your cancel statement. [import]uid: 114363 topic_id: 36083 reply_id: 143333[/import]

of course … it must be after… because this alert is indeed a function -onComplete- call…
and the cancelation of alert object is inside of that function… [import]uid: 185094 topic_id: 36083 reply_id: 143458[/import]

I don’t think alerts can be inserted into groups. Alert pop-up display over everything on the screen. [import]uid: 114363 topic_id: 36083 reply_id: 143324[/import]