To follow up on yesterday’s post about v2 components not working in Flash 6 player, here’s what I found:
As Chafic Kazoun pointed out, the standard v2 components were exported as 6.0.65.0. This means they will not work in versions of the player prior to that.
You could go in to the component FLA and re-export them, unchecking the 6.0.65.0 box. Then they should work in any version of Flash 6 Player, though you may lose some performance and features.
The components I made were exported as Flash 7, which is why they wouldn’t work in any version of 6, duh! It didn’t occur to me that the publish settings of the FLA would affect the version of the SWC, though it makes sense because a SWC contains a SWF.
Even when I fixed that, I found that my getters and setters were not working. I had even created a clipParameters object, which is meant to make getters and setters compatible with Flash 6 Player. But no joy.
The problem? I had once again assumed too much. I thought that clipParameters was some sort of built in property that automatically made your getter/setters available to the 6 player. Actually, it relies on a function in UIObject called “initFromClipParameters”. This function basically loops through the properties of clipParameters, tags “def_” to the beginning of them and makes them properties of the object. It is called from init().
As I was not inheriting from UIObject or UIComponent, this was never happening. Aha! The solution was to replicate this function in my own base component class and make sure it gets called from my init(). Now my getters and setters work! Yay!