Main.as for XML Accordion Menu


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

Creating and using my Accordion Menu


Copy this code and paste it in your HTML
  1. package {
  2. import flash.display.MovieClip;
  3. import flash.events.Event;
  4.  
  5. /**
  6. * ...
  7. * @author Jeff Nehlsen
  8. */
  9. public class Main extends MovieClip {
  10. private var loader:XMLLoader;
  11. private var menu:AccordionMenu;
  12.  
  13. public function Main() {
  14. loader = new XMLLoader();
  15. loader.addEventListener(Event.COMPLETE, xmlLoaded);
  16. loader.loadXML("test.xml");
  17. }
  18.  
  19. private function xmlLoaded(e:Event):void {
  20. trace("Creating menu");
  21. menu = new AccordionMenu(loader.xml);
  22. addChild(menu);
  23. }
  24.  
  25. }
  26.  
  27. }

URL: http://www.jeffnehlsen.com/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.