Hi,
 
I try to implement a ContextMenu for different charts I generate thanks to a Repeater.
For this I face with 2 problems :
- Generate the right menu
- Get the relative data on which I click into the chart
Thanks for your ideas about this problem.
 
I have also 1 question:
- Is there any method allowing me to open the ContextMenu but not only with a right-click?
 
_______________________________________________________________________________________________________
MXML File
 
<mx:ColumnChart  id="ccChartOneColumn"
               styleName="chart"
               height="160"
               width="100%"
               minWidth="500"
               dataProvider="{ arrCharts[rpCharts.currentIndex].chartData }"
               mouseOverData="{ setDispatchingOptions( event ) }"                    // Method which must create the right Menu, but only with a left-click on the chart before a right_click
               showDataTips="true">
 
___________________________________________________________________________________
METHOD
 
public function setDispatchingOptions( event )
{
    
 // Alert.show("typeof(event.target) : " + typeof(event.target), "______Message__", Alert.OK);
 // typeof(event.target) = movieclip so event.target.menu should run, shouldn't?
 
 var index:Number = event.target.instanceIndex;
 var itemArray:Array = new Array();
 var boolArray:Array = new Array();
  
 switch (index)
 {
    according to the case I define both arraies' values : itemArray and boolArray
 }
 
 var chartMenu = new ContextMenu();
 chartMenu.hideBuiltInItems();
 chartMenu.builtInItems.forward_back = false; // and so on
 chartMenu.builtInItems.loop = false;
 chartMenu.builtInItems.print = false;
 chartMenu.builtInItems.quality = false;
 chartMenu.builtInItems.rewind = false;
 chartMenu.builtInItems.save = false;
 chartMenu.builtInItems.zoom = false;
 
 Alert.show("chartMenu.builtInItems.loop : " + chartMenu.builtInItems.loop, "______Message__", Alert.OK);
  
 for (var i:Number=0; i<itemArray.length; i++)
 {
  var item:ContextMenuItem = new ContextMenuItem(itemArray[i], openTheDetailsPanel, boolArray[i]);
  chartMenu.customItems.push(item);
 }
 
 mx.core.Application.application.menu = chartMenu;   // I get a Menu but I logically need to click on the graph to update the items. 
 // event.target.menu = chartMenu;   // It doesn't work
}
Thank you so much for all replies on my mails!
David

**********************************************************************

Coface facilite les echanges entre les entreprises partout dans le monde. Pour cela, elle offre a toutes les entreprises des solutions pour gerer, financer et proteger leur poste client, en leur permettant d'externaliser tout ou partie de la gestion et des risques lies a leurs relations commerciales. Coface est notee AA par Fitch Ratings et Aa3 par Moody's.

Pour en savoir plus, http://www.coface.fr

Coface facilitates business-to-business commerce worldwide. It offers all size companies an array of solutions to manage, finance, and protect their accounts receivables affording them the option of fully or partly outsourcing trade relationship management and attendant risks. Coface is rated AA by Fitch ratings and Aa3 by Moody's.

More about Coface, http://www.coface.com

WARNING :

- Soyez conscient que notre systeme Anti-Spam peut parfois rejeter des messages, soit parce que certains mots et types de fichiers ne sont pas acceptes, ou bien parce que le mail n'a pas ete identifie correctement.

- Be aware that from time to time our Anti-Spam system may reject mails either because some words and types of files are not allowed or because mails are misidentified.

**********************************************************************



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




YAHOO! GROUPS LINKS




Reply via email to