3 Replies Latest reply on May 20, 2010 11:00 AM by Flex harUI

    VerifyError: Error #1053: Illegal override of callInContext in _xxx_mx_managers_SystemM

    fimperioli Level 1

      Hi All,

       

      I'm developing a flex sdk 4.0 application on flash builder 4.

      When I run my application inside firefox I'm receiving the message:

       

      VerifyError: Error #1053: Illegal override of callInContext in _xxx_mx_managers_SystemM...

       

      The source code  of file CEPPosteItaliane.mxml is:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                     xmlns:eventlet="com.espertech.esperhq.example.eventlet.*"
                     creationComplete="creationComplete()">
          <mx:HBox width="100%" height="100%">   
              <eventlet:CEPPosteItalianeEventlet id="example" width="100%" height="100%"/>   
          </mx:HBox>
         
          <fx:Script>
              <![CDATA[
                  import com.espertech.esperhq.common.bind.EventEntryDesc;
                 
                  import mx.collections.ArrayList;
                  import mx.events.FlexEvent;

       

                  protected function creationComplete():void
                  {
                      var events:Array = new Array;
                      var item:EventEntryDesc = new EventEntryDesc;
                      events.push(item);
                      item.arrivalTime = 1;
                      item.newRows = new Array;
                      item.newRows.push({value1:"test", value2:"test2"});
                      example.update(events);               
                  }

       

              ]]>
          </fx:Script>
      </s:Application>

       

      the source code of file CEPPosteItalianeEventlet is:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
          creationComplete="creationComplete()"
          implements="com.espertech.esperhq.eventlet.activate.Eventlet">

       

          <mx:VBox width="100%" height="100%" horizontalAlign="center">
              <mx:Label id="lblGridLayout" htmlText="This is a sample plug-in eventlet. " fontSize="14"/>
              <mx:Label id="lblGridLayoutSee" htmlText="&lt;u&gt;Click here for more information&lt;/u&gt;>." fontSize="14" click="onLabelClick();"/>
              <mx:HBox width="100%" paddingRight="10">
                  <mx:Spacer width="100%"/>
                  <mx:Button label="Clear" click="onContainerClear()" />
              </mx:HBox>
              <mx:Grid id="myGrid" width="100%" height="100%"/>       
          </mx:VBox>
         
          <!-- The grid populates with this effect. -->
          <mx:Fade id="fadeFast" duration="500"/>

       

          <mx:Script>
          <![CDATA[
              import com.espertech.esperhq.common.util.*;
              import com.espertech.esperhq.common.bind.*;
              import com.espertech.esperhq.eventlet.activate.*;
              import mx.containers.*;

       

              private var javascriptClickCallback:String;
              private var gridItems:Array = new Array;
              private var currentItem:int;
              private var typeData:Array = new Array;

       

              private var isInitialized:Boolean = false;

       

              public function configureEventlet(context:EventletConfigContext) : String {          

       

                  if (context.configuration == null) {
                      return null;    // Simply stay with the defaults if there is no config
                  }

       

                  // obtain a number of rows and number of columns            
                  var configXML:XML = new XML(context.configuration);
                  javascriptClickCallback = configXML.@clickCallback;    // optional value for JavaScript click callbacks

       

                  return null; // indicate no error in configuration
              }

       

              public function initializeEventlet(context:EventletInitContext) : void {
                  trace("context:" + context);
                  for each (var sourceDesc:ActivationSourceDesc in context.sources) {
                      processManifest(sourceDesc.optionalManifest);                   
                  }               
              }
             
              public function setContainer(context:EventletContainerContext) : void {
                  context.containerDispatcher.addEventListener(EventletContainerEvent.CLEAR, onContainerClear);
              }
                     
              private function creationComplete() : void {
                  isInitialized = true;    // set flag to start processing events
              }

       

              public function manifest(entries:Array) : void {
                  for each (var m:EventManifestDesc in entries) {
                      processManifest(m.manifest);
                  }               
              }
             
              public function update(entries:Array) : void {
                  if (!isInitialized) {
                      return;
                  }

       

                  // Process each event           
                  for each (var eventEntry:EventEntryDesc in entries) {
                      for each (var event:Object in eventEntry.newRows) {
                          displayEvent(eventEntry.typeId, event);
                      }
                  }
              }   
             
              private function onContainerClear(evt:* = null) : void {
                  for each (var item:GridItem in gridItems) {
                      item.removeAllChildren();
                  }
                  currentItem = 0;
              }
             
              private function initializeGrid(numRows:int, numCols:int) : void {
                  for (var rowNum:int = 0; rowNum < numRows; rowNum++) {
                      var row:GridRow = new GridRow();
                      row.percentHeight = 100;
                      row.percentWidth = 100;
                      myGrid.addChild(row);

       

                      for (var colNum:int = 0; colNum < numCols; colNum++) {
                          var item:GridItem = new GridItem();
                          item.percentHeight = 100;
                          item.percentWidth = 100;
                          row.addChild(item);
                          gridItems.push(item);   
                      }                
                  }
              }   
             
              private function displayEvent(typeId:Number, event:Object) : void {
                 
      //            var typeName:String = typeData[typeId];
      //            if (typeName == null) {
      //                typeName = "unknown";
      //            }
      //           
      //            var detail:SampleEventDetail = new SampleEventDetail;
      //            detail.titleText = typeName;
      //            detail.eventData = event;
      //            detail.setStyle("creationCompleteEffect", fadeFast);
      //           
      //            var gridItemCurrent:GridItem = GridItem(gridItems[currentItem]);
      //            gridItemCurrent.removeAllChildren();
      //            gridItemCurrent.addChild(detail);
      //           
      //            // Invoke JavaScript callback for item, if one was provided
      //            if (javascriptClickCallback != null) {
      //                var handleItemClick:Function = function(evt:*):void {
      //                    if (ExternalInterface.available) {
      //                        trace("Calling " + javascriptClickCallback);
      //                        ExternalInterface.call(javascriptClickCallback, detail.eventData);
      //                    }
      //                 };
      //                 detail.addEventListener(MouseEvent.CLICK, handleItemClick);               
      //            }
      //           
      //            currentItem++;
      //            if (currentItem == gridItems.length) {
      //                currentItem = 0;
      //            }           
              }

       

              private function processManifest(m:SourceManifestDesc) : void {
                  if (m == null) {
                      return;
                  }
                  var typeName:String = TargetRenderUtil.getTargetName(m.target);
                  typeData[m.typeId] = typeName;
              }
             
              private function onLabelClick():void {
                  EsperFlexUtil.openHelpBrowserURL("eventletplugin-sample");
              }
          ]]>
          </mx:Script>
         
      </mx:Canvas>

       

      both these two files are in package com.espertech.esperhq.example.eventlet.

       

      Can you help me ?

       

      Thanks in advance,

       

      Fabio Imperioli