When I touch the rectA and after I touch the rectB, rectA is released immediately. The error show in html5 but in android it work ok. Try code in below.
local rectA = display.newRect( 200, 200, 200, 200 ); rectA.name = "A" local rectB = display.newRect( 800, 200, 200, 200 ); rectB.name = "B" rectB:setFillColor( 1, 0, 0 ) local function tapControl( event ) local btn = event.target; if(event.phase == "began") then print( "tapControl", event.id, btn.name ) display.getCurrentStage():setFocus(btn, event.id); btn.hasFocus = true; btn.xScaleBefor, btn.yScaleBefor = btn.xScale, btn.yScale; btn:scale( 0.9, 0.9 ); elseif(btn.hasFocus) then if ( event.phase == "ended" or event.phase == "cancelled" ) then btn.xScale = btn.xScaleBefor; btn.yScale = btn.yScaleBefor; display.getCurrentStage():setFocus(btn, nil); btn.hasFocus = false; end end return true; end local function tapNew( event ) local btn = event.target; if(event.phase == "began") then print( "tapNew", event.id, btn.name ) display.getCurrentStage():setFocus(btn, event.id); btn.hasFocus = true; btn.xScaleBefor, btn.yScaleBefor = btn.xScale, btn.yScale; btn:scale( 0.9, 0.9 ); elseif(btn.hasFocus) then if ( event.phase == "ended" or event.phase == "cancelled" ) then btn.xScale = btn.xScaleBefor; btn.yScale = btn.yScaleBefor; display.getCurrentStage():setFocus(btn, nil); btn.hasFocus = false; end end return true; end rectA:addEventListener( "touch", tapControl ) rectB:addEventListener( "touch", tapNew )
I saw a status report that an engineer is working on fixing a multitouch bug in HTML5. I don’t know if its this specific issue or not. Watch the next couple of daily builds to see if this gets fixed.
i updated build 3318 but multitouch dont work in android browser and in ios browser touch and tap event dont work. I try reinstall build 3317 ios touch and tap event work normal.
Is this related to an HTML5 issue that I seem to be encountering (in version 3319): event.id is always nil in my touch events regardless of whether multitouch is on or off.
I saw a status report that an engineer is working on fixing a multitouch bug in HTML5. I don’t know if its this specific issue or not. Watch the next couple of daily builds to see if this gets fixed.
i updated build 3318 but multitouch dont work in android browser and in ios browser touch and tap event dont work. I try reinstall build 3317 ios touch and tap event work normal.