0
New Here
,
/t5/animate-discussions/array-of-class-names/td-p/4762210
Jan 31, 2013
Jan 31, 2013
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
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);
LEGEND
,
LATEST
/t5/animate-discussions/array-of-class-names/m-p/4762211#M129379
Jan 31, 2013
Jan 31, 2013
Copy link to clipboard
Copied
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);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

