运行时错误尝试索引本地' fay' (零值)

时间:2015-05-04 01:30:22

标签: lua corona

我试图制作一个简单的菜单。我的程序在Corona模拟器中的窗口编译得很好但是当我为android构建程序时,它会收到"运行时错误尝试索引本地' example1' (零值)。有谁知道如何帮助我?非常感谢!! 这是更新的代码

module (...,package.seeall)

  function new()

    local menuGroup = display.newGroup()

    local background = display.newImage("graphics/background3.png")


    local example1 = display.newImage("graphics/Example1.png")
    example1.x = 720
    example1.y = 150
    example1.scene = "example1"

    local example2 = display.newImage("graphics/Example2.png")
    example2.x = 720
    example2.y = 450
    example2.scene = "example2"

    local example3 = display.newImage("graphics/Example3.png")
    example3.x = 720
    example3.y = 750
    example3.scene = "example3"

    local example4 = display.newImage("graphics/Example4.png")
    example4.x = 720
    example4.y = 1050
    example4.scene = "example4"

    menuGroup:insert(background)
    menuGroup:insert(example1)
    menuGroup:insert(example2)
    menuGroup:insert(example3)
    menuGroup:insert(example4)

    example1:addEventListener("touch", changeScene)
    example2:addEventListener("touch", changeScene)
    example3:addEventListener("touch", changeScene)
    example4:addEventListener("touch", changeScene)

    return menuGroup
end

0 个答案:

没有答案