Advertisement
Guest User

Before Robotlegs

a guest
Jan 3rd, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
  2.             {
  3.                 // clears the filter box in case its filtering the view
  4.                 filterTxt.text = "";
  5.  
  6.                 scontroller = ApplicationStore.services["syscontroller"];
  7.                 var tracker:AnalyticsTracker = ApplicationStore.services["tracker"];
  8.                
  9.                 if (! scontroller){
  10.                     scontroller = new SystemsController();
  11.                     ApplicationStore.services["syscontroller"] = scontroller;
  12.                    
  13.                 }
  14.                 this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
  15.                
  16.                 scontroller.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange);
  17.  
  18.                 if (scontroller.hosts.length < 1){
  19.  
  20.                     scontroller.refreshhosts();
  21.                     tracker.trackPageview("/Systems");
  22.  
  23.                 }
  24.                 else if (scontroller.hosts.length > 0){
  25.                     onCollectionChange(null);
  26.                     trace("hosts array already exists");
  27.                 }
  28.                 //tracker.trackEvent("Usage Stats", "Systems", "Number of hosts", scontroller.hosts.length);
  29.                 //this is needed to make sure all the hosts appear after setting the search field blank
  30.                 scontroller.hosts.refresh();
  31.                
  32.                 // lets go ahead and get this information and cache it
  33.                 var classcontroller:ClassController;
  34.  
  35.                 if (ApplicationStore.services["classcontroller"]){
  36.                     classcontroller = ApplicationStore.services["classcontroller"];
  37.                 }
  38.                 else{
  39.                     classcontroller = new ClassController();
  40.                     ApplicationStore.services["classcontroller"] = classcontroller;
  41.                 }
  42.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement