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

how to check if a function exists in Flex?

New Here ,
Aug 18, 2012 Aug 18, 2012

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

TOPICS
ActionScript

Views

1.5K

Translate

Translate

Report

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
LEGEND ,
Aug 19, 2012 Aug 19, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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