AS3 Right Click Button
Copy link to clipboard
Copied
Hello, I'm new to AS3 and I'm trying to do a right click button but I can't do it.
I'm trying to create a maze but since we need a drag and drop button and resize button, we decided to make it look like a puzzle and they will drag the puzzle all together. However, I don't know how I will make the resize button because we have 8 objects. Is it possible to put in one button only? or no? Sorry I'm really new here.
Here's my attempt
ddmaze8.addEventListener(MouseEvent.CLICK, incHeight);
function incHeight(event: MouseEvent): void
{
ddmaze8.height += 5;
ddmaze8.width += 5;
}
ddmaze8.addEventListener(MouseEvent.RIGHT_CLICK, decHeight);
function decHeight(event: MouseEvent): void
{
ddmaze8.height -= 5;
ddmaze8.width -= 5;
}
Thank you so much!
Copy link to clipboard
Copied
your os is probably intercepting that. use right mouse down or up
Copy link to clipboard
Copied
Hi.
You need to deploy it as an AIR application for right-click events to work.
Regards,
JC
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Why?
Copy link to clipboard
Copied
i tested right down with no problem.
Copy link to clipboard
Copied
It doesn't work for me targeting the Flash Player.
Copy link to clipboard
Copied
Oh, I see what you mean.
I does work when running the published SWF directly.
It doesn't work when testing from within Animate.
Sorry for the confusion.
Copy link to clipboard
Copied
i tested using animate, not the published file.
Copy link to clipboard
Copied
I only get the context menu in Animate and the event is not fired.
Copy link to clipboard
Copied
i see no problem. i'm using
with
b.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, decHeight);
function decHeight(event: MouseEvent): void
{
trace("HI");
}

