how to export swf with imports that are not valid...yet

Hi,
Im a little rusty but heres my question:

I am exporting a swf with Flash IDE, but using Flash Builder to package the swf as an IPA with native extension.

I need imports and a line of code in the document class of the swf for later use in the IPA.

I cannot export the swf with imports that are not valid yet.

How can I force it to publish with that line of code, or inject the code in to the swf after?

thanks

I do still want to know some workarounds for “tricking” the compiler i suppose.

I ended up adding the .ane native extension to flash pro to silence the compiler complaints,exporting my swf.
Then created the adHoc IPA with flash builder. It worked well.

the .ane was test fairy, and let me say, these first few seconds of live recording app play back have been amazing.

http://krilnon.com/best-discussions#post2524593

You should read that just for fun.

About your question, though, could you maybe give more details or something? Like, you can:

  • Load SWFs dynamically / at runtime (but not on iOS, IIRC, since it uses AoT compilation due to App Store restrictions)
  • Runtime shared libraries

Just throwing this out there - includes how workflows like this work:

^ Note that the Share Library Code is not compiled into the Project SWF, so it has imports that aren’t valid if it were run on its own, though the compiler was given those definitions (or at least stub definitions) that allow it to recognize how they’re used in that SWF.

http://www.senocular.com/flash/tutorials/contentdomains/

(Its a bit lengthy, and the image is from like the near end of the second page, but I think its less technical and hopefully easier to take in than krilnon’s first link :wink: though also very similar to the second)

thanks to you both. I will have to read through that material more in depth later on, looks like anes are the same situation as a shared library

The picture you posted senocular does explain the situation.

When I exported the swf with the ane in flash pro, I did notice mygame.swf, and myANE.swf…although myANE.swf never gets put in a visible folder.

mygame.swf would probably crash if run on its own.

To reexplain my question. Both flash pro and flash develop will package the swf and ane in to an IPA, as you know.

the game is old an in flash pro, I prefer to take that swf, drag it in to flash develop and package the IPA with .ane.

However I needed new API calls for the ane in the original swf. That crashed the compiler if the ane, (or shared library same thing I guess?) wasn’t also present in flash pro

So basically I packaged the app w the ane and new API calls in flash pro just to silence the compiler, then took the swf in to flash develop and repackaged again, to get pretty much the the exact same IPA output.

Its just that my version of flash develop is more up to date as far as IPA icon size support and stuff, so I prefered to export the final IPA there

There are a bunch of practical workflow things that I never really had a chance to understand in Flash, so unfortunately my knowledge only covers the technical language stuff.

It makes sense that you want to do that, but it also sort of makes sense why it breaks. SWFs are generally meant to be “finished products”. Not that they can’t be intermediate assets, but both Flash Pro and Flash Develop aren’t geared support that use case as well as the more typical ones.