7 Replies Latest reply on Aug 17, 2009 11:16 AM by this.ScreenName

    Method override error with extends ArrayCollection

    this.ScreenName

      New to Flex.  Reworking a pre-existing example of using an ArrayCollection.  My attempt is to use an externally-defined ActionScript ArrayCollection from a package.  It compiles and runs a valid swf until I try to override a method of ArrayCollection.  I am using  "mxmlc -strict=true -debug=true -show-actionscript-warnings=true -file-specs <file.mxml>" The error is: "Method marked override must override another method."

       

      Any insight is appreciated, here's the code, both mxml and actionscript:

       

      MXML file:

      <?xml version="1.0" encoding="utf-8"?>
      <!-- http://blog.flexexamples.com/2008/05/10/displaying-specific-items-from-an-arraycollection- in-flex/ -->
      <mx:Application
         xmlns:mx="http://www.adobe.com/2006/mxml"
         xmlns:custom="components.*"
         layout="vertical"
         verticalAlign="middle"
         backgroundColor="white" viewSourceURL="srcview/index.html">

       

          <custom:ACProvider id="arrColl">
          </custom:ACProvider>

       

          <mx:ApplicationControlBar dock="true">
              <mx:HSlider id="slider"
                      minimum="0"
                      maximum="{arrColl.length-1}"
                      liveDragging="true"
                      snapInterval="1"
                      tickInterval="1"
                      dataTipPlacement="right" />
          </mx:ApplicationControlBar>

       

          <mx:Label text="{arrColl.getItemAt(slider.value).label}" />

       

      </mx:Application>

       

       

       

      ActionScript file:

      package components
      {
          import mx.collections.ArrayCollection;
          import mx.collections.IList;
         
          public class ACProvider extends ArrayCollection
          {
              public function ACProvider(source:Array=null)
              {
                  if (!source) {
                      this.source = new Array({label:"Student A", score:"85"},
                                                         {label:"Student B", score:"48"},
                                                         {label:"Student C", score:"71"},
                  }
              }

       

              override public function addAllAt(addList:IList, index:int):void
              {
                  return super.addAllAt(addList, index);
              }

       

          }
      }