You are here

undocumented importFileInto lingo

With Shockwave 10.1 released a couple of weeks ago, there's a whole lot of new and updated stuff. Not all of this stuff is well documented though (even if it is listed in the releasenotes).

For example, would you know what exactly changed when reading this?

174047 using importFileInto to import a 32 bit image, it is remapped to the stage depth, removing alpha-information on 16 bit desktops

Before 10.1, importFileInto would always remap the imported image to the current screen depth. This often makes sense, as it is cheaper to do the conversion once than to have to do it each time the image member is used. However, it also meant that the alpha-channel in 32 bit images would get thrown away if the system was running in 16 bit or lower color setting; no nice 8 bit transparencies in PNGs or TIFs, or even 1 bit transparencies in GIFs.

According to the releasenotes, this changed in 10.1... Some may already know that importFileInto can take an optional parameter #trimWhiteSpace, but since 10.1 there's another neat parameter: #mapImageToStage. Setting this parameter to false will stop the remapping behavior, and get you the original image!

The full syntax would be something like:

member(someMember).importFileInto(fileToImport, [#trimWhitespace: false, #mapImageToStage: false] )

The propertylist is still optional, and #mapImageToStage defaults to true, meaning that current shockwave content won't behave different from what we are used to. But if you want to, you can now import images with transparencies intact.

Topics: