Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS3 Right Click Button

New Here ,
Dec 14, 2023 Dec 14, 2023

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!

275
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

your os is probably intercepting that.  use right mouse down or up

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

Hi.

 

You need to deploy it as an AIR application for right-click events to work.

image.pngexpand image

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

@JoãoCésar 

 

that's not true.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

Why?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

i tested right down with no problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

It doesn't work for me targeting the Flash Player.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

i tested using animate, not the published file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

I only get the context menu in Animate and the event is not fired.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023
LATEST

i see no problem. i'm using

 

kglad_0-1702565414491.pngexpand image

 

kglad_0-1702565539567.pngexpand image

 

with

 

b.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, decHeight);

function decHeight(event: MouseEvent): void

{

trace("HI");

}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines