2 Replies Latest reply on Mar 27, 2011 8:30 AM by AndreasHuck

    get hitData.chartItem.index without mouse

    AndreasHuck

      I'm currently working on a Kinect multitouch applictation in Flash Builder 4 with the as3tuio library where I want to use flex components such as the piechart.

       

      I want to make an exploding chart like in this example http://blog.flexexamples.com/2007/11/06/exploding-wedges-in-a-flex-piechart-control/.

       

      I'm dispatching a ChartItemEvent "pieChart.dispatchEvent(new ChartItemEvent(ItemClickEvent.ITEM_CLICK));" when clicking the piechart and listens if it occours then call the explode function.

       

      Because I'm not using the mouse to click the "evt.target.selectedChartItem.index" will be null and not work.

       

      How do I get the index of "evt.hitData.chartItem.index" when not using the mouse and hitData?

       

       

      /Andreas Huck

        • 1. Re: get hitData.chartItem.index without mouse
          rtalton Level 4

          Without clicking on a pie wedge with a mouse, I don't think you can get anything back from ChartItemEvent, data-wise.

          Can you convert the user's gestures to a chart item click using localToData() and then dispatch the event from that chart item?

          • 2. Re: get hitData.chartItem.index without mouse
            AndreasHuck Level 1

            I'm not sure I follow.

             

            How do you mean "convert the user's gestures to a chart item click using localToData()"?

             

            When I make a "tap" over the pieChart I do this pieChart.dispatchEvent(new ChartItemEvent(ItemClickEvent.ITEM_CLICK));
            Then I use  pieChart.addEventListener(ChartItemEvent.ITEM_CLICK, pieChart_itemClick); to check if it's clicked.

             

            If I trace evt in my private function "pieChart_itemClick(evt:ChartItemEvent):void {" I get this:

            [MouseEvent type="itemClick" bubbles=true cancelable=false eventPhase=2 localX=0 localY=0 stageX=365 stageY=125 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0 commandKey=false controlKey=false clickCount=0]