This works in the simulator and not on the actual device. Returns a Director ERROR params
[code]
module(…, package.seeall)
new = function ( params )
local localGroup = display.newGroup()
– Imports
local ui = require ( “ui” )
– Groups
– Display Objects
local background = display.newImage( “Cand.png” )
local title = display.newText( “Director Class”, 0, 0, native.systemFontBold, 16 )
local createdBy = display.newText( “Created by Stephen”, 0, 0, native.systemFontBold, 16 )
local website = display.newText( “http://www.joinm.com”, 0, 0, native.systemFontBold, 16 )
– Link
local goBlog = function ( event )
if event.phase == “ended” then
system.openURL( “http://www.joinm.com” )
end
end
createdBy:addEventListener( “touch”, goBlog )
website:addEventListener( “touch”, goBlog )
–====================================================================–
– BUTTONS
–====================================================================–
– Functions
local bt01 = function ( event )
if event.phase == “release” then
director:changeScene( “stb01”, “moveFromRight” )
end
end
local bt02 = function ( event )
if event.phase == “release” then
director:changeScene( “word”, “overFromRight” )
end
end
local bt03 = function ( event )
if event.phase == “release” then
director:changeScene( “Hol”, “moveFromTop” )
end
end
local bt04 = function ( event )
if event.phase == “release” then
director:changeScene( “cat”, “overFromBottom” )
end
end
local bt05 = function ( event )
if event.phase == “release” then
director:changeScene( “Ion”, “flip” )
end
end
local bt06 = function ( event )
if event.phase == “release” then
director:changeScene( “ni”, “downFlip” )
end
end
– UI Objects
local bt01 = ui.newButton{
default = “Bi.png”,
over = “Bi.png”,
onEvent = bt01,
id = “bt01”
}
local bt02 = ui.newButton{
default = “eu.png”,
over = “eu.png”,
onEvent = bt02,
id = “bt02”
}
local bt03 = ui.newButton{
default = “do.png”,
over = “do.png”,
onEvent = bt03,
id = “bt03”
}
local bt04 = ui.newButton{
default = “hp.png”,
over = “hp.png”,
onEvent = bt04,
id = “bt04”
}
local bt05 = ui.newButton{
default = “ca.png”,
over = “ca.png”,
onEvent = bt05,
id = “bt05”
}
local bt06 = ui.newButton{
default = “Ca.png”,
over = “Ca.png”,
onEvent = bt06,
id = “bt06”
}
– Inserts
localGroup:insert( background )
localGroup:insert( title )
localGroup:insert( createdBy )
localGroup:insert( website )
localGroup:insert( bt01 )
localGroup:insert( bt02 )
localGroup:insert( bt03 )
localGroup:insert( bt04 )
localGroup:insert( bt05 )
localGroup:insert( bt06 )
– Positions
bt01.x = 105
bt01.y = 580
bt02.x = 270
bt02.y = 580
bt03.x = 435
bt03.y = 580
bt04.x = 610
bt04.y = 580
bt05.x = 785
bt05.y = 580
bt06.x = 920
bt06.y = 580
createdBy.x = 160
createdBy.y = 440
website.x = 160
website.y = 460
– Colors
– Listeners
– Listener
– Initiate variables
– MUST return a display.newGroup()
return localGroup;
end
[/code] [import]uid: 88495 topic_id: 29483 reply_id: 329483[/import]