BitchWhoCodes » Explain this to me – SWC

Corruption in the library, I’ve been fortunate enough to only experience this maybe two times before. Each time it had pretty much the same affect, you try to drag an item from the library onto the stage and crashola- Flash screams bloody murder at you and goes into the fetal position by crashing. Um thanks.

But this time it was different. And I can’t nail why it happened per say, but I know that something invariably funky happened as the result of an custom swc.

I had extended the v2 List component to support drag and drop with a visual avatar ( you see the element you are dragging from one list to the other rather than just a square icon that suggests you are dragging). Fine. Extending it was no problem. In doing so, however, I had to extend more than just MX.Controls.List. I had to extend the SelectableRow item. At this point I was using a the list component from the standardsComponent.fla to do this – it wasn’t a swc. I wanted to make it a swc because I didn’t want assets cluttering up the library of an already big library. So I created a swc which seemed to go okay.

Intergrating it into the new file was a different story.

1.First off, it overwrote the already existing UIScrollbar component – suddenly where scrollbars where there were none. Not even empty or blank clips in their place. I was never given the ” do you want to replace this item” option at all. That would make sense to me then. It also didn’t remove all the scrollbars. Ones that were attached worked fine.

2. The new swc dnd list works fine. Lists work fine. It just seemed to affect the scrollbars. The other weird thing is that the thumb of the scrollbar no longers seemed to getting sized by the setScrollProperties bit. When i replaced the scrollbars in sections,the thumb no longer resized. There was nothing in the code overwriting this.

3.Finally, I am not sure if it was the swc, but it appeared to have corrupted an unrelated mc in the library, something that was not using a component at all. Removing the questionable swc didn’t change this either. For this particular clip it was subclassing another class. The super simply wasn’t initializing. Calls to to the super weren’t occuring. Removing and replacing the clips in this series fixed the issue. I thought perhaps I had missed the obivious linkage bit, but that definitely wasn’t the case because the subclass was init’ing but the super definitely not – not for this item.

Is there any explanation for the above?
Any insight into swc’s would be appreciated too. Do they reference the as file they are bound to at run time? Are they self contained? Why would extending the list component overwrite the UIScrollbar?

Interestingly enough, replacing the swc’s from the components panel and deleting the config file seemed to resolve the weird thumb sizing bit.

Is this just a case of unlucky corruption of some sort?

Leave a Reply

Your email address will not be published. Required fields are marked *