OSMF: Plugin Fun, Round One

I noticed some strange network behavior when loading custom plugins at runtime.  They are requested twice. I had it in my mental backlog to investiagte, but a colleague beat me to it. This loading behavior is by design, apparently:

Dynamic plugins are now loaded twice. On the first load, they’re placed into a separate application domain in order to validate versioning. On the second load (which should pull the plugin from the cache, negating any additional network request), they’re placed into a child of the current application domain, so that class types are merged. Note that this means that a plugin will be initialized twice. For this reason, it’s recommended that any initialization logic be placed in the overridden PluginInfo.initializePlugin method, which is only invoked on the second load.
(from http://forums.adobe.com/thread/798166)

This is the kind of information that should be in big ass bold letters in the developer docs.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s