Skip to main content
Inspiring
Oct 30, 2022 12:55 PM UTC
Question

Animate CC as3.0 [Mouse range] Problem

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 is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    kglad
    Community Expert
    Community Expert
    Oct 30, 2022 1:08 PM UTC

    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
    Inspiring
    Oct 30, 2022 1:38 PM UTC

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

    Translate
    kglad
    Community Expert
    Community Expert
    Oct 30, 2022 1:56 PM UTC

    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