On single image items doing this :-
function onMouseDown(self, event)
print ("yep, you touched me")
if self:hitTestPoint(event.x, event.y) then
self.isFocus = true
self.x0 = event.x
self.y0 = event.y
etc etc etc works perfectly. I can get and print out x, y positions and anything I like.
However on an item that is made up using a movieclip
the same function would be triggered but only the print statement would actually do anything. Anything after the print statement doesn't trigger at all.
If you need any more info then please ask.
Currently I am guessing a hitTestPoint doesn't register with movieclips.
Mike
Comments
On the other hand, Movieclip is a collection of multiple frames, each one could be in different sizes. Which can make it complicate to test point.
Do you use movieclip for animation looping, or simply changing images as different states of object?
How about creating invisible sprite above it and testpoint that?
Back to the drawing board.
Mike
http://www.sharksoupstudios.com
Likes: test29
Thus, you have your movieclip animation, and transparent layer above it (invisible sprites still receive click events, don't they?)
Mike
http://www.sharksoupstudios.com
In fact, I am usually the one that says "if it works right, it is right". Never thought I would have that from others.
Mike
Likes: gorkem
http://www.sharksoupstudios.com