Copy link to clipboard
Copied
Hi Everyone-
I am up against a wall on this conversion project from AS3 to CreateJS.
Scenario:
When the user Right MouseDowns on an object it displays an "Action Window". However, when the use Left MouseDowns on the object and then Right MouseDowns it displays a different "Information Window". It works great. ONCE!
When the user colpetes both the Right Event and the Left/Right event ONLY the Left/Right Event will fire. The Right only event will not.
I have tried it different ways to make it work and the other attempt that somewhat worked was similar to the above however, the Information Window would appear with the Action Window.
Any help is appreciated as I have been hobbling code to convert a massive amount of flash this year and I am down to two pieces that are tripping me up. For the record, I am NOT a coder (so my approach may be janky) but it fell into my lap at work. Below is the code:
What is the best way to reset the event listeners?
this.scene3501.addEventListener("mousedown",downF.bind(this));
function downF(e){
if(this.previousClick==1 && e.nativeEvent.which==3){
leftRightF.bind(this)();
} else if(e.nativeEvent.which==1){
leftF.bind(this)();
}
this.previousClick = e.nativeEvent.which;
}
Copy link to clipboard
Copied
this.scene3501.addEventListener("mousedown",downF.bind(this));
function downF(e){
if(this.previousClick==1 && e.nativeEvent.which==3){
leftRightF.bind(this)();
} else if(e.nativeEvent.which==1){
leftF.bind(this)();
}
this.previousClick = e.nativeEvent.which;
}
Copy link to clipboard
Copied
Hi kglad,
Thank you. I will try and get back to you.
Cap
Copy link to clipboard
Copied
sounds good.
Copy link to clipboard
Copied
It works. I made a few tweaks to get the event to fire when the User only clicks the Right button. It does have a quirk when the user accidently clicks the right button twice, it fires both menues.
At this juncter I am going with it as I looked at the original SWF and it does a similar thing.
Thank you again for your help.
Cap
Copy link to clipboard
Copied
you can handle all right/left click combos in downF, if wanted.
Copy link to clipboard
Copied
"When the user Right MouseDowns on an object it displays an "Action Window". However, when the use Left MouseDowns on the object and then Right MouseDowns it displays a different "Information Window"."
Hold up. You're saying that if the user right-clicks on a symbol they get a context menu, but if they right-click, having previously left-clicked, they get something else? In all my decades of software use, I don't think I've ever encountered any UI convention like that. It sounds like something out of a fighting game. It sounds, from both a usability and discoverability perspective, pretty terrible.
Why don't you just combine the two into a single dialog? Or show the info dialog on right click, with a button at the bottom to display the actions? Or vice versa? This would keep the number of required mouse clicks the same, but be enormously simpler for users to understand.
Copy link to clipboard
Copied
HI ClayUUID-
If I could do it any other way than I stated I would have. And I agree with your assessment, however, again this is how the file was build in AS3 for which I have been tasked with converting to CreateJS.
Now I don't feel as bad as I did not getting this to work. Either way, I have to get it to work as the original (not even going to get into InputText in an Animated MC).
Thank you,
Cap
Find more inspiration, events, and resources on the new Adobe Community
Explore Now