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

Array of Class Names

New Here ,
Jan 31, 2013 Jan 31, 2013

I've got several movieclips in my FLA library with classnames applied.  In my AS package file, I've got an array of those classnames.  What I'd like to do is display the movieclips on stage as follows:

  • Upon SWF load, Array[0] displays
  • When NEXT button is clicked, add 1 to array, then display
  • When PREV button is clicked, subtract 1 from array, then display

Total n00b question, I'm sure.  I understand the basics, but calling the classnames has me confused.  Any help would be appreciated!

TOPICS
ActionScript
310
Translate
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

correct answers 1 Correct answer

LEGEND , Jan 31, 2013 Jan 31, 2013

To add class instances dynamically you can use the following, where className is a String representation of the class name...

var ClassRef:Class = Class(getDefinitionByName("className"));

var classInstance:* = new ClassRef();

addChild(classInstance);

Translate
LEGEND ,
Jan 31, 2013 Jan 31, 2013
LATEST

To add class instances dynamically you can use the following, where className is a String representation of the class name...

var ClassRef:Class = Class(getDefinitionByName("className"));

var classInstance:* = new ClassRef();

addChild(classInstance);

Translate
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