Here’s some code so you you can see it how I’m using it:
[code]
local onButtonPress = function( event )
if (event.phase == “began”) and event.target._id == “link1” and link1.isActive then
audio.play( tapSound, { channel=2, onComplete=audio.stop( 2 ) } )
activeButton.btn = link1
activeButton.call = link1.overSrc
activeButton.y = scrollview.y
system.openURL( “http://www.vandono.com” )
activeButton.btn = nil
elseif (event.phase == “began”) and event.target._id == “link2” and link2.isActive then
audio.play( tapSound, { channel=2, onComplete=audio.stop( 2 ) } )
activeButton.btn = link2
activeButton.call = link2.overSrc
activeButton.y = scrollview.y
system.openURL( “http://www.fearandsunshine.com” )
activeButton.btn = nil
elseif (event.phase == “ended”) and event.target._id == “backBtn” then
–CLEAN OUT MENU GROUP BEFORE CHANGING SCENES
display.remove( allthemgraphics ); allthemgraphics = nil
director:changeScene( “mainmenu”, “fade” )
end
end
– LINK1 BUTTON DATA
link1 = ui.newButton{
defaultSrc = “link1.png”,
defaultX = 198,
defaultY = 76,
overSrc = “link1-over.png”,
overX = 198,
overY = 76,
id = “link1”,
text = “”,
font = “Helvetica”,
textColor = { 255, 255, 255, 255 },
size = 16,
emboss = false
}
link1:setReferencePoint( display.TopCenterReferencePoint )
link1.x = 335 link1.y = 150
link1.isVisible = false
link1:addEventListener(“touch”, onButtonPress)
– LINK2
link2 = ui.newButton{
defaultSrc = “link2.png”,
defaultX = 198,
defaultY = 118,
overSrc = “link2-over.png”,
overX = 198,
overY = 118,
id = “link2”,
text = “”,
font = “Helvetica”,
textColor = { 255, 255, 255, 255 },
size = 16,
emboss = false
}
link2:setReferencePoint( display.TopCenterReferencePoint )
link2.x = 335 link2.y = link1.y + 20
link2.isVisible = false
link2:addEventListener(“touch”, onButtonPress)
–BACK BUTTON
backBtn = ui.newButton{
defaultSrc = “backbutton.png”,
defaultX = 159,
defaultY = 45,
overSrc = “backbutton-over.png”,
overX = 159,
overY = 45,
id = “backBtn”,
text = “”,
font = “Helvetica”,
textColor = { 255, 255, 255, 255 },
size = 16,
emboss = false
}
backBtn.x = 145; backBtn.y = 100
backBtn.isVisible = false
backBtn:addEventListener(“touch”, onButtonPress)
[/code] [import]uid: 14032 topic_id: 11950 reply_id: 44672[/import]