SlideShare a Scribd company logo
Specifying Tree control icons   Hemakumar.S Open Source Developer
Specifying Tree control icons   The Tree control provides four techniques for specifying node icons: The folderOpenIcon, folderClosedIcon, and defaultLeafIcon properties  Data provider node icon fields  The set Item Icon() method  The iconFunction property  Using icon properties: You can use the folderOpenIcon, folderClosedIcon, and default Leaf Icon properties to control the Tree control icons.
Using icon fields Example: <?xml version=&quot;1.0&quot;?>  <!-- dpcontrols/TreeIconField.mxml -->  <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;>  <mx:Script>  <![CDATA[  [Bindable]  [Embed(source=&quot;assets/images.jpg&quot;)]  public var iconSymbol1:Class;  [Bindable]  [Embed(source=&quot;assets/images1.jpg&quot;)]  public var iconSymbol2:Class;  ]]>  </mx:Script>
Cont…. <mx:Tree iconField=&quot;@icon&quot; labelField=&quot;@label&quot; showRoot=&quot;false&quot; width=&quot;160&quot;>  <mx:XMLList>  <node label=&quot;New&quot;>  <node label=&quot;HTML Document&quot; icon=&quot;iconSymbol2&quot;/>  <node label=&quot;Text Document&quot; icon=&quot;iconSymbol2&quot;/>  </node> <node label=&quot;Close&quot; icon=&quot;iconSymbol1&quot;/>  </mx:XMLList>  </mx:Tree>  </mx:Application>
Screen Shot
Using the setItemIcon() method Example: <?xml version=&quot;1.0&quot;?>  <!-- dpcontrols/TreeOpenNode.mxml -->  <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;> <mx:Script>  <![CDATA[  import flash.events.*;  import mx.events.*;  import mx.controls.*;  private function initTree():void  {  XMLTree1.expandItem(MailBox.getItemAt(0), true);  XMLTree1.selectedIndex = 2;
Cont…. }  ]]>  </mx:Script> <mx:Tree id=&quot;XMLTree1&quot; width=&quot;150&quot; height=&quot;170&quot; labelField=&quot;@label&quot; creationComplete=&quot;initTree();&quot;>  <mx:XMLListCollection id=&quot;MailBox&quot;>  <mx:XMLList>  <node label=&quot;Mail&quot; data=&quot;100&quot;>  <node label=&quot;Inbox&quot; data=&quot;70&quot;/>  <node label=&quot;Personal Folder&quot; data=&quot;10&quot;>  <node label=&quot;Business&quot; data=&quot;2&quot;/>  <node label=&quot;Demo&quot; data=&quot;3&quot;/>  <node label=&quot;Saved Mail&quot; data=&quot;5&quot; />  </node>
Cont…. <node label=&quot;Sent&quot; data=&quot;15&quot;/>  <node label=&quot;Trash&quot; data=&quot;5&quot;/> </node>   </mx:XMLList>  </mx:XMLListCollection>  </mx:Tree>  </mx:Application>
Screen Shot
Thank you....

More Related Content

PPT
Expanding a tree node
PPTX
Wow Ppt With Numbers
DOC
DOCX
Tabulasi gerak harmonik sederhana
PPT
Pop up menubutton control
PPT
Tree control
DOCX
Tabulasi gerak harmonik sederhana2
PPT
Drag and drop
Expanding a tree node
Wow Ppt With Numbers
Tabulasi gerak harmonik sederhana
Pop up menubutton control
Tree control
Tabulasi gerak harmonik sederhana2
Drag and drop

Viewers also liked (10)

PPT
Image control
PPT
Tree user interaction
PPT
Horizontal list
PPTX
Wow Mobile Presentationsuccessstry
PPT
Linux commands
PPT
Health heart1 hemakumar
PPT
Linux commands
PPT
Navigation keys in tree controls
PPT
Combobox with effect
PPS
Northrop Grumman\'s X 47 B1
Image control
Tree user interaction
Horizontal list
Wow Mobile Presentationsuccessstry
Linux commands
Health heart1 hemakumar
Linux commands
Navigation keys in tree controls
Combobox with effect
Northrop Grumman\'s X 47 B1
Ad

More from Hemakumar.S (6)

PDF
Reading123
DOC
PPT
Pop upbutton control
PPT
Tile list
PPT
List control
PPT
Handling tree control events
Reading123
Pop upbutton control
Tile list
List control
Handling tree control events
Ad

Specifying tree control icons

  • 1. Specifying Tree control icons Hemakumar.S Open Source Developer
  • 2. Specifying Tree control icons The Tree control provides four techniques for specifying node icons: The folderOpenIcon, folderClosedIcon, and defaultLeafIcon properties Data provider node icon fields The set Item Icon() method The iconFunction property Using icon properties: You can use the folderOpenIcon, folderClosedIcon, and default Leaf Icon properties to control the Tree control icons.
  • 3. Using icon fields Example: <?xml version=&quot;1.0&quot;?> <!-- dpcontrols/TreeIconField.mxml --> <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;> <mx:Script> <![CDATA[ [Bindable] [Embed(source=&quot;assets/images.jpg&quot;)] public var iconSymbol1:Class; [Bindable] [Embed(source=&quot;assets/images1.jpg&quot;)] public var iconSymbol2:Class; ]]> </mx:Script>
  • 4. Cont…. <mx:Tree iconField=&quot;@icon&quot; labelField=&quot;@label&quot; showRoot=&quot;false&quot; width=&quot;160&quot;> <mx:XMLList> <node label=&quot;New&quot;> <node label=&quot;HTML Document&quot; icon=&quot;iconSymbol2&quot;/> <node label=&quot;Text Document&quot; icon=&quot;iconSymbol2&quot;/> </node> <node label=&quot;Close&quot; icon=&quot;iconSymbol1&quot;/> </mx:XMLList> </mx:Tree> </mx:Application>
  • 6. Using the setItemIcon() method Example: <?xml version=&quot;1.0&quot;?> <!-- dpcontrols/TreeOpenNode.mxml --> <mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;> <mx:Script> <![CDATA[ import flash.events.*; import mx.events.*; import mx.controls.*; private function initTree():void { XMLTree1.expandItem(MailBox.getItemAt(0), true); XMLTree1.selectedIndex = 2;
  • 7. Cont…. } ]]> </mx:Script> <mx:Tree id=&quot;XMLTree1&quot; width=&quot;150&quot; height=&quot;170&quot; labelField=&quot;@label&quot; creationComplete=&quot;initTree();&quot;> <mx:XMLListCollection id=&quot;MailBox&quot;> <mx:XMLList> <node label=&quot;Mail&quot; data=&quot;100&quot;> <node label=&quot;Inbox&quot; data=&quot;70&quot;/> <node label=&quot;Personal Folder&quot; data=&quot;10&quot;> <node label=&quot;Business&quot; data=&quot;2&quot;/> <node label=&quot;Demo&quot; data=&quot;3&quot;/> <node label=&quot;Saved Mail&quot; data=&quot;5&quot; /> </node>
  • 8. Cont…. <node label=&quot;Sent&quot; data=&quot;15&quot;/> <node label=&quot;Trash&quot; data=&quot;5&quot;/> </node> </mx:XMLList> </mx:XMLListCollection> </mx:Tree> </mx:Application>