Sabri Aziri
Sabri Aziri

Reputation: 4174

Actionscript click on background/stage

I am trying this but it doesn't work:

_root.onPress = function(){
..
}

I want to click wherever I want, not only in object, is there any way to solve this?

Upvotes: 0

Views: 1038

Answers (1)

m90
m90

Reputation: 11822

The "stage" doesn't trigger onPress-events in AS2 (as it assumes there is nothing to press - like a button or MovieClip or whatever). But you can still capture onMouseDown instead like:

_root.onMouseDown = function(){
    trace('hello');
};

Upvotes: 1

Related Questions