Skip to main content
9999pippoflash
Inspiring
September 22, 2013
Question

AIR for IOS, ApplicationDomain problem: Error #2007: Parameter Possible symbol clash in multiple swf

  • September 22, 2013
  • 1 reply
  • 1899 views

I am exporting a game for IOS in Flash CS6.

I have isolated classes, except a framework for static utilities that do not clash, but I still get this message when exporting for IOS.

AIR for desktop, even with ApplicationDomain.currentDomain works and does not give any error. Same on android.

When I export the same exact project for IOS, it triggers that error randomly in different parts.

All related with a call to a method on superclass, the instantiation of an internal class, or of a Vector typed to a custom internal class.

TypeError: Error #2007: Parameter Possible symbol clash in multiple swfs, abcenv must be non-null.

The line that triggers the error:

return new RouletteChoserItemDev(num, data);

Any help is appreciated.

UPDATE

I have changed the code into:

var item:RouletteChoserItemDev;

var MyClass:Class = RouletteChoserItemDev;

item = new MyClass(num, data);

Now I get this funny error:

Error #1034: Type Coercion failed: cannot convert device.plugins.rouletteLobby::RouletteChoserItemDev@6284bc9 to .

Yes, cannot convert to ".", a dot!

This topic has been closed for replies.

1 reply

9999pippoflash
Inspiring
September 22, 2013

*FOUND A SOLUTION*

The way ApplicationDomain.sameDomain works on Android and Desktop, and on IOS, IS DIFFERENT!!!

I probably have to file this under AIR bugs.

Anyway:

- In loaded SWFs, classes which are not already stored in parent SWF CANNOT be instantiated.

I.E.

var c:MyClass = new MyClass(); // Will not work

var c = new MyClass(); // Will not work

var c:MyClass = getDefinitionByName("fullpackage.MyClass"); // Will not work

var c = getDefinitionByName("fullpackage.MyClass"); // WORKS!!!!!

var c:DisplayItem = getDefinitionByName("fullpackage.MyClass"); // WORKS!!!!!

So, it seems that classes stored in local loaded SWF will not be accessible directly. Even though tracing it trace(MyClass) works well, the class cannot be used in code in any place. Variables cannot be typed, and class can only be instantiated with getDefinitionByName();

All this, is true ONLY on IOS, same exact project and settings, will not trigger any error in AIR for Desktop or for Android.

But since obviously we use the same codebase for all devices, this IOS *feature* has to guide the way we code, even though we break a few important OOP best practices.

Hope I spared someone else the 3 days including an entire weekend I had to invest to find this out.

Participant
September 24, 2013

Hey,

can you help me a little with this

I have mobile lobby that loads a swf inside and it saves the class of a swf to a var. later it tries to make NEW and it doesnt work.

I will try your solution now

Participant
September 24, 2013

Ok, so I dont quite get your solution

        var loadedSWF:Sprite = e.target.content[0].rawContent as Sprite;

        var qualifiedClassName:String = getQualifiedClassName(sprite);

        klass = (Class(getDefinitionByName(qualifiedClassName)));

          and this works. I get the class.

later when I try to make

     game = new klass(a,b,c) it doesnt work.

how should i proceed?