Title: Right click and popup window

Thanks Jester. I understand the getEditingData() method better. I got that to work.

I have a question regarding bringing up a popup window when you right click, and click on a particular menu option. I got the right click and creating custom menu by pushing new items working but when I click on a menu option, I want it to popup a window whereas the app just hangs.

Here is the code:
<mx:Script>      
import mx.controls.Alert;
import mx.containers.TitleWindow;
import mx.managers.PopUpManager;
     
public var mnuContext:ContextMenu = null;      
 
public function handleContext( obj, item ):Void
{               
  if( item.caption == "Yahoo" )
  {               
        obj.txtReport.text = obj.txtReport.text + "\nYahoo fired.";  
        trace("i am here");
        //var popupWindow:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, FormulaPopup, true));                       

        //popupWindow.centerPopUp(this);       
        showFormWin();      -- This method is not called at all, I don't see any trace
  }
  else if( item.caption == "Google" )
  {               
        obj.txtReport.text = obj.txtReport.text + "\nGoogle fired.";         
  }
  else if( item.caption == "CNet News" )
  {               
        obj.txtReport.text = obj.txtReport.text + "\nCNet News fired.";           
  }     
 }       
    
public function setupContext( Void ):Void
{          
  mnuContext = new ContextMenu();                   
  mnuContext.hideBuiltInItems();
          
  mnuContext.customItems.push( new ContextMenuItem( "Yahoo", handleContext ) );           
  mnuContext.customItems.push( new ContextMenuItem( "Google", handleContext ) );           
  mnuContext.customItems.push( new ContextMenuItem( "CNet News", handleContext ) );           
        
  this["menu"] = mnuContext;           
  txtReport.text = "Setup.";       
}   

function showFormWin()
{      
        trace("showFormWin fired.");
        var popupWindow:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, FormulaPopup, true));                 

        popupWindow.centerPopUp(this);
}
</mx:Script>   
   
  <mx:TextArea id="txtReport" preferredWidth="175" height="200"/>
</mx:Application>

Any help / ideas on this will be appreciated.

Thanks,
Shweta




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to