Posted By

alvincrespo on 02/23/10


Tagged

actionscript generator label as3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

tspitzr


AS3 - Dynamic Label Generator


 / Published in: ActionScript 3
 

This is a dynamic label generator for a project I'm working on. (Source files coming soon)

  1. package{
  2.  
  3. import flash.display.MovieClip;
  4.  
  5. public class InputManager extends MovieClip{
  6.  
  7. public function InputManager():void{
  8.  
  9. var fields:Object = new Object();
  10. fields.uploadinput = 'upload song';
  11. fields.albuminput = 'album';
  12. fields.taginput = 'tags';
  13. fields.artistinput = 'artist';
  14. fields.genreinput = 'genre';
  15.  
  16. for (var aField:String in fields){
  17. setLabels(aField, fields[aField]);
  18. }
  19. }
  20.  
  21. private function setLabels(aParent:String, labelName:String):void{
  22. MovieClip(getChildByName(aParent)).labelfield.text = labelName;
  23. }
  24. }
  25. }

Report this snippet  

You need to login to post a comment.