Hi all,
I have a question about the following line in the storyboard scene template:
[lua]local group=self.view[/lua]
I’m trying to add an item to the same view group in a callback from media.playVideo and when I do that, I get a nil reference for self in the callback function.
[lua]function onVidComplete( event )
local viewGroup = self.view – self is nil here and an error is thrown
– code to add new image goes here
end
function scene:enterScene( event )
local viewGroup = self.view
media.playVideo(“video/start.mov”, false, onVidComplete)
end[/lua]
What are others doing in situations similar to this? I was thinking of making a reference to self.view that is local to the scene, rather than local to the methods, then setting its value in enterScene. But it seems to me that the template was designed to have the methods with their own local viewGroup variables for a reason. Help?
Thanks,
Jay [import]uid: 89562 topic_id: 21615 reply_id: 321615[/import]