[Papervision3D] Viewport.interactive = true >>> mouse events trigger twice?
Krystman
majewski at krystian.de
Tue May 27 16:14:49 PDT 2008
I have the very same problem. Your solution,
viewport.mouseChildren = false
doesn't work so well because then, my scene objects aren't receiving mouse
release events (funny enough they receive mouse over and mouse out).
I need a stage-based listener because I want to implement a mouse gesture
recognition. Even more strange: it kinda works when I don't render the scene
while the user makes the mouse gesture. But only kinda.. I still get the
occasional double mouse move (with a pressed button)... even after the
mousebutton has been released. What is going on here?
Krystian
http://www.krystian.de
Konrad_konrad wrote:
>
> Thanks for the tip, it'll come in useful for sure.
>
> However, I registered with the stage to process all the clicks in one
> place no matter if they are on the viewport or anywhere else. I'm no
> expert with the event system in as3, but I AFAIK I should get all the
> click events from anything that way and I can recognize them later in the
> listener function.
>
> I've also included 3d interaction in stage mouse events listener.
> I found InteractiveScene3DEvent.OBJECT_PRESS a bit erratic in my app, but
> OBJECT_OVER and OBJECT_OUT work fine, so when I process all clicks from
> stage, I check if mouse is over any 3d object and react accordingly.
>
> And to answer my own question, :-) it turned out that I had to make
> viewport.mouseChildren = false.
>
> I'm happy that my app is working now, but I still don't understand how I
> could I receive two identical events (the same eventPhase and target:
> ViewportBaseLayer) after one click... Does setting viewport.interactive to
> true add something to it that can cause doubling of the events?
>
> regards,
> Konrad
>
>
>
>
>
>
>
>
> dizy wrote:
>>
>> Are you registering with the stage because you want to detect if you
>> DIDN'T hit anything ?
>>
>> If yes.. then on the stage event use the following to filter your actions
>>
>> if(!viewport.hitTestMouse().hasHit){
>> //didn't hit anything
>> }
>>
>> hope that helps
>>
>>
>>
>> Konrad_konrad wrote:
>>>
>>> Hi,
>>>
>>> I've got a PV3D 2.0 project with one scene and viewport.
>>> I have registered a MouseDown and MouseUp event listener to the stage,
>>> but when I set viewport.interactive to true, clicking on the viewport
>>> activates each mouse listener twice. I tried to trace event.target,
>>> currentTarget, eventPhase and everything is exactly the same twice.
>>>
>>> After setting viewport.interactive to false, averything gets back to
>>> normal, but i can't use mouse3d then...
>>> Commenting out the addEventListener line "turns off" both event
>>> notifications.
>>> I don't know what else can I do.
>>>
>>> Do you have any suggestions?
>>>
>>> Best,
>>> Konrad
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Viewport.interactive-%3D-true-%3E%3E%3E--mouse-events-trigger-twice--tp15641528p17502147.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list