0

I'm getting the following error:

VerifyError: Error #1053: Illegal override of addEventListener in    
some.path.to.my.CustomObject

this usually occurs when trying to load an swf/swc when the versions are different, but it's usually with a custom library, not a flash method like addEventListener. My libraries are at the same AIR SDK 3.8 revision, and the top level application has the same version. I was originally using 3.4, but upgraded to 3.8 thinking it might help, but it didn't. I also updated flash player to 11.8, no difference.

The CustomObject it's complaining about has no addEventListener override in it's class or any base class. The base classes are custom also, they are not derived from flash classes. I'm using Flash Builder 4.7.

I'm unable to compile, and have no idea how to resolve this issue, help is appreciated.

4

3 回答 3

1

This may help.When you load the external swf and it may contains some conflict class definition with the parent swf, so you may use different domain for the loaded child swf.

var appDomainA:ApplicationDomain = new ApplicationDomain(); 

var contextA:LoaderContext = new LoaderContext(false, appDomainA); 
var loaderA:Loader = new Loader(); 
loaderA.load(new URLRequest("application2.swf"), contextA);//application2.swf is you external swf

This code and examples could be found in this page application domain

于 2013-09-01T04:05:55.950 回答
1

Change the package name of the Custom Object, and any methods involved. If the same error persists as an error with the original namespace then you have pre-complied code in your libraries that needs to be removed. You would have to recreate the SWCs potentially. (I am still unsure what libraries you are importing, be careful that you aren't accidentally importing Libraries in your publish settings)

One possibility is that you aren't importing the correct objects by accident: for example class this.package.here.BouncingBall but in fact are importing fl.events.animations.BouncingBall instead.

于 2013-09-01T13:11:40.433 回答
0

Found another condition of this - in a base class, sometimes accessing a local variable in the base class through a getter will cause this issue. It seems random, it doesn't always occur.

So instead of

protected var __someVar:int;

public function get someVar():int{
  return __someVar;
}

public function addOneToSomeVar():int{
  return someVar + 1; //using local getter - caused VerifyError #1035
}

do

protected var __someVar:int;

public function get someVar():int{
  return __someVar;
}

public function addOneToSomeVar():int{
  return __someVar + 1; //using local variable
}

This isn't always consistent. I was using other getter functions without issues.

于 2013-12-01T03:34:15.640 回答