Posted By

StrawMan on 05/31/09


Tagged

display list array as3 children


Versions (?)

Add array of children to display list.


 / Published in: ActionScript 3
 

  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  

You need to login to post a comment.