Question about storyboard

Please consider this code -
 

_________________________________________________________________

**1 function scene:createScene (event)
2 local group = self.view

3 local bgPicture = display.newImage ( “images/myPicture.jpg” )
4 bgPicture.x = display.contentCenterX
5 bgPicture.y = display.contentCenterY
6 bgGroup:insert(bgNewGame)**

7 end

_________________________________________________________________

This code gives me an error. I am wondering what is wrong with it? I’m just not seeing it…Any suggestions?

@jgcthatsme, try changing bgGroup to group and bgNewGame to bigPicture in line 6:

group:insert(bigPicture)

bgGroup and bgNewGame showed up from out of no where the way it is.

Naomi

Okay that works. Thanks. I just want to make sure I understand it though, so…

If their was a situation where, let’s say, line 2 said " local myGroup = self.view", that would mean line 6 would need to read “myGroup:insert(bgNewGame)”, right?

Yes.

bgNewGame still doesn’t exist.  You’d need to rename bigPicture to bgNewGame.   Other than that, as Rob confirmed, myGroup will do.

Naomi

thanks

@jgcthatsme, try changing bgGroup to group and bgNewGame to bigPicture in line 6:

group:insert(bigPicture)

bgGroup and bgNewGame showed up from out of no where the way it is.

Naomi

Okay that works. Thanks. I just want to make sure I understand it though, so…

If their was a situation where, let’s say, line 2 said " local myGroup = self.view", that would mean line 6 would need to read “myGroup:insert(bgNewGame)”, right?

Yes.

bgNewGame still doesn’t exist.  You’d need to rename bigPicture to bgNewGame.   Other than that, as Rob confirmed, myGroup will do.

Naomi

thanks