AS3 - Dynamic Label Generator


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

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.