1 Reply Latest reply on Jul 13, 2010 2:30 AM by nikos101

    errors randomly in my custom tooltip

    nikos101 Level 2

      Im getting these errors randomly in my custom tooltip:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.managers::ToolTipManagerImpl/http://www.adobe.com/2006/flex/mx/internal::positionTip()[E:\dev\4.x\frameworks\projects\f ramework\src\mx\managers\ToolTipManagerImpl.as:1146]
          at mx.managers::ToolTipManagerImpl/http://www.adobe.com/2006/flex/mx/internal::targetChanged()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\ToolTipManagerImpl.as:852]
          at mx.managers::ToolTipManagerImpl/http://www.adobe.com/2006/flex/mx/internal::checkIfTargetChanged()[E:\dev\4.x\frameworks\p rojects\framework\src\mx\managers\ToolTipManagerImpl.as:744]
          at mx.managers::ToolTipManagerImpl/http://www.adobe.com/2006/flex/mx/internal::toolTipMouseOverHandler()[E:\dev\4.x\framework s\projects\framework\src\mx\managers\ToolTipManagerImpl.as:1565]

       

       

      some of the tooltip:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" implements="mx.core.IToolTip"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" width="400" height="300">
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
          <fx:Script>
              <![CDATA[
                  import mx.core.IToolTip;
                  [Bindable]
                  public var dataItem:Object;
                 
                  //  Implement required methods of the IToolTip interface; these
                  //  methods are not used in this example, though.
                  public var _text:String;
                 
                  public function get text():String {
                      return _text;
                  }
                  public function set text(value:String):void {
                  }
              ]]>
          </fx:Script>
          <mx:Image source="http://intranet/Intranet/EmployeeSearch/images/{dataItem.staffID}.jpg"/>
         
          <mx:Form paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" verticalGap="1">
              <mx:FormItem label="Branch name">
                  <mx:Label text="dataItem.NAME"/></mx:FormItem>
              <mx:FormItem label="Staff name">
                  <mx:Label text="{dataItem.staffName}"/></mx:FormItem>
              <mx:FormItem label="Excessive Wait">
                  <mx:Label text="{dataItem.wasExcessiveWait}"/></mx:FormItem>
              <mx:FormItem label="Eye contact">
                  <mx:Label text="{dataItem.wasEyeContact}"/></mx:FormItem>
          
              <mx:FormItem label="Commission">
                  <mx:Label text="{dataItem.commision}"/></mx:FormItem>
              <mx:FormItem label="Ex-Rate">
                  <mx:Label text="{dataItem.exchangeRate}"/></mx:FormItem>
              <mx:FormItem label="Round up &gt; £5">
                  <mx:Label text="{dataItem.wasRoundUp}"/></mx:FormItem>
              <mx:FormItem label="Trade-up attempted">
                  <mx:Label text="{dataItem.wasTradeUpAttempted}"/></mx:FormItem>
              <mx:FormItem label="Offered other products">
                  <mx:Label text="{dataItem.OfferedOtherProducts}"/></mx:FormItem>
              <mx:FormItem label="Wallet offered">
                  <mx:Label text="{dataItem.wasWallet}"/></mx:FormItem>
              <mx:FormItem label="Thank you">
                  <mx:Label text="{dataItem.wasThankYou}"/></mx:FormItem>
              <mx:FormItem label="Wished Pleasant Trip/Day">
                  <mx:Label text="{dataItem.wasWishedPleasantTrip}"/></mx:FormItem>
              <mx:FormItem label="Branch appearance">
                  <mx:Label text="{dataItem.branchAppearance}"/></mx:FormItem>
              <mx:FormItem label="Customer service">
                  <mx:Label text="{dataItem.customerService}"/></mx:FormItem>
              <mx:FormItem label="userID">
                  <mx:Label text="{dataItem.userID}"/></mx:FormItem>
          </mx:Form>
         
             
      </mx:Panel>

        • 1. Re: errors randomly in my custom tooltip
          nikos101 Level 2

          I got round it by doing this:

           

              <s:Label text="Data" id="Comment" >
                                                          <s:toolTipCreate>
                                                              <![CDATA[
                                                              var toolTip:pa = new pa();
                                                              toolTip.dataItem = data;
                                                              event.toolTip = toolTip;
                                                              ]]>
                                                          </s:toolTipCreate>
                                                      </s:Label>