Skip to main content
Inspiring
October 30, 2022
Question

Animate CC as3.0 [Mouse range] Problem

  • October 30, 2022
  • 1 reply
  • 188 views

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

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    October 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.

    Inspiring
    October 30, 2022

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

    kglad
    Community Expert
    Community Expert
    October 30, 2022

    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.