Get a button to enlarge when touched until another button is touched and enlarged

So basically, I have about 8 buttons on my screen. I want them to enlarge when they are touched and stay that way until one of the other buttons are touched, then the other will enlarge and this one will shrink. Right now I am using widget.newButton but cannot find a way to do it. [import]uid: 113560 topic_id: 32336 reply_id: 332336[/import]

For this, I think you should store references to the buttons in a Lua table, and when one button is pressed you cycle through and check the “state” of each button. If it’s already enlarged, you shrink it. If it’s the button being pressed, you enlarge it. All other buttons remain the same. Of course, you check and change the state of each button depending on what happens to it… and you ensure that if a button is already enlarged, you can’t RE-enlarge it.

Does this help?
Brent [import]uid: 9747 topic_id: 32336 reply_id: 128724[/import]

so what i have is
[lua]local fbButton = display.newImageRect(“fbbutton.png”, 64,64)
fbButton.x = _W*.18
fbButton.y = _H*.45
group:insert(fbButton)

local twButton = display.newImageRect(“twbutton.png”, 64,64)
twButton.x = _W*.5
twButton.y = _H*.45
group:insert(twButton)

local tuButton= display.newImageRect(“tubutton.png”, 64,64)
tuButton.x = _W*.83
tuButton.y = _H*.45
group:insert(tuButton)

local yoButton= display.newImageRect(“yobutton.png”, 64,64)
yoButton.x = _W*.18
yoButton.y = _H*.6
group:insert(yoButton)

local igButton= display.newImageRect(“igbutton.png”, 64,64)
igButton.x = _W*.5
igButton.y = _H*.6
group:insert(igButton)

local piButton= display.newImageRect(“pibutton.png”, 64,64)
piButton.x = _W*.83
piButton.y = _H*.6
group:insert(piButton)

local gpButton= display.newImageRect(“gpbutton.png”, 64,64)
gpButton.x = _W*.18
gpButton.y = _H*.75
group:insert(gpButton)

local liButton= display.newImageRect(“libutton.png”, 64,64)
liButton.x = _W*.5
liButton.y = _H*.75
group:insert(liButton)

fbButton.id = 1
twButton.id = 2
tuButton.id = 3
yoButton.id = 4
igButton.id = 5
piButton.id = 6
gpButton.id = 7
liButton.id = 8[/lua]

and the listeners/function

[lua]local function icon( event )
print( event.target.id )

----------------------------------Facebook---------------------------------------------

if(event.target.id==1) then
print(fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if fbButton.contentHeight ==64 then
fbButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘facebook’
if(false and not(isFacebookLogged)) then
fbCommand = GET_USER_INFO
facebook.login( ‘538512666164069’, listener, {“publish_stream”} )
if(isSimulator) then libFacebook.login( {“publish_stream”}, listener ); end
end

----------------------------------Twitter---------------------------------------------

elseif(event.target.id==2) then

print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if twButton.contentHeight ==64 then
twButton:scale(1.8,1.8)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘twitter’
if(not(twitterID)) then
native.showAlert(‘Error!’, ‘Please provide your twitter ID.’, {‘Ok’})
end

----------------------------------tumblr---------------------------------------------

elseif(event.target.id==3) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if tuButton.contentHeight ==64 then
tuButton:scale(1.8,1.8)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end

useSocial = ‘tumblr’
if(not(tumblrID)) then
native.showAlert(‘Error!’, ‘Please provide your tumblr ID.’, {‘Ok’})
end

----------------------------------YouTube---------------------------------------------

elseif(event.target.id==4) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if yoButton.contentHeight ==64 then
yoButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end

useSocial = ‘youtube’
if(not(youtubeID)) then
native.showAlert(‘Error!’, ‘Please provide your YouTube ID.’, {‘Ok’})
end

----------------------------------Instagram---------------------------------------------

elseif(event.target.id==5) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if igButton.contentHeight ==64 then
igButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘instagram’
if(not(instagramID)) then
native.showAlert(‘Error!’, ‘Please provide your Instagram ID.’, {‘Ok’})
end

----------------------------------Pintrest---------------------------------------------

elseif(event.target.id==6) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if piButton.contentHeight ==64 then
piButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘pinterest’
if(not(pinterestID)) then
native.showAlert(‘Error!’, ‘Please provide your Pinterest ID.’, {‘Ok’})
end

----------------------------------Google Plus---------------------------------------------

elseif(event.target.id==7) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if gpButton.contentHeight ==64 then
gpButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘googleplus’
if(not(googleplusID)) then
native.showAlert(‘Error!’, ‘Please provide your Google+ ID.’, {‘Ok’})
end

----------------------------------Linkedin---------------------------------------------

elseif(event.target.id==8) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if liButton.contentHeight ==64 then
liButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)
end
useSocial = ‘linkedin’
if(not(linkedinID)) then
native.showAlert(‘Error!’, ‘Please provide your Linkedin ID.’, {‘Ok’})
end

local appData = readFileData(‘appData.txt’)
appData.useSocial = useSocial
writeFileData(‘appData.txt’, appData)
return true
end
end

fbButton:addEventListener( “touch”, icon )
twButton:addEventListener( “touch”, icon )
tuButton:addEventListener( “touch”, icon )
yoButton:addEventListener( “touch”, icon )
igButton:addEventListener( “touch”, icon )
piButton:addEventListener( “touch”, icon )
gpButton:addEventListener( “touch”, icon )
liButton:addEventListener( “touch”, icon )[/lua]

this works great but then I run into a problem. I can only press each button 3 times. After that, they become unresponsive [import]uid: 113560 topic_id: 32336 reply_id: 128817[/import]

For this, I think you should store references to the buttons in a Lua table, and when one button is pressed you cycle through and check the “state” of each button. If it’s already enlarged, you shrink it. If it’s the button being pressed, you enlarge it. All other buttons remain the same. Of course, you check and change the state of each button depending on what happens to it… and you ensure that if a button is already enlarged, you can’t RE-enlarge it.

Does this help?
Brent [import]uid: 9747 topic_id: 32336 reply_id: 128724[/import]

so what i have is
[lua]local fbButton = display.newImageRect(“fbbutton.png”, 64,64)
fbButton.x = _W*.18
fbButton.y = _H*.45
group:insert(fbButton)

local twButton = display.newImageRect(“twbutton.png”, 64,64)
twButton.x = _W*.5
twButton.y = _H*.45
group:insert(twButton)

local tuButton= display.newImageRect(“tubutton.png”, 64,64)
tuButton.x = _W*.83
tuButton.y = _H*.45
group:insert(tuButton)

local yoButton= display.newImageRect(“yobutton.png”, 64,64)
yoButton.x = _W*.18
yoButton.y = _H*.6
group:insert(yoButton)

local igButton= display.newImageRect(“igbutton.png”, 64,64)
igButton.x = _W*.5
igButton.y = _H*.6
group:insert(igButton)

local piButton= display.newImageRect(“pibutton.png”, 64,64)
piButton.x = _W*.83
piButton.y = _H*.6
group:insert(piButton)

local gpButton= display.newImageRect(“gpbutton.png”, 64,64)
gpButton.x = _W*.18
gpButton.y = _H*.75
group:insert(gpButton)

local liButton= display.newImageRect(“libutton.png”, 64,64)
liButton.x = _W*.5
liButton.y = _H*.75
group:insert(liButton)

fbButton.id = 1
twButton.id = 2
tuButton.id = 3
yoButton.id = 4
igButton.id = 5
piButton.id = 6
gpButton.id = 7
liButton.id = 8[/lua]

and the listeners/function

[lua]local function icon( event )
print( event.target.id )

----------------------------------Facebook---------------------------------------------

if(event.target.id==1) then
print(fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if fbButton.contentHeight ==64 then
fbButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘facebook’
if(false and not(isFacebookLogged)) then
fbCommand = GET_USER_INFO
facebook.login( ‘538512666164069’, listener, {“publish_stream”} )
if(isSimulator) then libFacebook.login( {“publish_stream”}, listener ); end
end

----------------------------------Twitter---------------------------------------------

elseif(event.target.id==2) then

print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if twButton.contentHeight ==64 then
twButton:scale(1.8,1.8)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘twitter’
if(not(twitterID)) then
native.showAlert(‘Error!’, ‘Please provide your twitter ID.’, {‘Ok’})
end

----------------------------------tumblr---------------------------------------------

elseif(event.target.id==3) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if tuButton.contentHeight ==64 then
tuButton:scale(1.8,1.8)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end

useSocial = ‘tumblr’
if(not(tumblrID)) then
native.showAlert(‘Error!’, ‘Please provide your tumblr ID.’, {‘Ok’})
end

----------------------------------YouTube---------------------------------------------

elseif(event.target.id==4) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if yoButton.contentHeight ==64 then
yoButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end

useSocial = ‘youtube’
if(not(youtubeID)) then
native.showAlert(‘Error!’, ‘Please provide your YouTube ID.’, {‘Ok’})
end

----------------------------------Instagram---------------------------------------------

elseif(event.target.id==5) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if igButton.contentHeight ==64 then
igButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘instagram’
if(not(instagramID)) then
native.showAlert(‘Error!’, ‘Please provide your Instagram ID.’, {‘Ok’})
end

----------------------------------Pintrest---------------------------------------------

elseif(event.target.id==6) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if piButton.contentHeight ==64 then
piButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘pinterest’
if(not(pinterestID)) then
native.showAlert(‘Error!’, ‘Please provide your Pinterest ID.’, {‘Ok’})
end

----------------------------------Google Plus---------------------------------------------

elseif(event.target.id==7) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if gpButton.contentHeight ==64 then
gpButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)

elseif liButton.contentHeight >64 then
liButton:scale(.55555555,.55555555)
end
useSocial = ‘googleplus’
if(not(googleplusID)) then
native.showAlert(‘Error!’, ‘Please provide your Google+ ID.’, {‘Ok’})
end

----------------------------------Linkedin---------------------------------------------

elseif(event.target.id==8) then
print("contentHeight: "… fbButton.contentHeight, twButton.contentHeight, tuButton.contentHeight, yoButton.contentHeight, igButton.contentHeight, piButton.contentHeight, gpButton.contentHeight, liButton.contentHeight)

if liButton.contentHeight ==64 then
liButton:scale(1.8,1.8)

elseif twButton.contentHeight >64 then
twButton:scale(.55555555,.55555555)

elseif tuButton.contentHeight >64 then
tuButton:scale(.55555555,.55555555)

elseif yoButton.contentHeight >64 then
yoButton:scale(.55555555,.55555555)

elseif fbButton.contentHeight >64 then
fbButton:scale(.55555555,.55555555)

elseif piButton.contentHeight >64 then
piButton:scale(.55555555,.55555555)

elseif gpButton.contentHeight >64 then
gpButton:scale(.55555555,.55555555)

elseif igButton.contentHeight >64 then
igButton:scale(.55555555,.55555555)
end
useSocial = ‘linkedin’
if(not(linkedinID)) then
native.showAlert(‘Error!’, ‘Please provide your Linkedin ID.’, {‘Ok’})
end

local appData = readFileData(‘appData.txt’)
appData.useSocial = useSocial
writeFileData(‘appData.txt’, appData)
return true
end
end

fbButton:addEventListener( “touch”, icon )
twButton:addEventListener( “touch”, icon )
tuButton:addEventListener( “touch”, icon )
yoButton:addEventListener( “touch”, icon )
igButton:addEventListener( “touch”, icon )
piButton:addEventListener( “touch”, icon )
gpButton:addEventListener( “touch”, icon )
liButton:addEventListener( “touch”, icon )[/lua]

this works great but then I run into a problem. I can only press each button 3 times. After that, they become unresponsive [import]uid: 113560 topic_id: 32336 reply_id: 128817[/import]

Hi again,
At a quick glance, it looks like you have the correct approach. However, I think those big conditional statements within each “case” (which button was pressed) are causing a problem.

You know which button has been pressed by the “id” you gave it. So, when that button has been pressed, you just need to check individually all of the other 7 buttons to determine if they are “scaled up” or not. In each case, if the button is scaled up, scale it back down… if it’s already scaled down, do nothing to it. In other words, take out all of the “elseif-elseif-elseif” stuff and put them into individual “if-then” clauses.

Brent
[import]uid: 9747 topic_id: 32336 reply_id: 129351[/import]

Hi again,
At a quick glance, it looks like you have the correct approach. However, I think those big conditional statements within each “case” (which button was pressed) are causing a problem.

You know which button has been pressed by the “id” you gave it. So, when that button has been pressed, you just need to check individually all of the other 7 buttons to determine if they are “scaled up” or not. In each case, if the button is scaled up, scale it back down… if it’s already scaled down, do nothing to it. In other words, take out all of the “elseif-elseif-elseif” stuff and put them into individual “if-then” clauses.

Brent
[import]uid: 9747 topic_id: 32336 reply_id: 129351[/import]