Copy link to clipboard
Copied
Hi,
I am wondering if there is any method to check if a function exists in Actionscript/Flex.
The same way as we do isdefined in javascript.
Thank you
Mayank
Copy link to clipboard
Copied
On instances - use Object hasOwnProperty method - all objects in AS3 inherit from Object:
var mc:MovieClip = new MovieClip();
var s:Sprite = new Sprite();
trace(mc.hasOwnProperty("play")); // true
trace(s.hasOwnProperty("play")); // false