Problem with storyboard

hi

previous i was using “director” in our games, now i want learn use of “storyboard” but i am facing some Runtime Error(attempt to index field)…

–i am trying display of image using “storyboard”

– my main
[lua]local storyboard = require “storyboard”

storyboard.gotoScene(“menu”)[/lua]

– My menu

[lua]local storyboard = require( “storyboard” )
local scene = storyboard.newScene()

local background = display.newImageRect(“background.jpg”,1024,768)
background.x = 512
background.y = 384[/lua]… please help me
[import]uid: 87661 topic_id: 25065 reply_id: 325065[/import]

The best way to help you on this one is to have you check out the 2 links below. Both are ‘short’ tutorials…

the first is the one I read and seems very clear on the minimum code you will need for each scene.

the second is a tutorial just posted yesterday under ‘blog’ on the Corona site. I have not read this one yet, but it appears to deal l more speicifcally with moving from director to storyboard.

http://blog.anscamobile.com/2011/11/introducing-the-storyboard-api/
http://blog.anscamobile.com/2012/04/director-to-storyboard-transition-guide/

hope this helps! [import]uid: 35148 topic_id: 25065 reply_id: 101828[/import]

Yes, you need to read the tutorials. Your menu.lua is missing 95% of the guts that it needs.

You need a function called “createScene” and in that function you load your back ground and you MUST add that to the display group.

Try this:

local storyboard = require( "storyboard" )  
local scene = storyboard.newScene()  
   
function scene:createScene(event)  
 local group = self.view  
  
 local background = display.newImageRect("background.jpg",1024,768)  
 background.x = 512  
 background.y = 384  
  
 group:insert(background)  
end  
  
scene:addEventListener("createScene", scene)  
  

Now you should still have the bit to support enterScene, exitScene and destroyScene, but the above is the minimum code to see your background.
**NOTE

While its technically possible to not have to put the background image into group, there has to be at least one display object added to that group to avoid a bug.
[import]uid: 19626 topic_id: 25065 reply_id: 101851[/import]

thanks!!@ ripps7 and robmiracle, now i got it!!! [import]uid: 87661 topic_id: 25065 reply_id: 101861[/import]

can you please let us no what you did wrong. [import]uid: 6134 topic_id: 25065 reply_id: 101944[/import]