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

Animate CC as3.0 [Mouse range] Problem

Explorer ,
Oct 30, 2022 Oct 30, 2022

Animate CC as3.0 [Mouse range] Problem

//=============================

 

stage => (0,0,720,480)
wantRectangle => (200,420,380,480)

 

var r:Number = 100;
MovieClib.bar.addEventListener(MouseEvent.MOUSE_UP, prg);
MovieClib.bar.startDrag(true, new Rectangle(0, 0, r, 0));
stage.addEventListener(MouseEvent.MOUSE_UP, prg);

 

When I run this, other buttons outside the "wantRectangle" range cause problems
(Example, the problem of intermittent interruption when playing music, etc.)

 

Query how to execute "prg" on stage scope within wantRectangle scope


thank you

214
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 ,
Oct 30, 2022 Oct 30, 2022

when you run what?  (what you showed is pseudo-code with typos, isn't it?)

 

and what problems with "other buttons" do you have?

 

and is wantRectangle as movieclip with its parent the stage and prg is encoded on the main timeline? 

 

if yes to everything, then

 

parent.prg() or this.parent.prg() would execute prg from the wantRectangle timeline.

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
Explorer ,
Oct 30, 2022 Oct 30, 2022

Thank you
When "MOUSE_UP" is performed only within the "wantRectangle" range
I want to know how the "prg" function is executed

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 ,
Oct 30, 2022 Oct 30, 2022
LATEST

i'm not sure what exactly you want but the event properties will tell you which object is dispatching the event and the mouse's location.

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