Skip to content
Browse files

Added undocumented PlaceObject3 features introduced with SWF11 (bitma…

…pBackgroundColor and visibility)
  • Loading branch information...
1 parent 0d05fad commit 9ff62ce6b739675461df3d6153f65a475a41ec33 @claus claus committed
View
BIN bin/as3swf.swc
Binary file not shown.
View
6 src/com/codeazur/as3swf/tags/TagPlaceObject.as
@@ -18,6 +18,8 @@
public var hasMatrix:Boolean;
public var hasCharacter:Boolean;
public var hasMove:Boolean;
+ public var hasBitmapBackgroundColor:Boolean; // Undocumented feature (SWF11)
+ public var hasVisibility:Boolean; // Undocumented feature (SWF11)
public var hasImage:Boolean;
public var hasClassName:Boolean;
public var hasCacheAsBitmap:Boolean;
@@ -28,7 +30,7 @@
public var depth:uint;
public var matrix:SWFMatrix;
public var colorTransform:SWFColorTransform;
-
+
// Forward declarations for TagPlaceObject2
public var ratio:uint;
public var instanceName:String;
@@ -39,6 +41,8 @@
public var className:String;
public var blendMode:uint;
public var bitmapCache:uint;
+ public var bitmapBackgroundColor:uint; // Undocumented feature (SWF11)
+ public var visibility:uint; // Undocumented feature (SWF11)
protected var _surfaceFilterList:Vector.<IFilter>;
View
27 src/com/codeazur/as3swf/tags/TagPlaceObject3.as
@@ -2,7 +2,8 @@
{
import com.codeazur.as3swf.SWFData;
import com.codeazur.as3swf.data.consts.BlendMode;
- import com.codeazur.utils.StringUtils;
+ import com.codeazur.as3swf.utils.ColorUtils;
+ import com.codeazur.utils.StringUtils;
public class TagPlaceObject3 extends TagPlaceObject2 implements IDisplayListTag
{
@@ -21,13 +22,15 @@
hasCharacter = (flags1 & 0x02) != 0;
hasMove = (flags1 & 0x01) != 0;
var flags2:uint = data.readUI8();
+ hasBitmapBackgroundColor = (flags2 & 0x40) != 0; // Undocumented feature (SWF11)
+ hasVisibility = (flags2 & 0x20) != 0; // Undocumented feature (SWF11)
hasImage = (flags2 & 0x10) != 0;
hasClassName = (flags2 & 0x08) != 0;
hasCacheAsBitmap = (flags2 & 0x04) != 0;
hasBlendMode = (flags2 & 0x02) != 0;
hasFilterList = (flags2 & 0x01) != 0;
depth = data.readUI16();
- if (hasClassName /*|| (hasImage && hasCharacter)*/) {
+ if (hasClassName) {
className = data.readString();
}
if (hasCharacter) {
@@ -63,6 +66,14 @@
if (hasClipActions) {
clipActions = data.readCLIPACTIONS(version);
}
+ // Undocumented feature (SWF11)
+ if (hasBitmapBackgroundColor) {
+ bitmapBackgroundColor = data.readARGB();
+ }
+ // Undocumented feature (SWF11)
+ if (hasVisibility) {
+ visibility = data.readUI8();
+ }
}
override public function publish(data:SWFData, version:uint):void {
@@ -85,7 +96,7 @@
if (hasFilterList) { flags2 |= 0x01; }
body.writeUI8(flags2);
body.writeUI16(depth);
- if (hasClassName /*|| (hasImage && hasCharacter)*/) {
+ if (hasClassName) {
body.writeString(className);
}
if (hasCharacter) {
@@ -122,6 +133,14 @@
if (hasClipActions) {
body.writeCLIPACTIONS(clipActions, version);
}
+ // Undocumented feature (SWF11)
+ if (hasBitmapBackgroundColor) {
+ body.writeARGB(bitmapBackgroundColor);
+ }
+ // Undocumented feature (SWF11)
+ if (hasVisibility) {
+ body.writeUI8(visibility);
+ }
data.writeTagHeader(type, body.length);
data.writeBytes(body);
}
@@ -143,6 +162,8 @@
if (hasClipDepth) { str += ", ClipDepth: " + clipDepth; }
if (hasBlendMode) { str += ", BlendMode: " + BlendMode.toString(blendMode); }
if (hasCacheAsBitmap) { str += ", CacheAsBitmap: " + bitmapCache; }
+ if (hasVisibility) { str += ", Visibility: " + visibility; }
+ if (hasBitmapBackgroundColor) { str += ", BitmapBackgroundColor: " + ColorUtils.argbToString(bitmapBackgroundColor); }
if (hasFilterList) {
str += "\n" + StringUtils.repeat(indent + 2) + "Filters:"
for(var i:uint = 0; i < surfaceFilterList.length; i++) {

0 comments on commit 9ff62ce

Please sign in to comment.
Something went wrong with that request. Please try again.