I’m using object:setDrag( ) with a movie clip to perform a drag operation on an object along one axis, but not the other. However, the built in functions call immediately instead of “onDrag” or “onPress” ect. I’m not certain what it is i’m doing wrong. I’m trying to track the drag position, or at least, the resulting position using the onDrag -> dragFunction call.
Code as follows:
[lua]function splashScreen()
local object = movieclip.newAnim({“CON Splash v3-01.png”},960,640)
object.x = display.viewableContentWidth/2
object.y = display.viewableContentHeight/2
local function dragFunction()
object.alpha = 0.5
end
object:setDrag{ drag=true, limitX=false, limitY=true, onDrag=dragFunction()}
–[[
if ((object.x >= display.viewableContentWidth *.75 or object.x <= display.viewableContentWidth *.25)) then
==print(“transition”)
end
print(object.x)
–]]
end
[lua] [import]uid: 13050 topic_id: 11929 reply_id: 311929[/import]