code_junkie

When I extend an MX class in Flex, how do I reference it in the MXML?

Nov 13th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <mx:Tree>
  2. <!-- ... -->
  3. </mx:Tree>
  4.  
  5. class ChristmasTree extends mx.controls.Tree {
  6. // ...
  7. }
  8.  
  9. package myComponents
  10. {
  11. // as/myComponents/TextAreaFontControl.as
  12. import mx.controls.TextArea;
  13.  
  14. public class TextAreaFontControl extends TextArea
  15. {
  16.  
  17. // add / change behaviour, properties etc. ...
  18.  
  19. }
  20.  
  21. }
  22.  
  23. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  24. xmlns:MyComp="myComponents.*">
  25.  
  26. <!-- ... -->
  27.  
  28. <MyComp:TextAreaFontControl />
  29.  
  30. <?xml version="1.0" encoding="utf-8"?>
  31. <mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml">
  32. <!-- her comes the Script block and other suff -->
  33. </mx:TextArea>
Add Comment
Please, Sign In to add comment