get current textfield

This seems so simple but …

Basically i have multiple textfields.

I assign each one a id like :

myTextField.id = 3

i cannot seem to access this id either by event.id or event.target.id when using the keyboard handlers…

Anyone any ideas? [import]uid: 6981 topic_id: 11950 reply_id: 311950[/import]

Just had this problem. I had to use event.target._id

Don’t know why but it worked. Figured it out by doing print(event.target) and it spewed out a whole lot of data and that’s where I found it with the underscore. [import]uid: 14032 topic_id: 11950 reply_id: 44221[/import]

are you saying that Corona is changing the name of the programmer assigned id attribute to be _id?? I’d be really surprised at that.

I don’t believe the _id in the answer, is the same as the id in the question but someone correct me if I’m wrong [import]uid: 6175 topic_id: 11950 reply_id: 44640[/import]

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]