I have a scrollview with some images inside. when i touch a image scrollview blocks
the “end” phase of the event… it listens only the “moved” phase… i dont know what to do… please help!
[lua] local scrollView = widget.newScrollView{
top = 0,
width = 320,
height = 459,
scrollWidth = 810,
scrollHeight = 459,
hideBackground=true,
frinction=1.2,
maskFile=“mask2.png”
}
scrollView.content.verticalScrollDisabled = true
scrollView.content.horizontalScrollDisabled= false
scrollView.isHitTestMasked = true;
local hotel = display.newImageRect(“images/menu/hotel.png”, 90, 180)
Group1:insert(hotel);
Group1.isHitTestMasked = true;
Group1:setReferencePoint(display.CenterReferencePoint)
Group1.x=hotel.width/2 +10
Group1.y=350
function Group1:touch(event)
if event.phase == “began” then
print( “begin phase” )
Group1:remove(hotel);
hotel = display.newImageRect(“images/menu/hotel_hover.png”,90,180);
Group1:insert(hotel);
display.getCurrentStage():setFocus(event.target,event.id);
event.target.isFocus = true
elseif event.target.isFocus then
if event.phase == “moved” then
print( “moved phase” )
scrollView:takeFocus(event)
Group1:remove(hotel);
hotel = display.newImageRect(“images/menu/hotel.png”,90,180);
Group1:insert(hotel);
elseif event.phase == “ended” or event.phase == “cancelled” then
print( “ended phase” )
display.getCurrentStage():setFocus(event.target,nil);
event.target.isFocus = false
storyboard.gotoScene(“hotel”);
end
end
return true
end
Group1:addEventListener( “touch”, Group1 )
scrollView:insert(Group1) [import]uid: 185094 topic_id: 33856 reply_id: 333856[/import]