Add array of children to display list.


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private var _container:Boolean;
  2. private var _objarray:Array = new Array();
  3. private var _cont:Sprite;
  4. /////////////////////////////
  5. //Add multiple children.
  6. //////////////////////////////
  7. private function addChildren (_objarray, _container = false, _cont = null) {
  8. for (var j:int = 0; j < _objarray.length; j++) {
  9. if(_container) {
  10. _cont.addChild(_objarray[j]);
  11. } else {
  12. addChild (_objarray[j]);
  13. }
  14. }
  15. }
  16. //////////////////////////////

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.