Skip to main content
Inspiring
February 21, 2018
Question

Automatically declare stage instances not happenning on Ipad with loaded swfs

  • February 21, 2018
  • 1 reply
  • 344 views

Hi All,

Im having a problem where i have a testing an IPK on an iPad.  The IPK is an AS3 AIR26 package that includes several swfs.

What has happens to some of the swfs is that movie clips are losing their instances even though  “automatically declare stage instances" is selected.

This only happen on the ipad, and only some of the swfs loaded.

A simple example of whats happenning (only to some of the swfs)

I create a simple MC.
Drop it in and give it a instance name "randomMC.

Add a trace(randomMC)

Publish the swf as as3 / FP 20

Publish shell as IPK / Air 26

And on the ipad the debugger return null.

I having to go through the loaded swf and declare the following to
randomMC = this['randomMC']

trace(randomMC)

What am i doing wrong? Is it a publish setting?

This topic has been closed for replies.

1 reply

Inspiring
February 21, 2018

I don't load external swf anymore for that type of app but I use to do it and yes it has been my experience that objects on the stage with instance names are often impossible to reference.

Because I never found a reliable way to do it I changed to exporting those objects to actionscript (from the library) and referencing their class name instead and create instances of them in my main app. Using a JSFL script the process was painless. I later made those swf extends a class to automatically distribute those assets using a static method, I would make those swf use a document class with a static method to return those assets using their class name.

Note that this whole process of library/class is easier now since you can call natively getQualifiedClassNames() on the loaderinfo