Skinning the v2 Alert component

I ran into some trouble today that after skinning a v2 Alert component, none of my changes showed up when I implemented it in my main fla. My main fla ofcourse had it’s class export frame set to something different than export in first frame, and I knew that was the problem, but not quite how to fix it.

Normally you set the class export frame to something like 2 or 20 or whatever, disable the ‘export in first frame flag’ on all your content by running a jsfl like:

//
// DisableExport
//
// Sets the linkage identifiers for all items to false

var items = fl.getDocumentDOM().library.items;
var item;
for (var i=0; i item = items[i];
if (item.linkageExportForAS == true) {
fl.trace (item.name);
item.linkageExportInFirstFrame = false;
}
}

and then you make sure that somewhere after your class export frame you have a movieclip on the timeline containing all the stuff for which you disabled the first frame export.

Apparently there is an order to that content as well, and I had never encountered that before. In my case I had overridden the TitleBackground clip, the ActivatorSkin and ButtonSkin, and you have to make sure these are loaded before the components that use them.

So imagine you have a ‘all_my_content’ clip, simply put 2 frames in it, put the overriding clips on the first frame and all the components on the second with a nice stop(); to go along.

Problem solved.

Leave a Reply