├── FD
├── AS-Workers.as3proj
├── bin
│ └── AS-Workers.swf
├── obj
│ ├── AS-WorkersConfig.old
│ └── AS-WorkersConfig.xml
└── src
│ ├── Main.as
│ ├── com
│ ├── codeazur
│ │ ├── as3swf
│ │ │ ├── SWF.as
│ │ │ ├── SWFData.as
│ │ │ ├── SWFTimelineContainer.as
│ │ │ ├── data
│ │ │ │ ├── SWFActionValue.as
│ │ │ │ ├── SWFButtonCondAction.as
│ │ │ │ ├── SWFButtonRecord.as
│ │ │ │ ├── SWFClipActionRecord.as
│ │ │ │ ├── SWFClipActions.as
│ │ │ │ ├── SWFClipEventFlags.as
│ │ │ │ ├── SWFColorTransform.as
│ │ │ │ ├── SWFColorTransformWithAlpha.as
│ │ │ │ ├── SWFFillStyle.as
│ │ │ │ ├── SWFFocalGradient.as
│ │ │ │ ├── SWFFrameLabel.as
│ │ │ │ ├── SWFGlyphEntry.as
│ │ │ │ ├── SWFGradient.as
│ │ │ │ ├── SWFGradientRecord.as
│ │ │ │ ├── SWFKerningRecord.as
│ │ │ │ ├── SWFLineStyle.as
│ │ │ │ ├── SWFLineStyle2.as
│ │ │ │ ├── SWFMatrix.as
│ │ │ │ ├── SWFMorphFillStyle.as
│ │ │ │ ├── SWFMorphFocalGradient.as
│ │ │ │ ├── SWFMorphGradient.as
│ │ │ │ ├── SWFMorphGradientRecord.as
│ │ │ │ ├── SWFMorphLineStyle.as
│ │ │ │ ├── SWFMorphLineStyle2.as
│ │ │ │ ├── SWFRawTag.as
│ │ │ │ ├── SWFRecordHeader.as
│ │ │ │ ├── SWFRectangle.as
│ │ │ │ ├── SWFRegisterParam.as
│ │ │ │ ├── SWFScene.as
│ │ │ │ ├── SWFShape.as
│ │ │ │ ├── SWFShapeRecord.as
│ │ │ │ ├── SWFShapeRecordCurvedEdge.as
│ │ │ │ ├── SWFShapeRecordEnd.as
│ │ │ │ ├── SWFShapeRecordStraightEdge.as
│ │ │ │ ├── SWFShapeRecordStyleChange.as
│ │ │ │ ├── SWFShapeWithStyle.as
│ │ │ │ ├── SWFSoundEnvelope.as
│ │ │ │ ├── SWFSoundInfo.as
│ │ │ │ ├── SWFSymbol.as
│ │ │ │ ├── SWFTextRecord.as
│ │ │ │ ├── SWFZoneData.as
│ │ │ │ ├── SWFZoneRecord.as
│ │ │ │ ├── actions
│ │ │ │ │ ├── Action.as
│ │ │ │ │ ├── ActionExecutionContext.as
│ │ │ │ │ ├── ActionUnknown.as
│ │ │ │ │ ├── IAction.as
│ │ │ │ │ ├── IActionBranch.as
│ │ │ │ │ ├── swf3
│ │ │ │ │ │ ├── ActionGetURL.as
│ │ │ │ │ │ ├── ActionGotoFrame.as
│ │ │ │ │ │ ├── ActionGotoLabel.as
│ │ │ │ │ │ ├── ActionNextFrame.as
│ │ │ │ │ │ ├── ActionPlay.as
│ │ │ │ │ │ ├── ActionPreviousFrame.as
│ │ │ │ │ │ ├── ActionSetTarget.as
│ │ │ │ │ │ ├── ActionStop.as
│ │ │ │ │ │ ├── ActionStopSounds.as
│ │ │ │ │ │ ├── ActionToggleQuality.as
│ │ │ │ │ │ └── ActionWaitForFrame.as
│ │ │ │ │ ├── swf4
│ │ │ │ │ │ ├── ActionAdd.as
│ │ │ │ │ │ ├── ActionAnd.as
│ │ │ │ │ │ ├── ActionAsciiToChar.as
│ │ │ │ │ │ ├── ActionCall.as
│ │ │ │ │ │ ├── ActionCharToAscii.as
│ │ │ │ │ │ ├── ActionCloneSprite.as
│ │ │ │ │ │ ├── ActionDivide.as
│ │ │ │ │ │ ├── ActionEndDrag.as
│ │ │ │ │ │ ├── ActionEquals.as
│ │ │ │ │ │ ├── ActionGetProperty.as
│ │ │ │ │ │ ├── ActionGetTime.as
│ │ │ │ │ │ ├── ActionGetURL2.as
│ │ │ │ │ │ ├── ActionGetVariable.as
│ │ │ │ │ │ ├── ActionGotoFrame2.as
│ │ │ │ │ │ ├── ActionIf.as
│ │ │ │ │ │ ├── ActionJump.as
│ │ │ │ │ │ ├── ActionLess.as
│ │ │ │ │ │ ├── ActionMBAsciiToChar.as
│ │ │ │ │ │ ├── ActionMBCharToAscii.as
│ │ │ │ │ │ ├── ActionMBStringExtract.as
│ │ │ │ │ │ ├── ActionMBStringLength.as
│ │ │ │ │ │ ├── ActionMultiply.as
│ │ │ │ │ │ ├── ActionNot.as
│ │ │ │ │ │ ├── ActionOr.as
│ │ │ │ │ │ ├── ActionPop.as
│ │ │ │ │ │ ├── ActionPush.as
│ │ │ │ │ │ ├── ActionRandomNumber.as
│ │ │ │ │ │ ├── ActionRemoveSprite.as
│ │ │ │ │ │ ├── ActionSetProperty.as
│ │ │ │ │ │ ├── ActionSetTarget2.as
│ │ │ │ │ │ ├── ActionSetVariable.as
│ │ │ │ │ │ ├── ActionStartDrag.as
│ │ │ │ │ │ ├── ActionStringAdd.as
│ │ │ │ │ │ ├── ActionStringEquals.as
│ │ │ │ │ │ ├── ActionStringExtract.as
│ │ │ │ │ │ ├── ActionStringLength.as
│ │ │ │ │ │ ├── ActionStringLess.as
│ │ │ │ │ │ ├── ActionSubtract.as
│ │ │ │ │ │ ├── ActionToInteger.as
│ │ │ │ │ │ ├── ActionTrace.as
│ │ │ │ │ │ └── ActionWaitForFrame2.as
│ │ │ │ │ ├── swf5
│ │ │ │ │ │ ├── ActionAdd2.as
│ │ │ │ │ │ ├── ActionBitAnd.as
│ │ │ │ │ │ ├── ActionBitLShift.as
│ │ │ │ │ │ ├── ActionBitOr.as
│ │ │ │ │ │ ├── ActionBitRShift.as
│ │ │ │ │ │ ├── ActionBitURShift.as
│ │ │ │ │ │ ├── ActionBitXor.as
│ │ │ │ │ │ ├── ActionCallFunction.as
│ │ │ │ │ │ ├── ActionCallMethod.as
│ │ │ │ │ │ ├── ActionConstantPool.as
│ │ │ │ │ │ ├── ActionDecrement.as
│ │ │ │ │ │ ├── ActionDefineFunction.as
│ │ │ │ │ │ ├── ActionDefineLocal.as
│ │ │ │ │ │ ├── ActionDefineLocal2.as
│ │ │ │ │ │ ├── ActionDelete.as
│ │ │ │ │ │ ├── ActionDelete2.as
│ │ │ │ │ │ ├── ActionEnumerate.as
│ │ │ │ │ │ ├── ActionEquals2.as
│ │ │ │ │ │ ├── ActionGetMember.as
│ │ │ │ │ │ ├── ActionIncrement.as
│ │ │ │ │ │ ├── ActionInitArray.as
│ │ │ │ │ │ ├── ActionInitObject.as
│ │ │ │ │ │ ├── ActionLess2.as
│ │ │ │ │ │ ├── ActionModulo.as
│ │ │ │ │ │ ├── ActionNewMethod.as
│ │ │ │ │ │ ├── ActionNewObject.as
│ │ │ │ │ │ ├── ActionPushDuplicate.as
│ │ │ │ │ │ ├── ActionReturn.as
│ │ │ │ │ │ ├── ActionSetMember.as
│ │ │ │ │ │ ├── ActionStackSwap.as
│ │ │ │ │ │ ├── ActionStoreRegister.as
│ │ │ │ │ │ ├── ActionTargetPath.as
│ │ │ │ │ │ ├── ActionToNumber.as
│ │ │ │ │ │ ├── ActionToString.as
│ │ │ │ │ │ ├── ActionTypeOf.as
│ │ │ │ │ │ └── ActionWith.as
│ │ │ │ │ ├── swf6
│ │ │ │ │ │ ├── ActionEnumerate2.as
│ │ │ │ │ │ ├── ActionGreater.as
│ │ │ │ │ │ ├── ActionInstanceOf.as
│ │ │ │ │ │ ├── ActionStrictEquals.as
│ │ │ │ │ │ └── ActionStringGreater.as
│ │ │ │ │ └── swf7
│ │ │ │ │ │ ├── ActionCastOp.as
│ │ │ │ │ │ ├── ActionDefineFunction2.as
│ │ │ │ │ │ ├── ActionExtends.as
│ │ │ │ │ │ ├── ActionImplementsOp.as
│ │ │ │ │ │ ├── ActionThrow.as
│ │ │ │ │ │ └── ActionTry.as
│ │ │ │ ├── consts
│ │ │ │ │ ├── ActionValueType.as
│ │ │ │ │ ├── BitmapFormat.as
│ │ │ │ │ ├── BitmapType.as
│ │ │ │ │ ├── BlendMode.as
│ │ │ │ │ ├── CSMTableHint.as
│ │ │ │ │ ├── GradientInterpolationMode.as
│ │ │ │ │ ├── GradientSpreadMode.as
│ │ │ │ │ ├── LineCapsStyle.as
│ │ │ │ │ ├── LineJointStyle.as
│ │ │ │ │ ├── SoundCompression.as
│ │ │ │ │ ├── SoundRate.as
│ │ │ │ │ ├── SoundSize.as
│ │ │ │ │ ├── SoundType.as
│ │ │ │ │ ├── VideoCodecID.as
│ │ │ │ │ └── VideoDeblockingType.as
│ │ │ │ ├── etc
│ │ │ │ │ ├── CurvedEdge.as
│ │ │ │ │ ├── IEdge.as
│ │ │ │ │ ├── MPEGFrame.as
│ │ │ │ │ └── StraightEdge.as
│ │ │ │ └── filters
│ │ │ │ │ ├── Filter.as
│ │ │ │ │ ├── FilterBevel.as
│ │ │ │ │ ├── FilterBlur.as
│ │ │ │ │ ├── FilterColorMatrix.as
│ │ │ │ │ ├── FilterConvolution.as
│ │ │ │ │ ├── FilterDropShadow.as
│ │ │ │ │ ├── FilterGlow.as
│ │ │ │ │ ├── FilterGradientBevel.as
│ │ │ │ │ ├── FilterGradientGlow.as
│ │ │ │ │ └── IFilter.as
│ │ │ ├── events
│ │ │ │ ├── SWFErrorEvent.as
│ │ │ │ ├── SWFEventDispatcher.as
│ │ │ │ ├── SWFProgressEvent.as
│ │ │ │ └── SWFWarningEvent.as
│ │ │ ├── exporters
│ │ │ │ ├── AS3GraphicsDataShapeExporter.as
│ │ │ │ ├── AS3ShapeExporter.as
│ │ │ │ ├── CoreGraphicsShapeExporter.as
│ │ │ │ ├── FXGShapeExporter.as
│ │ │ │ ├── JSCanvasShapeExporter.as
│ │ │ │ ├── JSONShapeExporter.as
│ │ │ │ ├── SVGShapeExporter.as
│ │ │ │ └── core
│ │ │ │ │ ├── DefaultSVGShapeExporter.as
│ │ │ │ │ ├── DefaultShapeExporter.as
│ │ │ │ │ └── IShapeExporter.as
│ │ │ ├── factories
│ │ │ │ ├── ISWFTagFactory.as
│ │ │ │ ├── SWFActionFactory.as
│ │ │ │ ├── SWFFilterFactory.as
│ │ │ │ └── SWFTagFactory.as
│ │ │ ├── tags
│ │ │ │ ├── IDefinitionTag.as
│ │ │ │ ├── IDisplayListTag.as
│ │ │ │ ├── ITag.as
│ │ │ │ ├── Tag.as
│ │ │ │ ├── TagCSMTextSettings.as
│ │ │ │ ├── TagDebugID.as
│ │ │ │ ├── TagDefineBinaryData.as
│ │ │ │ ├── TagDefineBits.as
│ │ │ │ ├── TagDefineBitsJPEG2.as
│ │ │ │ ├── TagDefineBitsJPEG3.as
│ │ │ │ ├── TagDefineBitsJPEG4.as
│ │ │ │ ├── TagDefineBitsLossless.as
│ │ │ │ ├── TagDefineBitsLossless2.as
│ │ │ │ ├── TagDefineButton.as
│ │ │ │ ├── TagDefineButton2.as
│ │ │ │ ├── TagDefineButtonCxform.as
│ │ │ │ ├── TagDefineButtonSound.as
│ │ │ │ ├── TagDefineEditText.as
│ │ │ │ ├── TagDefineFont.as
│ │ │ │ ├── TagDefineFont2.as
│ │ │ │ ├── TagDefineFont3.as
│ │ │ │ ├── TagDefineFont4.as
│ │ │ │ ├── TagDefineFontAlignZones.as
│ │ │ │ ├── TagDefineFontInfo.as
│ │ │ │ ├── TagDefineFontInfo2.as
│ │ │ │ ├── TagDefineFontName.as
│ │ │ │ ├── TagDefineMorphShape.as
│ │ │ │ ├── TagDefineMorphShape2.as
│ │ │ │ ├── TagDefineScalingGrid.as
│ │ │ │ ├── TagDefineSceneAndFrameLabelData.as
│ │ │ │ ├── TagDefineShape.as
│ │ │ │ ├── TagDefineShape2.as
│ │ │ │ ├── TagDefineShape3.as
│ │ │ │ ├── TagDefineShape4.as
│ │ │ │ ├── TagDefineSound.as
│ │ │ │ ├── TagDefineSprite.as
│ │ │ │ ├── TagDefineText.as
│ │ │ │ ├── TagDefineText2.as
│ │ │ │ ├── TagDefineVideoStream.as
│ │ │ │ ├── TagDoABC.as
│ │ │ │ ├── TagDoABCDeprecated.as
│ │ │ │ ├── TagDoAction.as
│ │ │ │ ├── TagDoInitAction.as
│ │ │ │ ├── TagEnableDebugger.as
│ │ │ │ ├── TagEnableDebugger2.as
│ │ │ │ ├── TagEnableTelemetry.as
│ │ │ │ ├── TagEnd.as
│ │ │ │ ├── TagExportAssets.as
│ │ │ │ ├── TagFileAttributes.as
│ │ │ │ ├── TagFrameLabel.as
│ │ │ │ ├── TagImportAssets.as
│ │ │ │ ├── TagImportAssets2.as
│ │ │ │ ├── TagJPEGTables.as
│ │ │ │ ├── TagMetadata.as
│ │ │ │ ├── TagNameCharacter.as
│ │ │ │ ├── TagPlaceObject.as
│ │ │ │ ├── TagPlaceObject2.as
│ │ │ │ ├── TagPlaceObject3.as
│ │ │ │ ├── TagPlaceObject4.as
│ │ │ │ ├── TagProductInfo.as
│ │ │ │ ├── TagProtect.as
│ │ │ │ ├── TagRemoveObject.as
│ │ │ │ ├── TagRemoveObject2.as
│ │ │ │ ├── TagScriptLimits.as
│ │ │ │ ├── TagSetBackgroundColor.as
│ │ │ │ ├── TagSetTabIndex.as
│ │ │ │ ├── TagShowFrame.as
│ │ │ │ ├── TagSoundStreamBlock.as
│ │ │ │ ├── TagSoundStreamHead.as
│ │ │ │ ├── TagSoundStreamHead2.as
│ │ │ │ ├── TagStartSound.as
│ │ │ │ ├── TagStartSound2.as
│ │ │ │ ├── TagSymbolClass.as
│ │ │ │ ├── TagUnknown.as
│ │ │ │ ├── TagVideoFrame.as
│ │ │ │ └── etc
│ │ │ │ │ ├── TagSWFEncryptActions.as
│ │ │ │ │ └── TagSWFEncryptSignature.as
│ │ │ ├── timeline
│ │ │ │ ├── Frame.as
│ │ │ │ ├── FrameObject.as
│ │ │ │ ├── Layer.as
│ │ │ │ ├── LayerStrip.as
│ │ │ │ ├── Scene.as
│ │ │ │ └── SoundStream.as
│ │ │ └── utils
│ │ │ │ ├── ColorUtils.as
│ │ │ │ ├── MatrixUtils.as
│ │ │ │ ├── NumberUtils.as
│ │ │ │ └── ObjCUtils.as
│ │ └── utils
│ │ │ ├── BitArray.as
│ │ │ ├── HalfPrecisionWriter.as
│ │ │ ├── HexUtils.as
│ │ │ └── StringUtils.as
│ └── myflashlabs
│ │ └── utils
│ │ └── worker
│ │ ├── WorkerBase.as
│ │ ├── WorkerFactory.as
│ │ └── WorkerManager.as
│ └── workers
│ └── Worker1.as
├── LICENSE
└── README.md
/FD/bin/AS-Workers.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/myflashlab/easyAS-Worker/a98ddaaa7f38339eefab3f56dfd989612ffa8285/FD/bin/AS-Workers.swf
--------------------------------------------------------------------------------
/FD/obj/AS-WorkersConfig.old:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 19.0
6 | false
7 | true
8 |
9 |
10 | CONFIG::debug
11 | false
12 |
13 |
14 | CONFIG::release
15 | true
16 |
17 |
18 | CONFIG::timeStamp
19 | '1/29/2016'
20 |
21 |
22 | CONFIG::air
23 | false
24 |
25 |
26 | CONFIG::mobile
27 | false
28 |
29 |
30 | CONFIG::desktop
31 | false
32 |
33 | true
34 | true
35 | false
36 |
37 | E:\gitHub\easyAS-Worker\FD\src
38 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes
39 |
40 |
41 |
42 | E:\gitHub\easyAS-Worker\FD\src\Main.as
43 |
44 | #FFFFFF
45 | 30
46 |
47 | 800
48 | 600
49 |
50 |
--------------------------------------------------------------------------------
/FD/obj/AS-WorkersConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 19.0
6 | false
7 | true
8 |
9 |
10 | CONFIG::debug
11 | false
12 |
13 |
14 | CONFIG::release
15 | true
16 |
17 |
18 | CONFIG::timeStamp
19 | '1/29/2016'
20 |
21 |
22 | CONFIG::air
23 | false
24 |
25 |
26 | CONFIG::mobile
27 | false
28 |
29 |
30 | CONFIG::desktop
31 | false
32 |
33 | true
34 | true
35 | false
36 |
37 | E:\gitHub\easyAS-Worker\FD\src
38 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes
39 |
40 |
41 |
42 | E:\gitHub\easyAS-Worker\FD\src\Main.as
43 |
44 | #FFFFFF
45 | 30
46 |
47 | 800
48 | 600
49 |
50 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFClipActions.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.utils.StringUtils;
5 |
6 | public class SWFClipActions
7 | {
8 | public var eventFlags:SWFClipEventFlags;
9 |
10 | protected var _records:Vector.;
11 |
12 | public function SWFClipActions(data:SWFData = null, version:uint = 0) {
13 | _records = new Vector.();
14 | if (data != null) {
15 | parse(data, version);
16 | }
17 | }
18 |
19 | public function get records():Vector. { return _records; }
20 |
21 | public function parse(data:SWFData, version:uint):void {
22 | data.readUI16(); // reserved, always 0
23 | eventFlags = data.readCLIPEVENTFLAGS(version);
24 | var record:SWFClipActionRecord;
25 | while ((record = data.readCLIPACTIONRECORD(version)) != null) {
26 | _records.push(record);
27 | }
28 | }
29 |
30 | public function publish(data:SWFData, version:uint):void {
31 | data.writeUI16(0); // reserved, always 0
32 | data.writeCLIPEVENTFLAGS(eventFlags, version);
33 | for(var i:uint = 0; i < records.length; i++) {
34 | data.writeCLIPACTIONRECORD(records[i], version);
35 | }
36 | if(version >= 6) {
37 | data.writeUI32(0);
38 | } else {
39 | data.writeUI16(0);
40 | }
41 | }
42 |
43 | public function toString(indent:uint = 0, flags:uint = 0):String {
44 | var str:String = "ClipActions (" + eventFlags.toString() + "):";
45 | for (var i:uint = 0; i < _records.length; i++) {
46 | str += "\n" + StringUtils.repeat(indent + 2) + "[" + i + "] " + _records[i].toString(indent + 2, flags);
47 | }
48 | return str;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFFocalGradient.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFFocalGradient extends SWFGradient
6 | {
7 | public function SWFFocalGradient(data:SWFData = null, level:uint = 1) {
8 | super(data, level);
9 | }
10 |
11 | override public function parse(data:SWFData, level:uint):void {
12 | super.parse(data, level);
13 | focalPoint = data.readFIXED8();
14 | }
15 |
16 | override public function publish(data:SWFData, level:uint = 1):void {
17 | super.publish(data, level);
18 | data.writeFIXED8(focalPoint);
19 | }
20 |
21 | override public function toString():String {
22 | return "(" + _records.join(",") + ")";
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFFrameLabel.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | public class SWFFrameLabel
4 | {
5 | public var frameNumber:uint;
6 | public var name:String;
7 |
8 | // TODO: parse() method?
9 | public function SWFFrameLabel(frameNumber:uint, name:String)
10 | {
11 | this.frameNumber = frameNumber;
12 | this.name = name;
13 | }
14 |
15 | public function toString():String {
16 | return "Frame: " + frameNumber + ", Name: " + name;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFGlyphEntry.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFGlyphEntry
6 | {
7 | public var index:uint;
8 | public var advance:int;
9 |
10 | public function SWFGlyphEntry(data:SWFData = null, glyphBits:uint = 0, advanceBits:uint = 0) {
11 | if (data != null) {
12 | parse(data, glyphBits, advanceBits);
13 | }
14 | }
15 |
16 | public function parse(data:SWFData, glyphBits:uint, advanceBits:uint):void {
17 | // GLYPHENTRYs are not byte aligned
18 | index = data.readUB(glyphBits);
19 | advance = data.readSB(advanceBits);
20 | }
21 |
22 | public function publish(data:SWFData, glyphBits:uint, advanceBits:uint):void {
23 | // GLYPHENTRYs are not byte aligned
24 | data.writeUB(glyphBits, index);
25 | data.writeSB(advanceBits, advance);
26 | }
27 |
28 | public function clone():SWFGlyphEntry {
29 | var entry:SWFGlyphEntry = new SWFGlyphEntry();
30 | entry.index = index;
31 | entry.advance = advance;
32 | return entry;
33 | }
34 |
35 | public function toString():String {
36 | return "[SWFGlyphEntry] Index: " + index.toString() + ", Advance: " + advance.toString();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFGradient.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFGradient
6 | {
7 | public var spreadMode:uint;
8 | public var interpolationMode:uint;
9 |
10 | // Forward declarations of properties in SWFFocalGradient
11 | public var focalPoint:Number = 0.0;
12 |
13 | protected var _records:Vector.;
14 |
15 | public function SWFGradient(data:SWFData = null, level:uint = 1) {
16 | _records = new Vector.();
17 | if (data != null) {
18 | parse(data, level);
19 | }
20 | }
21 |
22 | public function get records():Vector. { return _records; }
23 |
24 | public function parse(data:SWFData, level:uint):void {
25 | data.resetBitsPending();
26 | spreadMode = data.readUB(2);
27 | interpolationMode = data.readUB(2);
28 | var numGradients:uint = data.readUB(4);
29 | for (var i:uint = 0; i < numGradients; i++) {
30 | _records.push(data.readGRADIENTRECORD(level));
31 | }
32 | }
33 |
34 | public function publish(data:SWFData, level:uint = 1):void {
35 | var numRecords:uint = records.length;
36 | data.resetBitsPending();
37 | data.writeUB(2, spreadMode);
38 | data.writeUB(2, interpolationMode);
39 | data.writeUB(4, numRecords);
40 | for(var i:uint = 0; i < numRecords; i++) {
41 | data.writeGRADIENTRECORD(records[i], level);
42 | }
43 | }
44 |
45 | public function clone():SWFGradient {
46 | var gradient:SWFGradient = new SWFGradient();
47 | gradient.spreadMode = spreadMode;
48 | gradient.interpolationMode = interpolationMode;
49 | gradient.focalPoint = focalPoint;
50 | for(var i:uint = 0; i < records.length; i++) {
51 | gradient.records.push(records[i].clone());
52 | }
53 | return gradient;
54 | }
55 |
56 | public function toString():String {
57 | return "(" + _records.join(",") + "), SpreadMode: " + spreadMode + ", InterpolationMode: " + interpolationMode;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFGradientRecord.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.utils.ColorUtils;
5 |
6 | public class SWFGradientRecord
7 | {
8 | public var ratio:uint;
9 | public var color:uint;
10 |
11 | protected var _level:uint;
12 |
13 | public function SWFGradientRecord(data:SWFData = null, level:uint = 1) {
14 | if (data != null) {
15 | parse(data, level);
16 | }
17 | }
18 |
19 | public function parse(data:SWFData, level:uint):void {
20 | _level = level;
21 | ratio = data.readUI8();
22 | color = (level <= 2) ? data.readRGB() : data.readRGBA();
23 | }
24 |
25 | public function publish(data:SWFData, level:uint):void {
26 | data.writeUI8(ratio);
27 | if(level <= 2) {
28 | data.writeRGB(color);
29 | } else {
30 | data.writeRGBA(color);
31 | }
32 | }
33 |
34 | public function clone():SWFGradientRecord {
35 | var gradientRecord:SWFGradientRecord = new SWFGradientRecord();
36 | gradientRecord.ratio = ratio;
37 | gradientRecord.color = color;
38 | return gradientRecord;
39 | }
40 |
41 | public function toString():String {
42 | return "[" + ratio + "," + ((_level <= 2) ? ColorUtils.rgbToString(color) : ColorUtils.rgbaToString(color)) + "]";
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFKerningRecord.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFKerningRecord
6 | {
7 | public var code1:uint;
8 | public var code2:uint;
9 | public var adjustment:int;
10 |
11 | public function SWFKerningRecord(data:SWFData = null, wideCodes:Boolean = false) {
12 | if (data != null) {
13 | parse(data, wideCodes);
14 | }
15 | }
16 |
17 | public function parse(data:SWFData, wideCodes:Boolean):void {
18 | code1 = wideCodes ? data.readUI16() : data.readUI8();
19 | code2 = wideCodes ? data.readUI16() : data.readUI8();
20 | adjustment = data.readSI16();
21 | }
22 |
23 | public function publish(data:SWFData, wideCodes:Boolean):void {
24 | if(wideCodes) { data.writeUI16(code1); } else { data.writeUI8(code1); }
25 | if(wideCodes) { data.writeUI16(code2); } else { data.writeUI8(code2); }
26 | data.writeSI16(adjustment);
27 | }
28 |
29 | public function toString(indent:uint = 0):String {
30 | return "Code1: " + code1 + ", " + "Code2: " + code2 + ", " + "Adjustment: " + adjustment;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFMorphFocalGradient.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFMorphFocalGradient extends SWFMorphGradient
6 | {
7 | public function SWFMorphFocalGradient(data:SWFData = null, level:uint = 1) {
8 | super(data, level);
9 | }
10 |
11 | override public function parse(data:SWFData, level:uint):void {
12 | super.parse(data, level);
13 | startFocalPoint = data.readFIXED8();
14 | endFocalPoint = data.readFIXED8();
15 | }
16 |
17 | override public function publish(data:SWFData, level:uint):void {
18 | super.publish(data, level);
19 | data.writeFIXED8(startFocalPoint);
20 | data.writeFIXED8(endFocalPoint);
21 | }
22 |
23 | override public function getMorphedGradient(ratio:Number = 0):SWFGradient {
24 | var gradient:SWFGradient = new SWFGradient();
25 | // TODO: focalPoint
26 | for(var i:uint = 0; i < records.length; i++) {
27 | gradient.records.push(records[i].getMorphedGradientRecord(ratio));
28 | }
29 | return gradient;
30 | }
31 |
32 | override public function toString():String {
33 | return "FocalPoint: " + startFocalPoint + "," + endFocalPoint + " (" + _records.join(",") + ")";
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFMorphGradient.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFMorphGradient
6 | {
7 | public var spreadMode:uint;
8 | public var interpolationMode:uint;
9 |
10 | // Forward declarations of properties in SWFMorphFocalGradient
11 | public var startFocalPoint:Number = 0.0;
12 | public var endFocalPoint:Number = 0.0;
13 |
14 | protected var _records:Vector.;
15 |
16 | public function SWFMorphGradient(data:SWFData = null, level:uint = 1) {
17 | _records = new Vector.();
18 | if (data != null) {
19 | parse(data, level);
20 | }
21 | }
22 |
23 | public function get records():Vector. { return _records; }
24 |
25 | public function parse(data:SWFData, level:uint):void {
26 | data.resetBitsPending();
27 | spreadMode = data.readUB(2);
28 | interpolationMode = data.readUB(2);
29 | var numGradients:uint = data.readUB(4);
30 | for (var i:uint = 0; i < numGradients; i++) {
31 | _records.push(data.readMORPHGRADIENTRECORD());
32 | }
33 | }
34 |
35 | public function publish(data:SWFData, level:uint):void {
36 | var numGradients:uint = records.length;
37 | data.resetBitsPending();
38 | data.writeUB(2, spreadMode);
39 | data.writeUB(2, interpolationMode);
40 | data.writeUB(4, numGradients);
41 | for (var i:uint = 0; i < numGradients; i++) {
42 | data.writeMORPHGRADIENTRECORD(_records[i]);
43 | }
44 | }
45 |
46 | public function getMorphedGradient(ratio:Number = 0):SWFGradient {
47 | var gradient:SWFGradient = new SWFGradient();
48 | for(var i:uint = 0; i < records.length; i++) {
49 | gradient.records.push(records[i].getMorphedGradientRecord(ratio));
50 | }
51 | return gradient;
52 | }
53 |
54 | public function toString():String {
55 | return "(" + _records.join(",") + "), spread:" + spreadMode + ", interpolation:" + interpolationMode;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFMorphGradientRecord.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.utils.ColorUtils;
5 |
6 | public class SWFMorphGradientRecord
7 | {
8 | public var startRatio:uint;
9 | public var startColor:uint;
10 | public var endRatio:uint;
11 | public var endColor:uint;
12 |
13 | public function SWFMorphGradientRecord(data:SWFData = null) {
14 | if (data != null) {
15 | parse(data);
16 | }
17 | }
18 |
19 | public function parse(data:SWFData):void {
20 | startRatio = data.readUI8();
21 | startColor = data.readRGBA();
22 | endRatio = data.readUI8();
23 | endColor = data.readRGBA();
24 | }
25 |
26 | public function publish(data:SWFData):void {
27 | data.writeUI8(startRatio);
28 | data.writeRGBA(startColor);
29 | data.writeUI8(endRatio);
30 | data.writeRGBA(endColor);
31 | }
32 |
33 | public function getMorphedGradientRecord(ratio:Number = 0):SWFGradientRecord {
34 | var gradientRecord:SWFGradientRecord = new SWFGradientRecord();
35 | gradientRecord.color = ColorUtils.interpolate(startColor, endColor, ratio);
36 | gradientRecord.ratio = startRatio + (endRatio - startRatio) * ratio;
37 | return gradientRecord;
38 | }
39 |
40 | public function toString():String {
41 | return "[" + startRatio + "," + ColorUtils.rgbaToString(startColor) + "," + endRatio + "," + ColorUtils.rgbaToString(endColor) + "]";
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFRawTag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFRawTag
6 | {
7 | public var header:SWFRecordHeader;
8 | public var bytes:SWFData;
9 |
10 | public function SWFRawTag(data:SWFData = null)
11 | {
12 | if (data != null) {
13 | parse(data);
14 | }
15 | }
16 |
17 | public function parse(data:SWFData):void {
18 | var pos:uint = data.position;
19 | header = data.readTagHeader();
20 | bytes = new SWFData();
21 | var posContent:uint = data.position;
22 | data.position = pos;
23 | data.readBytes(bytes, 0, header.tagLength);
24 | data.position = posContent;
25 | }
26 |
27 | public function publish(data:SWFData):void {
28 | // Header is part of the byte array
29 | data.writeBytes(bytes);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFRecordHeader.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | public class SWFRecordHeader
4 | {
5 | public var type:uint;
6 | public var contentLength:uint;
7 | public var headerLength:uint;
8 |
9 | public function SWFRecordHeader(type:uint, contentLength:uint, headerLength:uint)
10 | {
11 | this.type = type;
12 | this.contentLength = contentLength;
13 | this.headerLength = headerLength;
14 | }
15 |
16 | public function get tagLength():uint {
17 | return headerLength + contentLength;
18 | }
19 |
20 | public function toString():String {
21 | return "[SWFRecordHeader] type: " + type + ", headerLength: " + headerLength + ", contentlength: " + contentLength;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFRectangle.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.utils.NumberUtils;
5 |
6 | import flash.geom.Rectangle;
7 |
8 | public class SWFRectangle
9 | {
10 | public var xmin:int = 0;
11 | public var xmax:int = 11000;
12 | public var ymin:int = 0;
13 | public var ymax:int = 8000;
14 |
15 | protected var _rectangle:Rectangle;
16 |
17 | public function SWFRectangle(data:SWFData = null) {
18 | _rectangle = new Rectangle();
19 | if (data != null) {
20 | parse(data);
21 | }
22 | }
23 |
24 | public function parse(data:SWFData):void {
25 | data.resetBitsPending();
26 | var bits:uint = data.readUB(5);
27 | xmin = data.readSB(bits);
28 | xmax = data.readSB(bits);
29 | ymin = data.readSB(bits);
30 | ymax = data.readSB(bits);
31 | }
32 |
33 | public function publish(data:SWFData):void {
34 | var numBits:uint = data.calculateMaxBits(true, [xmin, xmax, ymin, ymax]);
35 | data.resetBitsPending();
36 | data.writeUB(5, numBits);
37 | data.writeSB(numBits, xmin);
38 | data.writeSB(numBits, xmax);
39 | data.writeSB(numBits, ymin);
40 | data.writeSB(numBits, ymax);
41 | }
42 |
43 | public function clone():SWFRectangle {
44 | var rect:SWFRectangle = new SWFRectangle();
45 | rect.xmin = xmin;
46 | rect.xmax = xmax;
47 | rect.ymin = ymin;
48 | rect.ymax = ymax;
49 | return rect;
50 | }
51 |
52 | public function get rect():Rectangle {
53 | _rectangle.left = NumberUtils.roundPixels20(xmin / 20);
54 | _rectangle.right = NumberUtils.roundPixels20(xmax / 20);
55 | _rectangle.top = NumberUtils.roundPixels20(ymin / 20);
56 | _rectangle.bottom = NumberUtils.roundPixels20(ymax / 20);
57 | return _rectangle;
58 | }
59 |
60 | public function toString():String {
61 | return "(" + xmin + "," + xmax + "," + ymin + "," + ymax + ")";
62 | }
63 |
64 | public function toStringSize():String {
65 | return "(" + (Number(xmax) / 20 - Number(xmin) / 20) + "," + (Number(ymax) / 20 - Number(ymin) / 20) + ")";
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFRegisterParam.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFRegisterParam
6 | {
7 | public var register:uint;
8 | public var name:String;
9 |
10 | public function SWFRegisterParam(data:SWFData = null) {
11 | if (data != null) {
12 | parse(data);
13 | }
14 | }
15 |
16 | public function parse(data:SWFData):void {
17 | register = data.readUI8();
18 | name = data.readString();
19 | }
20 |
21 | public function publish(data:SWFData):void {
22 | data.writeUI8(register);
23 | data.writeString(name);
24 | }
25 |
26 | public function toString():String {
27 | return "$" + register + ":" + name;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFScene.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | public class SWFScene
4 | {
5 | public var offset:uint;
6 | public var name:String;
7 |
8 | // TODO: parse() method?
9 | public function SWFScene(offset:uint, name:String)
10 | {
11 | this.offset = offset;
12 | this.name = name;
13 | }
14 |
15 | public function toString():String {
16 | return "Frame: " + offset + ", Name: " + name;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFShapeRecord.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFShapeRecord
6 | {
7 | public static const TYPE_UNKNOWN:uint = 0;
8 | public static const TYPE_END:uint = 1;
9 | public static const TYPE_STYLECHANGE:uint = 2;
10 | public static const TYPE_STRAIGHTEDGE:uint = 3;
11 | public static const TYPE_CURVEDEDGE:uint = 4;
12 |
13 | public function SWFShapeRecord(data:SWFData = null, level:uint = 1) {
14 | if (data != null) {
15 | parse(data, level);
16 | }
17 | }
18 |
19 | public function get type():uint { return TYPE_UNKNOWN; }
20 |
21 | public function get isEdgeRecord():Boolean {
22 | return (type == TYPE_STRAIGHTEDGE || type == TYPE_CURVEDEDGE);
23 | }
24 |
25 | public function parse(data:SWFData = null, level:uint = 1):void {}
26 |
27 | public function publish(data:SWFData = null, level:uint = 1):void {}
28 |
29 | public function clone():SWFShapeRecord { return null; }
30 |
31 | public function toString(indent:uint = 0):String {
32 | return "[SWFShapeRecord]";
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFShapeRecordCurvedEdge.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFShapeRecordCurvedEdge extends SWFShapeRecord
6 | {
7 | public var controlDeltaX:int;
8 | public var controlDeltaY:int;
9 | public var anchorDeltaX:int;
10 | public var anchorDeltaY:int;
11 |
12 | protected var numBits:uint;
13 |
14 | public function SWFShapeRecordCurvedEdge(data:SWFData = null, numBits:uint = 0, level:uint = 1) {
15 | this.numBits = numBits;
16 | super(data, level);
17 | }
18 |
19 | override public function parse(data:SWFData = null, level:uint = 1):void {
20 | controlDeltaX = data.readSB(numBits);
21 | controlDeltaY = data.readSB(numBits);
22 | anchorDeltaX = data.readSB(numBits);
23 | anchorDeltaY = data.readSB(numBits);
24 | }
25 |
26 | override public function publish(data:SWFData = null, level:uint = 1):void {
27 | numBits = data.calculateMaxBits(true, [controlDeltaX, controlDeltaY, anchorDeltaX, anchorDeltaY]);
28 | if(numBits < 2) { numBits = 2; }
29 | data.writeUB(4, numBits - 2);
30 | data.writeSB(numBits, controlDeltaX);
31 | data.writeSB(numBits, controlDeltaY);
32 | data.writeSB(numBits, anchorDeltaX);
33 | data.writeSB(numBits, anchorDeltaY);
34 | }
35 |
36 | override public function clone():SWFShapeRecord {
37 | var record:SWFShapeRecordCurvedEdge = new SWFShapeRecordCurvedEdge();
38 | record.anchorDeltaX = anchorDeltaX;
39 | record.anchorDeltaY = anchorDeltaY;
40 | record.controlDeltaX = controlDeltaX;
41 | record.controlDeltaY = controlDeltaY;
42 | record.numBits = numBits;
43 | return record;
44 | }
45 |
46 | override public function get type():uint { return SWFShapeRecord.TYPE_CURVEDEDGE; }
47 |
48 | override public function toString(indent:uint = 0):String {
49 | return "[SWFShapeRecordCurvedEdge] " +
50 | "ControlDelta: " + controlDeltaX + "," + controlDeltaY + ", " +
51 | "AnchorDelta: " + anchorDeltaX + "," + anchorDeltaY;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFShapeRecordEnd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | public class SWFShapeRecordEnd extends SWFShapeRecord
4 | {
5 | public function SWFShapeRecordEnd() {}
6 |
7 | override public function clone():SWFShapeRecord { return new SWFShapeRecordEnd(); }
8 |
9 | override public function get type():uint { return SWFShapeRecord.TYPE_END; }
10 |
11 | override public function toString(indent:uint = 0):String {
12 | return "[SWFShapeRecordEnd]";
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFSoundEnvelope.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFSoundEnvelope
6 | {
7 | public var pos44:uint;
8 | public var leftLevel:uint;
9 | public var rightLevel:uint;
10 |
11 | public function SWFSoundEnvelope(data:SWFData = null) {
12 | if (data != null) {
13 | parse(data);
14 | }
15 | }
16 |
17 | public function parse(data:SWFData):void {
18 | pos44 = data.readUI32();
19 | leftLevel = data.readUI16();
20 | rightLevel = data.readUI16();
21 | }
22 |
23 | public function publish(data:SWFData):void {
24 | data.writeUI32(pos44);
25 | data.writeUI16(leftLevel);
26 | data.writeUI16(rightLevel);
27 | }
28 |
29 | public function clone():SWFSoundEnvelope {
30 | var soundEnvelope:SWFSoundEnvelope = new SWFSoundEnvelope();
31 | soundEnvelope.pos44 = pos44;
32 | soundEnvelope.leftLevel = leftLevel;
33 | soundEnvelope.rightLevel = rightLevel;
34 | return soundEnvelope;
35 | }
36 |
37 | public function toString():String {
38 | return "[SWFSoundEnvelope]";
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFSymbol.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFSymbol
6 | {
7 | public var tagId:uint;
8 | public var name:String;
9 |
10 | public function SWFSymbol(data:SWFData = null) {
11 | if (data != null) {
12 | parse(data);
13 | }
14 | }
15 |
16 | public static function create(aTagID:uint, aName:String):SWFSymbol {
17 | var swfSymbol:SWFSymbol = new SWFSymbol();
18 | swfSymbol.tagId = aTagID;
19 | swfSymbol.name = aName;
20 | return swfSymbol;
21 | }
22 |
23 | public function parse(data:SWFData):void {
24 | tagId = data.readUI16();
25 | name = data.readString();
26 | }
27 |
28 | public function publish(data:SWFData):void {
29 | data.writeUI16(tagId);
30 | data.writeString(name);
31 | }
32 |
33 | public function toString():String {
34 | return "TagID: " + tagId + ", Name: " + name;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFZoneData.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFZoneData
6 | {
7 | public var alignmentCoordinate:Number;
8 | public var range:Number;
9 |
10 | public function SWFZoneData(data:SWFData = null) {
11 | if (data != null) {
12 | parse(data);
13 | }
14 | }
15 |
16 | public function parse(data:SWFData):void {
17 | alignmentCoordinate = data.readFLOAT16();
18 | range = data.readFLOAT16();
19 | }
20 |
21 | public function publish(data:SWFData):void {
22 | data.writeFLOAT16(alignmentCoordinate);
23 | data.writeFLOAT16(range);
24 | }
25 |
26 | public function toString():String {
27 | return "(" + alignmentCoordinate + "," + range + ")";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/SWFZoneRecord.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class SWFZoneRecord
6 | {
7 | public var maskX:Boolean;
8 | public var maskY:Boolean;
9 |
10 | protected var _zoneData:Vector.;
11 |
12 | public function SWFZoneRecord(data:SWFData = null) {
13 | _zoneData = new Vector.();
14 | if (data != null) {
15 | parse(data);
16 | }
17 | }
18 |
19 | public function get zoneData():Vector. { return _zoneData; }
20 |
21 | public function parse(data:SWFData):void {
22 | var numZoneData:uint = data.readUI8();
23 | for (var i:uint = 0; i < numZoneData; i++) {
24 | _zoneData.push(data.readZONEDATA());
25 | }
26 | var mask:uint = data.readUI8();
27 | maskX = ((mask & 0x01) != 0);
28 | maskY = ((mask & 0x02) != 0);
29 | }
30 |
31 | public function publish(data:SWFData):void {
32 | var numZoneData:uint = _zoneData.length;
33 | data.writeUI8(numZoneData);
34 | for (var i:uint = 0; i < numZoneData; i++) {
35 | data.writeZONEDATA(_zoneData[i]);
36 | }
37 | var mask:uint = 0;
38 | if(maskX) { mask |= 0x01; }
39 | if(maskY) { mask |= 0x02; }
40 | data.writeUI8(mask);
41 | }
42 |
43 | public function toString(indent:uint = 0):String {
44 | var str:String = "MaskY: " + maskY + ", MaskX: " + maskX;
45 | for (var i:uint = 0; i < _zoneData.length; i++) {
46 | str += ", " + i + ": " + _zoneData[i].toString();
47 | }
48 | return str;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/ActionExecutionContext.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions
2 | {
3 | public class ActionExecutionContext
4 | {
5 | protected var _actions:Vector.;
6 | protected var _cpool:Array;
7 |
8 | public var labelCount:uint;
9 | public var endLabel:String;
10 |
11 | public function ActionExecutionContext(actions:Vector., cpool:Array, labelCount:uint)
12 | {
13 | _actions = actions;
14 | _cpool = cpool;
15 |
16 | this.labelCount = labelCount;
17 | this.endLabel = null;
18 |
19 | for(var i:uint = 0; i < actions.length; i++) {
20 | var action:IAction = actions[i];
21 | if (action is IActionBranch) {
22 | var actionBranch:IActionBranch = action as IActionBranch;
23 | if(actionBranch.branchIndex == -1) {
24 | endLabel = "L" + (labelCount + 1);
25 | break;
26 | }
27 | }
28 | }
29 | }
30 |
31 | public function get actions():Vector. { return _actions; }
32 | public function get cpool():Array { return _cpool; }
33 | }
34 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/ActionUnknown.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class ActionUnknown extends Action implements IAction
6 | {
7 | public function ActionUnknown(code:uint, length:uint, pos:uint) {
8 | super(code, length, pos);
9 | }
10 |
11 | override public function parse(data:SWFData):void {
12 | if (_length > 0) {
13 | data.skipBytes(_length);
14 | }
15 | }
16 |
17 | override public function toString(indent:uint = 0):String {
18 | return "[????] Code: " + _code.toString(16) + ", Length: " + _length;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/IAction.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public interface IAction
6 | {
7 | function get code():uint;
8 | function get length():uint;
9 | function get lengthWithHeader():uint;
10 | function get pos():uint;
11 |
12 | function get lbl():String;
13 | function set lbl(value:String):void;
14 |
15 | function parse(data:SWFData):void;
16 | function publish(data:SWFData):void;
17 | function clone():IAction;
18 | function toString(indent:uint = 0):String;
19 | function toBytecode(indent:uint, context:ActionExecutionContext):String;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/IActionBranch.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public interface IActionBranch extends IAction
6 | {
7 | function get branchOffset():int;
8 | function set branchOffset(value:int):void;
9 |
10 | function get branchIndex():int;
11 | function set branchIndex(value:int):void;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionGetURL.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.actions.*;
5 |
6 | public class ActionGetURL extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x83;
9 |
10 | public var urlString:String;
11 | public var targetString:String;
12 |
13 | public function ActionGetURL(code:uint, length:uint, pos:uint) {
14 | super(code, length, pos);
15 | }
16 |
17 | override public function parse(data:SWFData):void {
18 | urlString = data.readString();
19 | targetString = data.readString();
20 | }
21 |
22 | override public function publish(data:SWFData):void {
23 | var body:SWFData = new SWFData();
24 | body.writeString(urlString);
25 | body.writeString(targetString);
26 | write(data, body);
27 | }
28 |
29 | override public function clone():IAction {
30 | var action:ActionGetURL = new ActionGetURL(code, length, pos);
31 | action.urlString = urlString;
32 | action.targetString = targetString;
33 | return action;
34 | }
35 |
36 | override public function toString(indent:uint = 0):String {
37 | return "[ActionGetURL] URL: " + urlString + ", Target: " + targetString;
38 | }
39 |
40 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
41 | return toBytecodeLabel(indent) + "getURL \"" + urlString + "\", \"" + targetString + "\"";
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionGotoFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.actions.*;
5 |
6 | public class ActionGotoFrame extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x81;
9 |
10 | public var frame:uint;
11 |
12 | public function ActionGotoFrame(code:uint, length:uint, pos:uint) {
13 | super(code, length, pos);
14 | }
15 |
16 | override public function parse(data:SWFData):void {
17 | frame = data.readUI16();
18 | }
19 |
20 | override public function publish(data:SWFData):void {
21 | var body:SWFData = new SWFData();
22 | body.writeUI16(frame);
23 | write(data, body);
24 | }
25 |
26 | override public function clone():IAction {
27 | var action:ActionGotoFrame = new ActionGotoFrame(code, length, pos);
28 | action.frame = frame;
29 | return action;
30 | }
31 |
32 | override public function toString(indent:uint = 0):String {
33 | return "[ActionGotoFrame] Frame: " + frame;
34 | }
35 |
36 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
37 | return toBytecodeLabel(indent) + "gotoFrame " + frame;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionGotoLabel.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 | import com.codeazur.as3swf.SWFData;
5 |
6 | public class ActionGotoLabel extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x8c;
9 |
10 | public var label:String;
11 |
12 | public function ActionGotoLabel(code:uint, length:uint, pos:uint) {
13 | super(code, length, pos);
14 | }
15 |
16 | override public function parse(data:SWFData):void {
17 | label = data.readString();
18 | }
19 |
20 | override public function publish(data:SWFData):void {
21 | var body:SWFData = new SWFData();
22 | body.writeString(label);
23 | write(data, body);
24 | }
25 |
26 | override public function clone():IAction {
27 | var action:ActionGotoLabel = new ActionGotoLabel(code, length, pos);
28 | action.label = label;
29 | return action;
30 | }
31 |
32 | override public function toString(indent:uint = 0):String {
33 | return "[ActionGotoLabel] Label: " + label;
34 | }
35 |
36 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
37 | return toBytecodeLabel(indent) + "gotoLabel \"" + label + "\"";
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionNextFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 | import com.codeazur.as3swf.SWFData;
5 |
6 | public class ActionNextFrame extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x04;
9 |
10 | public function ActionNextFrame(code:uint, length:uint, pos:uint) {
11 | super(code, length, pos);
12 | }
13 |
14 | override public function toString(indent:uint = 0):String {
15 | return "[ActionNextFrame]";
16 | }
17 |
18 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
19 | return toBytecodeLabel(indent) + "nextFrame";
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionPlay.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 | import com.codeazur.as3swf.SWFData;
5 |
6 | public class ActionPlay extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x06;
9 |
10 | public function ActionPlay(code:uint, length:uint, pos:uint) {
11 | super(code, length, pos);
12 | }
13 |
14 | override public function toString(indent:uint = 0):String {
15 | return "[ActionPlay]";
16 | }
17 |
18 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
19 | return toBytecodeLabel(indent) + "play";
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionPreviousFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionPreviousFrame extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x05;
8 |
9 | public function ActionPreviousFrame(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionPreviousFrame]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "previousFrame";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionSetTarget.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.actions.*;
5 |
6 | public class ActionSetTarget extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x8b;
9 |
10 | public var targetName:String;
11 |
12 | public function ActionSetTarget(code:uint, length:uint, pos:uint) {
13 | super(code, length, pos);
14 | }
15 |
16 | override public function parse(data:SWFData):void {
17 | targetName = data.readString();
18 | }
19 |
20 | override public function publish(data:SWFData):void {
21 | var body:SWFData = new SWFData();
22 | body.writeString(targetName);
23 | write(data, body);
24 | }
25 |
26 | override public function clone():IAction {
27 | var action:ActionSetTarget = new ActionSetTarget(code, length, pos);
28 | action.targetName = targetName;
29 | return action;
30 | }
31 |
32 | override public function toString(indent:uint = 0):String {
33 | return "[ActionSetTarget] TargetName: " + targetName;
34 | }
35 |
36 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
37 | return toBytecodeLabel(indent) + "setTarget \"" + targetName + "\"";
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionStop.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStop extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x07;
8 |
9 | public function ActionStop(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStop]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stop";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionStopSounds.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStopSounds extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x09;
8 |
9 | public function ActionStopSounds(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStopSounds]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stopSounds";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionToggleQuality.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionToggleQuality extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x08;
8 |
9 | public function ActionToggleQuality(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionToggleQuality]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "toggleQuality";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf3/ActionWaitForFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf3
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 | import com.codeazur.as3swf.SWFData;
5 |
6 | public class ActionWaitForFrame extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x8a;
9 |
10 | public var frame:uint;
11 | public var skipCount:uint;
12 |
13 | public function ActionWaitForFrame(code:uint, length:uint, pos:uint) {
14 | super(code, length, pos);
15 | }
16 |
17 | override public function parse(data:SWFData):void {
18 | frame = data.readUI16();
19 | skipCount = data.readUI8();
20 | }
21 |
22 | override public function publish(data:SWFData):void {
23 | var body:SWFData = new SWFData();
24 | body.writeUI16(frame);
25 | body.writeUI8(skipCount);
26 | write(data, body);
27 | }
28 |
29 | override public function clone():IAction {
30 | var action:ActionWaitForFrame = new ActionWaitForFrame(code, length, pos);
31 | action.frame = frame;
32 | action.skipCount = skipCount;
33 | return action;
34 | }
35 |
36 | override public function toString(indent:uint = 0):String {
37 | return "[ActionWaitForFrame] Frame: " + frame + ", SkipCount: " + skipCount;
38 | }
39 |
40 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
41 | return toBytecodeLabel(indent) + "waitForFrame " + frame + (skipCount > 0 ? ", " + skipCount : "");
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionAdd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionAdd extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0a;
8 |
9 | public function ActionAdd(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionAdd]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "add";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionAnd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionAnd extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x10;
8 |
9 | public function ActionAnd(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionAnd]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "and";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionAsciiToChar.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionAsciiToChar extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x33;
8 |
9 | public function ActionAsciiToChar(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionAsciiToChar]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "asciiToChar";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionCall.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCall extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x9e;
8 |
9 | public function ActionCall(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCall]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "call";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionCharToAscii.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCharToAscii extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x32;
8 |
9 | public function ActionCharToAscii(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCharToAscii]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "charToAscii";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionCloneSprite.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCloneSprite extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x24;
8 |
9 | public function ActionCloneSprite(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCloneSprite]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "cloneSprite";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionDivide.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDivide extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0d;
8 |
9 | public function ActionDivide(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDivide]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "divide";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionEndDrag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionEndDrag extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x28;
8 |
9 | public function ActionEndDrag(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionEndDrag]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "endDrag";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionEquals.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionEquals extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0e;
8 |
9 | public function ActionEquals(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionEquals]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "equals";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionGetProperty.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionGetProperty extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x22;
8 |
9 | public function ActionGetProperty(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionGetProperty]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "getProperty";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionGetTime.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionGetTime extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x34;
8 |
9 | public function ActionGetTime(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionGetTime]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "getTime";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionGetVariable.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionGetVariable extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x1c;
8 |
9 | public function ActionGetVariable(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionGetVariable]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "getVariable";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionGotoFrame2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 | import com.codeazur.as3swf.SWFData;
5 |
6 | public class ActionGotoFrame2 extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x9f;
9 |
10 | public var sceneBiasFlag:Boolean;
11 | public var playFlag:Boolean;
12 | public var sceneBias:uint;
13 |
14 | public function ActionGotoFrame2(code:uint, length:uint, pos:uint) {
15 | super(code, length, pos);
16 | }
17 |
18 | override public function parse(data:SWFData):void {
19 | var flags:uint = data.readUI8();
20 | sceneBiasFlag = ((flags & 0x02) != 0);
21 | playFlag = ((flags & 0x01) != 0);
22 | if (sceneBiasFlag) {
23 | sceneBias = data.readUI16();
24 | }
25 | }
26 |
27 | override public function publish(data:SWFData):void {
28 | var body:SWFData = new SWFData();
29 | var flags:uint = 0;
30 | if (sceneBiasFlag) { flags |= 0x02; }
31 | if (playFlag) { flags |= 0x01; }
32 | body.writeUI8(flags);
33 | if (sceneBiasFlag) {
34 | body.writeUI16(sceneBias);
35 | }
36 | write(data, body);
37 | }
38 |
39 | override public function clone():IAction {
40 | var action:ActionGotoFrame2 = new ActionGotoFrame2(code, length, pos);
41 | action.sceneBiasFlag = sceneBiasFlag;
42 | action.playFlag = playFlag;
43 | action.sceneBias = sceneBias;
44 | return action;
45 | }
46 |
47 | override public function toString(indent:uint = 0):String {
48 | var str:String = "[ActionGotoFrame2] " +
49 | "PlayFlag: " + playFlag + ", ";
50 | "SceneBiasFlag: " + sceneBiasFlag;
51 | if (sceneBiasFlag) {
52 | str += ", " + sceneBias;
53 | }
54 | return str;
55 | }
56 |
57 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
58 | return toBytecodeLabel(indent) + "gotoFrame2 (" +
59 | (playFlag == 0 ? "gotoAndStop" : "gotoAndPlay") +
60 | (sceneBiasFlag == 1 ? ", sceneBias: " + sceneBias : "") +
61 | ")";
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionLess.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionLess extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0f;
8 |
9 | public function ActionLess(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionLess]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "less";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionMBAsciiToChar.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionMBAsciiToChar extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x37;
8 |
9 | public function ActionMBAsciiToChar(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionMBAsciiToChar]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "mbAsciiToChar";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionMBCharToAscii.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionMBCharToAscii extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x36;
8 |
9 | public function ActionMBCharToAscii(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionMBCharToAscii]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "mbCharToAscii";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionMBStringExtract.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionMBStringExtract extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x35;
8 |
9 | public function ActionMBStringExtract(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionMBStringExtract]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "mbStringExtract";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionMBStringLength.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionMBStringLength extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x31;
8 |
9 | public function ActionMBStringLength(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionMBStringLength]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "mbStringLength";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionMultiply.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionMultiply extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0c;
8 |
9 | public function ActionMultiply(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionMultiply]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "multiply";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionNot.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionNot extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x12;
8 |
9 | public function ActionNot(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionNot]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "not";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionOr.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionOr extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x11;
8 |
9 | public function ActionOr(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionOr]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "or";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionPop.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionPop extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x17;
8 |
9 | public function ActionPop(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionPop]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "pop";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionPush.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFActionValue;
5 | import com.codeazur.as3swf.data.actions.*;
6 | import com.codeazur.utils.StringUtils;
7 |
8 | public class ActionPush extends Action implements IAction
9 | {
10 | public static const CODE:uint = 0x96;
11 |
12 | public var values:Vector.;
13 |
14 | public function ActionPush(code:uint, length:uint, pos:uint) {
15 | super(code, length, pos);
16 | values = new Vector.();
17 | }
18 |
19 | override public function parse(data:SWFData):void {
20 | var endPosition:uint = data.position + length;
21 | while (data.position != endPosition) {
22 | values.push(data.readACTIONVALUE());
23 | }
24 | }
25 |
26 | override public function publish(data:SWFData):void {
27 | var body:SWFData = new SWFData();
28 | for (var i:uint = 0; i < values.length; i++) {
29 | body.writeACTIONVALUE(values[i]);
30 | }
31 | write(data, body);
32 | }
33 |
34 | override public function clone():IAction {
35 | var action:ActionPush = new ActionPush(code, length, pos);
36 | for (var i:uint = 0; i < values.length; i++) {
37 | action.values.push(values[i].clone());
38 | }
39 | return action;
40 | }
41 |
42 | override public function toString(indent:uint = 0):String {
43 | return "[ActionPush] " + values.join(", ");
44 | }
45 |
46 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
47 | var str:String = toBytecodeLabel(indent);
48 | for (var i:uint = 0; i < values.length; i++) {
49 | if (i > 0) {
50 | str += "\n" + StringUtils.repeat(indent + 2);
51 | }
52 | str += "push " + values[i].toBytecodeString(context.cpool);
53 | }
54 | return str;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionRandomNumber.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionRandomNumber extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x30;
8 |
9 | public function ActionRandomNumber(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionRandomNumber]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "randomNumber";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionRemoveSprite.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionRemoveSprite extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x25;
8 |
9 | public function ActionRemoveSprite(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionRemoveSprite]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "removeSprite";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionSetProperty.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionSetProperty extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x23;
8 |
9 | public function ActionSetProperty(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionSetProperty]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "setProperty";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionSetTarget2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionSetTarget2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x20;
8 |
9 | public function ActionSetTarget2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionSetTarget2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "setTarget2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionSetVariable.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionSetVariable extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x1d;
8 |
9 | public function ActionSetVariable(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionSetVariable]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "setVariable";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStartDrag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStartDrag extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x27;
8 |
9 | public function ActionStartDrag(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStartDrag]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "startDrag";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStringAdd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringAdd extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x21;
8 |
9 | public function ActionStringAdd(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringAdd]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringAdd";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStringEquals.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringEquals extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x13;
8 |
9 | public function ActionStringEquals(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringEquals]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringEquals";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStringExtract.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringExtract extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x15;
8 |
9 | public function ActionStringExtract(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringExtract]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringExtract";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStringLength.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringLength extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x14;
8 |
9 | public function ActionStringLength(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringLength]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringLength";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionStringLess.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringLess extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x29;
8 |
9 | public function ActionStringLess(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringLess]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringLess";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionSubtract.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionSubtract extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x0b;
8 |
9 | public function ActionSubtract(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionSubtract]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "subtract";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionToInteger.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionToInteger extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x18;
8 |
9 | public function ActionToInteger(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionToInteger]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "toInteger";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionTrace.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionTrace extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x26;
8 |
9 | public function ActionTrace(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionTrace]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "trace";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf4/ActionWaitForFrame2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf4
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.actions.*;
5 |
6 | public class ActionWaitForFrame2 extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x8d;
9 |
10 | public var skipCount:uint;
11 |
12 | public function ActionWaitForFrame2(code:uint, length:uint, pos:uint) {
13 | super(code, length, pos);
14 | }
15 |
16 | override public function parse(data:SWFData):void {
17 | skipCount = data.readUI8();
18 | }
19 |
20 | override public function publish(data:SWFData):void {
21 | var body:SWFData = new SWFData();
22 | body.writeUI8(skipCount);
23 | write(data, body);
24 | }
25 |
26 | override public function clone():IAction {
27 | var action:ActionWaitForFrame2 = new ActionWaitForFrame2(code, length, pos);
28 | action.skipCount = skipCount;
29 | return action;
30 | }
31 |
32 | override public function toString(indent:uint = 0):String {
33 | return "[ActionWaitForFrame2] SkipCount: " + skipCount;
34 | }
35 |
36 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
37 | return toBytecodeLabel(indent) + "waitForFrame2 (" + skipCount + ")";
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionAdd2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionAdd2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x47;
8 |
9 | public function ActionAdd2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionAdd2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "add2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitAnd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitAnd extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x60;
8 |
9 | public function ActionBitAnd(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitAnd]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitAnd";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitLShift.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitLShift extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x63;
8 |
9 | public function ActionBitLShift(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitLShift]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitLShift";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitOr.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitOr extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x61;
8 |
9 | public function ActionBitOr(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitOr]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitOr";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitRShift.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitRShift extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x64;
8 |
9 | public function ActionBitRShift(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitRShift]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitRShift";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitURShift.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitURShift extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x65;
8 |
9 | public function ActionBitURShift(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitURShift]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitURShift";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionBitXor.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionBitXor extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x62;
8 |
9 | public function ActionBitXor(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionBitXor]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "bitXor";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionCallFunction.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCallFunction extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3d;
8 |
9 | public function ActionCallFunction(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCallFunction]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "callFunction";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionCallMethod.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCallMethod extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x52;
8 |
9 | public function ActionCallMethod(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCallMethod]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "callMethod";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionDecrement.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDecrement extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x51;
8 |
9 | public function ActionDecrement(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDecrement]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "decrement";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionDefineLocal.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDefineLocal extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3c;
8 |
9 | public function ActionDefineLocal(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDefineLocal]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "defineLocal";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionDefineLocal2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDefineLocal2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x41;
8 |
9 | public function ActionDefineLocal2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDefineLocal2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "defineLocal2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionDelete.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDelete extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3a;
8 |
9 | public function ActionDelete(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDelete]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "delete";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionDelete2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionDelete2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3b;
8 |
9 | public function ActionDelete2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionDelete2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "delete2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionEnumerate.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionEnumerate extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x46;
8 |
9 | public function ActionEnumerate(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionEnumerate]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "enumerate";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionEquals2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionEquals2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x49;
8 |
9 | public function ActionEquals2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionEquals2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "equals2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionGetMember.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionGetMember extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4e;
8 |
9 | public function ActionGetMember(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionGetMember]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "getMember";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionIncrement.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionIncrement extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x50;
8 |
9 | public function ActionIncrement(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionIncrement]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "increment";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionInitArray.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionInitArray extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x42;
8 |
9 | public function ActionInitArray(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionInitArray]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "initArray";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionInitObject.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionInitObject extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x43;
8 |
9 | public function ActionInitObject(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionInitObject]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "initObject";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionLess2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionLess2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x48;
8 |
9 | public function ActionLess2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionLess2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "less2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionModulo.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionModulo extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3f;
8 |
9 | public function ActionModulo(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionModulo]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "modulo";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionNewMethod.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionNewMethod extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x53;
8 |
9 | public function ActionNewMethod(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionNewMethod]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "newMethod";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionNewObject.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionNewObject extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x40;
8 |
9 | public function ActionNewObject(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionNewObject]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "newObject";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionPushDuplicate.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionPushDuplicate extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4c;
8 |
9 | public function ActionPushDuplicate(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionPushDuplicate]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "pushDuplicate";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionReturn.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionReturn extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x3e;
8 |
9 | public function ActionReturn(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionReturn]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "return";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionSetMember.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionSetMember extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4f;
8 |
9 | public function ActionSetMember(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionSetMember]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "setMember";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionStackSwap.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStackSwap extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4d;
8 |
9 | public function ActionStackSwap(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStackSwap]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stackSwap";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionStoreRegister.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.actions.*;
5 |
6 | public class ActionStoreRegister extends Action implements IAction
7 | {
8 | public static const CODE:uint = 0x87;
9 |
10 | public var registerNumber:uint;
11 |
12 | public function ActionStoreRegister(code:uint, length:uint, pos:uint) {
13 | super(code, length, pos);
14 | }
15 |
16 | override public function parse(data:SWFData):void {
17 | registerNumber = data.readUI8();
18 | }
19 |
20 | override public function publish(data:SWFData):void {
21 | var body:SWFData = new SWFData();
22 | body.writeUI8(registerNumber);
23 | write(data, body);
24 | }
25 |
26 | override public function clone():IAction {
27 | var action:ActionStoreRegister = new ActionStoreRegister(code, length, pos);
28 | action.registerNumber = registerNumber;
29 | return action;
30 | }
31 |
32 | override public function toString(indent:uint = 0):String {
33 | return "[ActionStoreRegister] RegisterNumber: " + registerNumber;
34 | }
35 |
36 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
37 | return toBytecodeLabel(indent) + "store $" + registerNumber;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionTargetPath.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionTargetPath extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x45;
8 |
9 | public function ActionTargetPath(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionTargetPath]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "targetPath";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionToNumber.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionToNumber extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4a;
8 |
9 | public function ActionToNumber(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionToNumber]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "toNumber";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionToString.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionToString extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x4b;
8 |
9 | public function ActionToString(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionToString]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "toString";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf5/ActionTypeOf.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf5
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionTypeOf extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x44;
8 |
9 | public function ActionTypeOf(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionTypeOf]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "typeOf";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf6/ActionEnumerate2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf6
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionEnumerate2 extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x55;
8 |
9 | public function ActionEnumerate2(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionEnumerate2]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "enumerate2";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf6/ActionGreater.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf6
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionGreater extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x67;
8 |
9 | public function ActionGreater(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionGreater]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "greater";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf6/ActionInstanceOf.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf6
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionInstanceOf extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x54;
8 |
9 | public function ActionInstanceOf(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionInstanceOf]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "instanceOf";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf6/ActionStrictEquals.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf6
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStrictEquals extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x66;
8 |
9 | public function ActionStrictEquals(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStrictEquals]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "strictEquals";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf6/ActionStringGreater.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf6
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionStringGreater extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x68;
8 |
9 | public function ActionStringGreater(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionStringGreater]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "stringGreater";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf7/ActionCastOp.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf7
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionCastOp extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x2b;
8 |
9 | public function ActionCastOp(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionCastOp]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "castOp";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf7/ActionExtends.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf7
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionExtends extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x69;
8 |
9 | public function ActionExtends(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionExtends]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "extends";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf7/ActionImplementsOp.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf7
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionImplementsOp extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x2c;
8 |
9 | public function ActionImplementsOp(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionImplementsOp]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "implementsOp";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/actions/swf7/ActionThrow.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.actions.swf7
2 | {
3 | import com.codeazur.as3swf.data.actions.*;
4 |
5 | public class ActionThrow extends Action implements IAction
6 | {
7 | public static const CODE:uint = 0x2a;
8 |
9 | public function ActionThrow(code:uint, length:uint, pos:uint) {
10 | super(code, length, pos);
11 | }
12 |
13 | override public function toString(indent:uint = 0):String {
14 | return "[ActionThrow]";
15 | }
16 |
17 | override public function toBytecode(indent:uint, context:ActionExecutionContext):String {
18 | return toBytecodeLabel(indent) + "throw";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/ActionValueType.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class ActionValueType
4 | {
5 | public static const STRING:uint = 0;
6 | public static const FLOAT:uint = 1;
7 | public static const NULL:uint = 2;
8 | public static const UNDEFINED:uint = 3;
9 | public static const REGISTER:uint = 4;
10 | public static const BOOLEAN:uint = 5;
11 | public static const DOUBLE:uint = 6;
12 | public static const INTEGER:uint = 7;
13 | public static const CONSTANT_8:uint = 8;
14 | public static const CONSTANT_16:uint = 9;
15 |
16 | public static function toString(bitmapFormat:uint):String {
17 | switch(bitmapFormat) {
18 | case STRING: return "string"; break;
19 | case FLOAT: return "float"; break;
20 | case NULL: return "null"; break;
21 | case UNDEFINED: return "undefined"; break;
22 | case REGISTER: return "register"; break;
23 | case BOOLEAN: return "boolean"; break;
24 | case DOUBLE: return "double"; break;
25 | case INTEGER: return "integer"; break;
26 | case CONSTANT_8: return "constant8"; break;
27 | case CONSTANT_16: return "constant16"; break;
28 | default: return "unknown"; break;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/BitmapFormat.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class BitmapFormat
4 | {
5 | public static const BIT_8:uint = 3;
6 | public static const BIT_15:uint = 4;
7 | public static const BIT_24:uint = 5;
8 |
9 | public static function toString(bitmapFormat:uint):String {
10 | switch(bitmapFormat) {
11 | case BIT_8: return "8 BPP"; break;
12 | case BIT_15: return "15 BPP"; break;
13 | case BIT_24: return "24 BPP"; break;
14 | default: return "unknown"; break;
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/BitmapType.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class BitmapType
4 | {
5 | public static const JPEG:uint = 1;
6 | public static const GIF89A:uint = 2;
7 | public static const PNG:uint = 3;
8 |
9 | public static function toString(bitmapFormat:uint):String {
10 | switch(bitmapFormat) {
11 | case JPEG: return "JPEG"; break;
12 | case GIF89A: return "GIF89a"; break;
13 | case PNG: return "PNG"; break;
14 | default: return "unknown"; break;
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/BlendMode.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class BlendMode
4 | {
5 | public static const NORMAL_0:uint = 0;
6 | public static const NORMAL_1:uint = 1;
7 | public static const LAYER:uint = 2;
8 | public static const MULTIPLY:uint = 3;
9 | public static const SCREEN:uint = 4;
10 | public static const LIGHTEN:uint = 5;
11 | public static const DARKEN:uint = 6;
12 | public static const DIFFERENCE:uint = 7;
13 | public static const ADD:uint = 8;
14 | public static const SUBTRACT:uint = 9;
15 | public static const INVERT:uint = 10;
16 | public static const ALPHA:uint = 11;
17 | public static const ERASE:uint = 12;
18 | public static const OVERLAY:uint = 13;
19 | public static const HARDLIGHT:uint = 14;
20 |
21 | public static function toString(blendMode:uint):String {
22 | switch(blendMode) {
23 | case NORMAL_0:
24 | case NORMAL_1:
25 | return "normal";
26 | break;
27 | case LAYER: return "layer"; break;
28 | case MULTIPLY: return "multiply"; break;
29 | case SCREEN: return "screen"; break;
30 | case LIGHTEN: return "lighten"; break;
31 | case DARKEN: return "darken"; break;
32 | case DIFFERENCE: return "difference"; break;
33 | case ADD: return "add"; break;
34 | case SUBTRACT: return "subtract"; break;
35 | case INVERT: return "invert"; break;
36 | case ALPHA: return "alpha"; break;
37 | case ERASE: return "erase"; break;
38 | case OVERLAY: return "overlay"; break;
39 | case HARDLIGHT: return "hardlight"; break;
40 | default: return "unknown"; break;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/CSMTableHint.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class CSMTableHint
4 | {
5 | public static const THIN:uint = 0;
6 | public static const MEDIUM:uint = 1;
7 | public static const THICK:uint = 2;
8 |
9 | public static function toString(csmTableHint:uint):String {
10 | switch(csmTableHint) {
11 | case THIN: return "thin"; break;
12 | case MEDIUM: return "medium"; break;
13 | case THICK: return "thick"; break;
14 | default: return "unknown"; break;
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/GradientInterpolationMode.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | import flash.display.InterpolationMethod;
4 |
5 | public class GradientInterpolationMode
6 | {
7 | public static const NORMAL:uint = 0;
8 | public static const LINEAR:uint = 1;
9 |
10 | public static function toString(interpolationMode:uint):String {
11 | switch(interpolationMode) {
12 | case NORMAL: return InterpolationMethod.RGB; break;
13 | case LINEAR: return InterpolationMethod.LINEAR_RGB; break;
14 | default: return InterpolationMethod.RGB; break;
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/GradientSpreadMode.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | import flash.display.SpreadMethod;
4 |
5 | public class GradientSpreadMode
6 | {
7 | public static const PAD:uint = 0;
8 | public static const REFLECT:uint = 1;
9 | public static const REPEAT:uint = 2;
10 |
11 | public static function toString(spreadMode:uint):String {
12 | switch(spreadMode) {
13 | case PAD: return SpreadMethod.PAD; break;
14 | case REFLECT: return SpreadMethod.REFLECT; break;
15 | case REPEAT: return SpreadMethod.REPEAT; break;
16 | default: return "unknown"; break;
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/LineCapsStyle.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | import flash.display.CapsStyle;
4 |
5 | public class LineCapsStyle
6 | {
7 | public static const ROUND:uint = 0;
8 | public static const NO:uint = 1;
9 | public static const SQUARE:uint = 2;
10 |
11 | public static function toString(lineCapsStyle:uint):String {
12 | switch(lineCapsStyle) {
13 | case ROUND: return CapsStyle.ROUND;
14 | case NO: return CapsStyle.NONE;
15 | case SQUARE: return CapsStyle.SQUARE;
16 | default: return "unknown";
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/LineJointStyle.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | import flash.display.JointStyle;
4 |
5 | public class LineJointStyle
6 | {
7 | public static const ROUND:uint = 0;
8 | public static const BEVEL:uint = 1;
9 | public static const MITER:uint = 2;
10 |
11 | public static function toString(lineJointStyle:uint):String {
12 | switch(lineJointStyle) {
13 | case ROUND: return JointStyle.ROUND;
14 | case BEVEL: return JointStyle.BEVEL;
15 | case MITER: return JointStyle.MITER;
16 | default: return "null";
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/SoundCompression.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class SoundCompression
4 | {
5 | public static const UNCOMPRESSED_NATIVE_ENDIAN:uint = 0;
6 | public static const ADPCM:uint = 1;
7 | public static const MP3:uint = 2;
8 | public static const UNCOMPRESSED_LITTLE_ENDIAN:uint = 3;
9 | public static const NELLYMOSER_16_KHZ:uint = 4;
10 | public static const NELLYMOSER_8_KHZ:uint = 5;
11 | public static const NELLYMOSER:uint = 6;
12 | public static const SPEEX:uint = 11;
13 |
14 | public static function toString(soundCompression:uint):String {
15 | switch(soundCompression) {
16 | case UNCOMPRESSED_NATIVE_ENDIAN: return "Uncompressed Native Endian"; break;
17 | case ADPCM: return "ADPCM"; break;
18 | case MP3: return "MP3"; break;
19 | case UNCOMPRESSED_LITTLE_ENDIAN: return "Uncompressed Little Endian"; break;
20 | case NELLYMOSER_16_KHZ: return "Nellymoser 16kHz"; break;
21 | case NELLYMOSER_8_KHZ: return "Nellymoser 8kHz"; break;
22 | case NELLYMOSER: return "Nellymoser"; break;
23 | case SPEEX: return "Speex"; break;
24 | default: return "unknown"; break;
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/SoundRate.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class SoundRate
4 | {
5 | public static const KHZ_5:uint = 0;
6 | public static const KHZ_11:uint = 1;
7 | public static const KHZ_22:uint = 2;
8 | public static const KHZ_44:uint = 3;
9 |
10 | public static function toString(soundRate:uint):String {
11 | switch(soundRate) {
12 | case KHZ_5: return "5.5kHz"; break;
13 | case KHZ_11: return "11kHz"; break;
14 | case KHZ_22: return "22kHz"; break;
15 | case KHZ_44: return "44kHz"; break;
16 | default: return "unknown"; break;
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/SoundSize.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class SoundSize
4 | {
5 | public static const BIT_8:uint = 0;
6 | public static const BIT_16:uint = 1;
7 |
8 | public static function toString(soundSize:uint):String {
9 | switch(soundSize) {
10 | case BIT_8: return "8bit"; break;
11 | case BIT_16: return "16bit"; break;
12 | default: return "unknown"; break;
13 | }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/SoundType.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class SoundType
4 | {
5 | public static const MONO:uint = 0;
6 | public static const STEREO:uint = 1;
7 |
8 | public static function toString(soundType:uint):String {
9 | switch(soundType) {
10 | case MONO: return "mono"; break;
11 | case STEREO: return "stereo"; break;
12 | default: return "unknown"; break;
13 | }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/VideoCodecID.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class VideoCodecID
4 | {
5 | public static const H263:uint = 2;
6 | public static const SCREEN:uint = 3;
7 | public static const VP6:uint = 4;
8 | public static const VP6ALPHA:uint = 5;
9 | public static const SCREENV2:uint = 6;
10 |
11 | public static function toString(codecId:uint):String {
12 | switch(codecId) {
13 | case H263: return "H.263"; break;
14 | case SCREEN: return "Screen Video"; break;
15 | case VP6: return "VP6"; break;
16 | case VP6ALPHA: return "VP6 With Alpha"; break;
17 | case SCREENV2: return "Screen Video V2"; break;
18 | default: return "unknown"; break;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/consts/VideoDeblockingType.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.consts
2 | {
3 | public class VideoDeblockingType
4 | {
5 | public static const VIDEOPACKET:uint = 0;
6 | public static const OFF:uint = 1;
7 | public static const LEVEL1:uint = 2;
8 | public static const LEVEL2:uint = 3;
9 | public static const LEVEL3:uint = 4;
10 | public static const LEVEL4:uint = 5;
11 |
12 | public static function toString(deblockingType:uint):String {
13 | switch(deblockingType) {
14 | case VIDEOPACKET: return "videopacket"; break;
15 | case OFF: return "off"; break;
16 | case LEVEL1: return "level 1"; break;
17 | case LEVEL2: return "level 2"; break;
18 | case LEVEL3: return "level 3"; break;
19 | case LEVEL4: return "level 4"; break;
20 | default: return "unknown"; break;
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/etc/CurvedEdge.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.etc
2 | {
3 | import flash.geom.Point;
4 |
5 | public class CurvedEdge extends StraightEdge implements IEdge
6 | {
7 | protected var _control:Point;
8 |
9 | public function CurvedEdge(aFrom:Point, aControl:Point, aTo:Point, aLineStyleIdx:uint = 0, aFillStyleIdx:uint = 0)
10 | {
11 | super(aFrom, aTo, aLineStyleIdx, aFillStyleIdx);
12 | _control = aControl;
13 | }
14 |
15 | public function get control():Point { return _control; }
16 |
17 | override public function reverseWithNewFillStyle(newFillStyleIdx:uint):IEdge {
18 | return new CurvedEdge(to, control, from, lineStyleIdx, newFillStyleIdx);
19 | }
20 |
21 | override public function toString():String {
22 | return "stroke:" + lineStyleIdx + ", fill:" + fillStyleIdx + ", start:" + from.toString() + ", control:" + control.toString() + ", end:" + to.toString();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/etc/IEdge.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.etc
2 | {
3 | import flash.geom.Point;
4 |
5 | public interface IEdge
6 | {
7 | function get from():Point;
8 | function get to():Point;
9 | function get lineStyleIdx():uint;
10 | function get fillStyleIdx():uint;
11 |
12 | function reverseWithNewFillStyle(newFillStyleIdx:uint):IEdge;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/etc/StraightEdge.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.etc
2 | {
3 | import flash.geom.Point;
4 |
5 | public class StraightEdge implements IEdge
6 | {
7 | protected var _from:Point;
8 | protected var _to:Point;
9 | protected var _lineStyleIdx:uint = 0;
10 | protected var _fillStyleIdx:uint = 0;
11 |
12 | public function StraightEdge(aFrom:Point, aTo:Point, aLineStyleIdx:uint = 0, aFillStyleIdx:uint = 0)
13 | {
14 | _from = aFrom;
15 | _to = aTo;
16 | _lineStyleIdx = aLineStyleIdx;
17 | _fillStyleIdx = aFillStyleIdx;
18 | }
19 |
20 | public function get from():Point { return _from; }
21 | public function get to():Point { return _to; }
22 | public function get lineStyleIdx():uint { return _lineStyleIdx; }
23 | public function get fillStyleIdx():uint { return _fillStyleIdx; }
24 |
25 | public function reverseWithNewFillStyle(newFillStyleIdx:uint):IEdge {
26 | return new StraightEdge(to, from, lineStyleIdx, newFillStyleIdx);
27 | }
28 |
29 | public function toString():String {
30 | return "stroke:" + lineStyleIdx + ", fill:" + fillStyleIdx + ", start:" + from.toString() + ", end:" + to.toString();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/filters/Filter.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.filters
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.filters.BitmapFilter;
6 |
7 | public class Filter implements IFilter
8 | {
9 | protected var _id:uint;
10 |
11 | public function Filter(id:uint) {
12 | _id = id;
13 | }
14 |
15 | public function get id():uint { return _id; }
16 |
17 | public function get filter():BitmapFilter {
18 | throw(new Error("Implement in subclasses!"));
19 | }
20 |
21 | public function parse(data:SWFData):void {
22 | throw(new Error("Implement in subclasses!"));
23 | }
24 |
25 | public function publish(data:SWFData):void {
26 | throw(new Error("Implement in subclasses!"));
27 | }
28 |
29 | public function clone():IFilter {
30 | throw(new Error("Implement in subclasses!"));
31 | }
32 |
33 | public function toString(indent:uint = 0):String {
34 | return "[Filter]";
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/filters/FilterBlur.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.filters
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.filters.BitmapFilter;
6 | import flash.filters.BlurFilter;
7 |
8 | public class FilterBlur extends Filter implements IFilter
9 | {
10 | public var blurX:Number;
11 | public var blurY:Number;
12 | public var passes:uint;
13 |
14 | public function FilterBlur(id:uint) {
15 | super(id);
16 | }
17 |
18 | override public function get filter():BitmapFilter {
19 | return new BlurFilter(
20 | blurX,
21 | blurY,
22 | passes
23 | );
24 | }
25 |
26 | override public function parse(data:SWFData):void {
27 | blurX = data.readFIXED();
28 | blurY = data.readFIXED();
29 | passes = data.readUI8() >> 3;
30 | }
31 |
32 | override public function publish(data:SWFData):void {
33 | data.writeFIXED(blurX);
34 | data.writeFIXED(blurY);
35 | data.writeUI8(passes << 3);
36 | }
37 |
38 | override public function clone():IFilter {
39 | var filter:FilterBlur = new FilterBlur(id);
40 | filter.blurX = blurX;
41 | filter.blurY = blurY;
42 | filter.passes = passes;
43 | return filter;
44 | }
45 |
46 | override public function toString(indent:uint = 0):String {
47 | return "[BlurFilter] " +
48 | "BlurX: " + blurX + ", " +
49 | "BlurY: " + blurY + ", " +
50 | "Passes: " + passes;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/data/filters/IFilter.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.data.filters
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.filters.BitmapFilter;
6 |
7 | public interface IFilter
8 | {
9 | function get id():uint;
10 | function get filter():BitmapFilter;
11 |
12 | function parse(data:SWFData):void;
13 | function publish(data:SWFData):void;
14 | function clone():IFilter;
15 | function toString(indent:uint = 0):String;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/events/SWFErrorEvent.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class SWFErrorEvent extends Event
6 | {
7 | public static const ERROR:String = "error";
8 |
9 | public static const REASON_EOF:String = "eof";
10 |
11 | public var reason:String;
12 |
13 | public function SWFErrorEvent(type:String, reason:String, bubbles:Boolean=false, cancelable:Boolean=false)
14 | {
15 | super(type, bubbles, cancelable);
16 | this.reason = reason;
17 | }
18 |
19 | override public function clone():Event {
20 | return new SWFErrorEvent(type, reason, bubbles, cancelable);
21 | }
22 |
23 | override public function toString():String {
24 | return "[SWFErrorEvent] reason: " + reason;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/events/SWFEventDispatcher.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.events
2 | {
3 | import flash.events.Event;
4 | import flash.events.EventDispatcher;
5 | import flash.events.IEventDispatcher;
6 |
7 | public class SWFEventDispatcher implements IEventDispatcher
8 | {
9 | protected var dispatcher:EventDispatcher;
10 |
11 | public function SWFEventDispatcher() {
12 | dispatcher = new EventDispatcher(this);
13 | }
14 |
15 | public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void {
16 | dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
17 | }
18 | public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {
19 | dispatcher.removeEventListener(type, listener, useCapture);
20 | }
21 | public function dispatchEvent(event:Event):Boolean {
22 | return dispatcher.dispatchEvent(event);
23 | }
24 | public function hasEventListener(type:String):Boolean {
25 | return dispatcher.hasEventListener(type);
26 | }
27 | public function willTrigger(type:String):Boolean {
28 | return dispatcher.willTrigger(type);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/events/SWFProgressEvent.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class SWFProgressEvent extends Event
6 | {
7 | public static const PROGRESS:String = "progress";
8 | public static const COMPLETE:String = "complete";
9 |
10 | protected var processed:uint;
11 | protected var total:uint;
12 |
13 | public function SWFProgressEvent(type:String, processed:uint, total:uint, bubbles:Boolean=false, cancelable:Boolean=false)
14 | {
15 | super(type, bubbles, cancelable);
16 | this.processed = processed;
17 | this.total = total;
18 | }
19 |
20 | public function get progress():Number {
21 | return processed / total;
22 | }
23 |
24 | public function get progressPercent():Number {
25 | return Math.round(progress * 100);
26 | }
27 |
28 | override public function clone():Event {
29 | return new SWFProgressEvent(type, processed, total, bubbles, cancelable);
30 | }
31 |
32 | override public function toString():String {
33 | return "[SWFProgressEvent] processed: " + processed + ", total: " + total + " (" + progressPercent + "%)";
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/events/SWFWarningEvent.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class SWFWarningEvent extends Event
6 | {
7 | public static const OVERFLOW:String = "overflow";
8 | public static const UNDERFLOW:String = "underflow";
9 |
10 | public var index:uint;
11 | public var data:Object;
12 |
13 | public function SWFWarningEvent(type:String, index:uint, data:Object = null, bubbles:Boolean=false, cancelable:Boolean=false)
14 | {
15 | super(type, bubbles, cancelable);
16 | this.index = index;
17 | this.data = data;
18 | }
19 |
20 | override public function clone():Event {
21 | return new SWFWarningEvent(type, index, data, bubbles, cancelable);
22 | }
23 |
24 | override public function toString():String {
25 | return "[SWFWarningEvent] index: " + index;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/exporters/core/DefaultShapeExporter.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.exporters.core
2 | {
3 | import com.codeazur.as3swf.SWF;
4 |
5 | import flash.display.InterpolationMethod;
6 | import flash.display.LineScaleMode;
7 | import flash.display.SpreadMethod;
8 | import flash.geom.Matrix;
9 |
10 | public class DefaultShapeExporter implements IShapeExporter
11 | {
12 | protected var swf:SWF;
13 |
14 | public function DefaultShapeExporter(swf:SWF) {
15 | this.swf = swf;
16 | }
17 |
18 | public function beginShape():void {}
19 | public function endShape():void {}
20 |
21 | public function beginFills():void {}
22 | public function endFills():void {}
23 |
24 | public function beginLines():void {}
25 | public function endLines():void {}
26 |
27 | public function beginFill(color:uint, alpha:Number = 1.0):void {}
28 | public function beginGradientFill(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = SpreadMethod.PAD, interpolationMethod:String = InterpolationMethod.RGB, focalPointRatio:Number = 0):void {}
29 | public function beginBitmapFill(bitmapId:uint, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false):void {}
30 | public function endFill():void {}
31 |
32 | public function lineStyle(thickness:Number = NaN, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = LineScaleMode.NORMAL, startCaps:String = null, endCaps:String = null, joints:String = null, miterLimit:Number = 3):void {}
33 | public function lineGradientStyle(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = SpreadMethod.PAD, interpolationMethod:String = InterpolationMethod.RGB, focalPointRatio:Number = 0):void {}
34 |
35 | public function moveTo(x:Number, y:Number):void {}
36 | public function lineTo(x:Number, y:Number):void {}
37 | public function curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):void {}
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/exporters/core/IShapeExporter.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.exporters.core
2 | {
3 | import flash.display.BitmapData;
4 | import flash.display.InterpolationMethod;
5 | import flash.display.LineScaleMode;
6 | import flash.display.SpreadMethod;
7 | import flash.geom.Matrix;
8 |
9 | public interface IShapeExporter
10 | {
11 | function beginShape():void;
12 | function endShape():void;
13 |
14 | function beginFills():void;
15 | function endFills():void;
16 |
17 | function beginLines():void;
18 | function endLines():void;
19 |
20 | function beginFill(color:uint, alpha:Number = 1.0):void;
21 | function beginGradientFill(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0):void;
22 | function beginBitmapFill(bitmapId:uint, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false):void;
23 | function endFill():void;
24 |
25 | function lineStyle(thickness:Number = NaN, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = "normal", startCaps:String = null, endCaps:String = null, joints:String = null, miterLimit:Number = 3):void;
26 | function lineGradientStyle(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0):void;
27 |
28 | function moveTo(x:Number, y:Number):void;
29 | function lineTo(x:Number, y:Number):void;
30 | function curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):void;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/factories/ISWFTagFactory.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.factories
2 | {
3 | import com.codeazur.as3swf.tags.ITag;
4 |
5 | public interface ISWFTagFactory
6 | {
7 | function create(type:uint):ITag;
8 | }
9 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/factories/SWFFilterFactory.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.factories
2 | {
3 | import com.codeazur.as3swf.data.filters.*;
4 |
5 | public class SWFFilterFactory
6 | {
7 | public static function create(id:uint):IFilter
8 | {
9 | switch(id)
10 | {
11 | case 0: return new FilterDropShadow(id);
12 | case 1: return new FilterBlur(id);
13 | case 2: return new FilterGlow(id);
14 | case 3: return new FilterBevel(id);
15 | case 4: return new FilterGradientGlow(id);
16 | case 5: return new FilterConvolution(id);
17 | case 6: return new FilterColorMatrix(id);
18 | case 7: return new FilterGradientBevel(id);
19 | default: throw(new Error("Unknown filter ID: " + id));
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/IDefinitionTag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | public interface IDefinitionTag extends ITag
4 | {
5 | function get characterId():uint;
6 | function set characterId(value:uint):void;
7 |
8 | function clone():IDefinitionTag;
9 | }
10 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/IDisplayListTag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | public interface IDisplayListTag extends ITag
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/ITag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public interface ITag
6 | {
7 | function get type():uint;
8 | function get name():String;
9 | function get version():uint;
10 | function get level():uint;
11 |
12 | function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void;
13 | function publish(data:SWFData, version:uint):void;
14 | function toString(indent:uint = 0, flags:uint = 0):String;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/Tag.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.utils.StringUtils;
4 |
5 | public class Tag
6 | {
7 | public static function toStringCommon(type:uint, name:String, indent:uint = 0):String {
8 | return StringUtils.repeat(indent) + "[" + StringUtils.printf("%02d", type) + ":" + name + "] ";
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagCSMTextSettings.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagCSMTextSettings implements ITag
6 | {
7 | public static const TYPE:uint = 74;
8 |
9 | public var textId:uint;
10 | public var useFlashType:uint;
11 | public var gridFit:uint;
12 | public var thickness:Number;
13 | public var sharpness:Number;
14 |
15 | public function TagCSMTextSettings() {}
16 |
17 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
18 | textId = data.readUI16();
19 | useFlashType = data.readUB(2);
20 | gridFit = data.readUB(3);
21 | data.readUB(3); // reserved, always 0
22 | thickness = data.readFIXED();
23 | sharpness = data.readFIXED();
24 | data.readUI8(); // reserved, always 0
25 | }
26 |
27 | public function publish(data:SWFData, version:uint):void {
28 | data.writeTagHeader(type, 12);
29 | data.writeUI16(textId);
30 | data.writeUB(2, useFlashType);
31 | data.writeUB(3, gridFit);
32 | data.writeUB(3, 0); // reserved, always 0
33 | data.writeFIXED(thickness);
34 | data.writeFIXED(sharpness);
35 | data.writeUI8(0); // reserved, always 0
36 | }
37 |
38 | public function get type():uint { return TYPE; }
39 | public function get name():String { return "CSMTextSettings"; }
40 | public function get version():uint { return 8; }
41 | public function get level():uint { return 1; }
42 |
43 | public function toString(indent:uint = 0, flags:uint = 0):String {
44 | return Tag.toStringCommon(type, name, indent) +
45 | "TextID: " + textId + ", " +
46 | "UseFlashType: " + useFlashType + ", " +
47 | "GridFit: " + gridFit + ", " +
48 | "Thickness: " + thickness + ", " +
49 | "Sharpness: " + sharpness;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDebugID.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.utils.StringUtils;
5 |
6 | import flash.utils.ByteArray;
7 |
8 | public class TagDebugID implements ITag
9 | {
10 | public static const TYPE:uint = 63;
11 |
12 | protected var _uuid:ByteArray;
13 |
14 | public function TagDebugID() {
15 | _uuid = new ByteArray();
16 | }
17 |
18 | public function get uuid():ByteArray { return _uuid; }
19 |
20 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
21 | if(length > 0) {
22 | data.readBytes(_uuid, 0, length);
23 | }
24 | }
25 |
26 | public function publish(data:SWFData, version:uint):void {
27 | data.writeTagHeader(type, _uuid.length);
28 | if(_uuid.length > 0) {
29 | data.writeBytes(_uuid);
30 | }
31 | }
32 |
33 | public function get type():uint { return TYPE; }
34 | public function get name():String { return "DebugID"; }
35 | public function get version():uint { return 6; }
36 | public function get level():uint { return 1; }
37 |
38 | public function toString(indent:uint = 0, flags:uint = 0):String {
39 | var str:String = Tag.toStringCommon(type, name, indent) + "UUID: ";
40 | if (_uuid.length == 16) {
41 | str += StringUtils.printf("%02x%02x%02x%02x-", _uuid[0], _uuid[1], _uuid[2], _uuid[3]);
42 | str += StringUtils.printf("%02x%02x-", _uuid[4], _uuid[5]);
43 | str += StringUtils.printf("%02x%02x-", _uuid[6], _uuid[7]);
44 | str += StringUtils.printf("%02x%02x-", _uuid[8], _uuid[9]);
45 | str += StringUtils.printf("%02x%02x%02x%02x%02x%02x", _uuid[10], _uuid[11], _uuid[12], _uuid[13], _uuid[14], _uuid[15]);
46 | } else {
47 | str += "(invalid length: " + _uuid.length + ")";
48 | }
49 | return str;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineBinaryData.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagDefineBinaryData implements IDefinitionTag
8 | {
9 | public static const TYPE:uint = 87;
10 |
11 | protected var _characterId:uint;
12 |
13 | protected var _binaryData:ByteArray;
14 |
15 | public function TagDefineBinaryData() {
16 | _binaryData = new ByteArray();
17 | }
18 |
19 | public function get characterId():uint { return _characterId; }
20 | public function set characterId(value:uint):void { _characterId = value; }
21 |
22 | public function get binaryData():ByteArray { return _binaryData; }
23 |
24 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
25 | _characterId = data.readUI16();
26 | data.readUI32(); // reserved, always 0
27 | if (length > 6) {
28 | data.readBytes(_binaryData, 0, length - 6);
29 | }
30 | }
31 |
32 | public function publish(data:SWFData, version:uint):void {
33 | var body:SWFData = new SWFData();
34 | body.writeUI16(_characterId);
35 | body.writeUI32(0); // reserved, always 0
36 | if (_binaryData.length > 0) {
37 | body.writeBytes(_binaryData);
38 | }
39 | data.writeTagHeader(type, body.length);
40 | data.writeBytes(body);
41 | }
42 |
43 | public function clone():IDefinitionTag {
44 | var tag:TagDefineBinaryData = new TagDefineBinaryData();
45 | tag.characterId = characterId;
46 | if (_binaryData.length > 0) {
47 | tag.binaryData.writeBytes(_binaryData);
48 | }
49 | return tag;
50 | }
51 |
52 | public function get type():uint { return TYPE; }
53 | public function get name():String { return "DefineBinaryData"; }
54 | public function get version():uint { return 9; }
55 | public function get level():uint { return 1; }
56 |
57 | public function toString(indent:uint = 0, flags:uint = 0):String {
58 | return Tag.toStringCommon(type, name, indent) +
59 | "ID: " + characterId + ", " +
60 | "Length: " + _binaryData.length;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineBitsJPEG2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.consts.BitmapType;
5 |
6 | public class TagDefineBitsJPEG2 extends TagDefineBits implements IDefinitionTag
7 | {
8 | public static const TYPE:uint = 21;
9 |
10 | public function TagDefineBitsJPEG2() {}
11 |
12 | override public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
13 | super.parse(data, length, version);
14 | if (bitmapData[0] == 0xff && (bitmapData[1] == 0xd8 || bitmapData[1] == 0xd9)) {
15 | bitmapType = BitmapType.JPEG;
16 | } else if (bitmapData[0] == 0x89 && bitmapData[1] == 0x50 && bitmapData[2] == 0x4e && bitmapData[3] == 0x47 && bitmapData[4] == 0x0d && bitmapData[5] == 0x0a && bitmapData[6] == 0x1a && bitmapData[7] == 0x0a) {
17 | bitmapType = BitmapType.PNG;
18 | } else if (bitmapData[0] == 0x47 && bitmapData[1] == 0x49 && bitmapData[2] == 0x46 && bitmapData[3] == 0x38 && bitmapData[4] == 0x39 && bitmapData[5] == 0x61) {
19 | bitmapType = BitmapType.GIF89A;
20 | }
21 | }
22 |
23 | override public function clone():IDefinitionTag {
24 | var tag:TagDefineBitsJPEG2 = new TagDefineBitsJPEG2();
25 | tag.characterId = characterId;
26 | tag.bitmapType = bitmapType;
27 | if (_bitmapData.length > 0) {
28 | tag.bitmapData.writeBytes(_bitmapData);
29 | }
30 | return tag;
31 | }
32 |
33 | override public function get type():uint { return TYPE; }
34 | override public function get name():String { return "DefineBitsJPEG2"; }
35 | override public function get version():uint { return (bitmapType == BitmapType.JPEG) ? 2 : 8; }
36 | override public function get level():uint { return 2; }
37 |
38 | override public function toString(indent:uint = 0, flags:uint = 0):String {
39 | var str:String = Tag.toStringCommon(type, name, indent) +
40 | "ID: " + characterId + ", " +
41 | "Type: " + BitmapType.toString(bitmapType) + ", " +
42 | "BitmapLength: " + bitmapData.length;
43 | return str;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineBitsLossless2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.data.consts.BitmapFormat;
4 |
5 | public class TagDefineBitsLossless2 extends TagDefineBitsLossless implements IDefinitionTag
6 | {
7 | public static const TYPE:uint = 36;
8 |
9 | public function TagDefineBitsLossless2() {}
10 |
11 | override public function clone():IDefinitionTag {
12 | var tag:TagDefineBitsLossless2 = new TagDefineBitsLossless2();
13 | tag.characterId = characterId;
14 | tag.bitmapFormat = bitmapFormat;
15 | tag.bitmapWidth = bitmapWidth;
16 | tag.bitmapHeight = bitmapHeight;
17 | if (_zlibBitmapData.length > 0) {
18 | tag.zlibBitmapData.writeBytes(_zlibBitmapData);
19 | }
20 | return tag;
21 | }
22 |
23 | override public function get type():uint { return TYPE; }
24 | override public function get name():String { return "DefineBitsLossless2"; }
25 | override public function get version():uint { return 3; }
26 | override public function get level():uint { return 2; }
27 |
28 | override public function toString(indent:uint = 0, flags:uint = 0):String {
29 | return Tag.toStringCommon(type, name, indent) +
30 | "ID: " + characterId + ", " +
31 | "Format: " + BitmapFormat.toString(bitmapFormat) + ", " +
32 | "Size: (" + bitmapWidth + "," + bitmapHeight + ")";
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineButtonCxform.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFColorTransform;
5 |
6 | public class TagDefineButtonCxform implements IDefinitionTag
7 | {
8 | public static const TYPE:uint = 23;
9 |
10 | public var buttonColorTransform:SWFColorTransform;
11 |
12 | protected var _characterId:uint;
13 |
14 | public function TagDefineButtonCxform() {}
15 |
16 | public function get characterId():uint { return _characterId; }
17 | public function set characterId(value:uint):void { _characterId = value; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | _characterId = data.readUI16();
21 | buttonColorTransform = data.readCXFORM();
22 | }
23 |
24 | public function publish(data:SWFData, version:uint):void {
25 | var body:SWFData = new SWFData();
26 | body.writeUI16(characterId);
27 | body.writeCXFORM(buttonColorTransform);
28 | data.writeTagHeader(type, body.length);
29 | data.writeBytes(body);
30 | }
31 |
32 | public function clone():IDefinitionTag {
33 | var tag:TagDefineButtonCxform = new TagDefineButtonCxform();
34 | tag.characterId = characterId;
35 | tag.buttonColorTransform = buttonColorTransform.clone();
36 | return tag;
37 | }
38 |
39 | public function get type():uint { return TYPE; }
40 | public function get name():String { return "DefineButtonCxform"; }
41 | public function get version():uint { return 2; }
42 | public function get level():uint { return 1; }
43 |
44 | public function toString(indent:uint = 0, flags:uint = 0):String {
45 | var str:String = Tag.toStringCommon(type, name, indent) +
46 | "ID: " + characterId + ", " +
47 | "ColorTransform: " + buttonColorTransform;
48 | return str;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineFont3.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | public class TagDefineFont3 extends TagDefineFont2 implements IDefinitionTag
4 | {
5 | public static const TYPE:uint = 75;
6 |
7 | public function TagDefineFont3() {}
8 |
9 | override public function get type():uint { return TYPE; }
10 | override public function get name():String { return "DefineFont3"; }
11 | override public function get version():uint { return 8; }
12 | override public function get level():uint { return 2; }
13 |
14 | override protected function get unitDivisor():Number { return 20; }
15 |
16 | override public function toString(indent:uint = 0, flags:uint = 0):String {
17 | var str:String = Tag.toStringCommon(type, name, indent) +
18 | "ID: " + characterId + ", " +
19 | "FontName: " + fontName + ", " +
20 | "Italic: " + italic + ", " +
21 | "Bold: " + bold + ", " +
22 | "Glyphs: " + _glyphShapeTable.length;
23 | return str + toStringCommon(indent);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineFontInfo2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagDefineFontInfo2 extends TagDefineFontInfo implements ITag
6 | {
7 | public static const TYPE:uint = 62;
8 |
9 | public function TagDefineFontInfo2() {}
10 |
11 | override protected function parseLangCode(data:SWFData):void {
12 | langCode = data.readUI8();
13 | langCodeLength = 1;
14 | }
15 |
16 | override protected function publishLangCode(data:SWFData):void {
17 | data.writeUI8(langCode);
18 | }
19 |
20 | override public function get type():uint { return TYPE; }
21 | override public function get name():String { return "DefineFontInfo2"; }
22 | override public function get version():uint { return 6; }
23 | override public function get level():uint { return 2; }
24 |
25 | override public function toString(indent:uint = 0, flags:uint = 0):String {
26 | return Tag.toStringCommon(type, name, indent) +
27 | "FontID: " + fontId + ", " +
28 | "FontName: " + fontName + ", " +
29 | "Italic: " + italic + ", " +
30 | "Bold: " + bold + ", " +
31 | "LanguageCode: " + langCode + ", " +
32 | "Codes: " + _codeTable.length;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineFontName.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagDefineFontName implements ITag
6 | {
7 | public static const TYPE:uint = 88;
8 |
9 | public var fontId:uint;
10 | public var fontName:String;
11 | public var fontCopyright:String;
12 |
13 | public function TagDefineFontName() {}
14 |
15 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
16 | fontId = data.readUI16();
17 | fontName = data.readString();
18 | fontCopyright = data.readString();
19 | }
20 |
21 | public function publish(data:SWFData, version:uint):void {
22 | var body:SWFData = new SWFData();
23 | body.writeUI16(fontId);
24 | body.writeString(fontName);
25 | body.writeString(fontCopyright);
26 | data.writeTagHeader(type, body.length);
27 | data.writeBytes(body);
28 | }
29 |
30 | public function get type():uint { return TYPE; }
31 | public function get name():String { return "DefineFontName"; }
32 | public function get version():uint { return 9; }
33 | public function get level():uint { return 1; }
34 |
35 | public function toString(indent:uint = 0, flags:uint = 0):String {
36 | return Tag.toStringCommon(type, name, indent) +
37 | "FontID: " + fontId + ", " +
38 | "Name: " + fontName + ", " +
39 | "Copyright: " + fontCopyright;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineScalingGrid.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFRectangle;
5 |
6 | public class TagDefineScalingGrid implements IDefinitionTag
7 | {
8 | public static const TYPE:uint = 78;
9 |
10 | public var splitter:SWFRectangle;
11 |
12 | protected var _characterId:uint;
13 |
14 | public function TagDefineScalingGrid() {}
15 |
16 | public function get characterId():uint { return _characterId; }
17 | public function set characterId(value:uint):void { _characterId = value; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | _characterId = data.readUI16();
21 | splitter = data.readRECT();
22 | }
23 |
24 | public function publish(data:SWFData, version:uint):void {
25 | var body:SWFData = new SWFData();
26 | body.writeUI16(characterId);
27 | body.writeRECT(splitter);
28 | data.writeTagHeader(type, body.length);
29 | data.writeBytes(body);
30 | }
31 |
32 | public function clone():IDefinitionTag {
33 | var tag:TagDefineScalingGrid = new TagDefineScalingGrid();
34 | tag.characterId = characterId;
35 | tag.splitter = splitter.clone();
36 | return tag;
37 | }
38 |
39 | public function get type():uint { return TYPE; }
40 | public function get name():String { return "DefineScalingGrid"; }
41 | public function get version():uint { return 8; }
42 | public function get level():uint { return 1; }
43 |
44 | public function toString(indent:uint = 0, flags:uint = 0):String {
45 | return Tag.toStringCommon(type, name, indent) +
46 | "CharacterID: " + characterId + ", " +
47 | "Splitter: " + splitter;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineShape.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFRectangle;
5 | import com.codeazur.as3swf.data.SWFShapeWithStyle;
6 | import com.codeazur.as3swf.exporters.core.IShapeExporter;
7 |
8 | public class TagDefineShape implements IDefinitionTag
9 | {
10 | public static const TYPE:uint = 2;
11 |
12 | public var shapeBounds:SWFRectangle;
13 | public var shapes:SWFShapeWithStyle;
14 |
15 | protected var _characterId:uint;
16 |
17 | public function TagDefineShape() {}
18 |
19 | public function get characterId():uint { return _characterId; }
20 | public function set characterId(value:uint):void { _characterId = value; }
21 |
22 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
23 | _characterId = data.readUI16();
24 | shapeBounds = data.readRECT();
25 | shapes = data.readSHAPEWITHSTYLE(level);
26 | }
27 |
28 | public function publish(data:SWFData, version:uint):void {
29 | var body:SWFData = new SWFData();
30 | body.writeUI16(characterId);
31 | body.writeRECT(shapeBounds);
32 | body.writeSHAPEWITHSTYLE(shapes, level);
33 | data.writeTagHeader(type, body.length);
34 | data.writeBytes(body);
35 | }
36 |
37 | public function clone():IDefinitionTag {
38 | var tag:TagDefineShape = new TagDefineShape();
39 | throw(new Error("Not implemented yet."));
40 | return tag;
41 | }
42 |
43 | public function export(handler:IShapeExporter = null):void {
44 | shapes.export(handler);
45 | }
46 |
47 | public function get type():uint { return TYPE; }
48 | public function get name():String { return "DefineShape"; }
49 | public function get version():uint { return 1; }
50 | public function get level():uint { return 1; }
51 |
52 | public function toString(indent:uint = 0, flags:uint = 0):String {
53 | var str:String = Tag.toStringCommon(type, name, indent) +
54 | "ID: " + characterId + ", " +
55 | "Bounds: " + shapeBounds;
56 | str += shapes.toString(indent + 2);
57 | return str;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineShape2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagDefineShape2 extends TagDefineShape implements IDefinitionTag
6 | {
7 | public static const TYPE:uint = 22;
8 |
9 | public function TagDefineShape2() {}
10 |
11 | override public function get type():uint { return TYPE; }
12 | override public function get name():String { return "DefineShape2"; }
13 | override public function get version():uint { return 2; }
14 | override public function get level():uint { return 2; }
15 |
16 | override public function toString(indent:uint = 0, flags:uint = 0):String {
17 | var str:String = Tag.toStringCommon(type, name, indent) +
18 | "ID: " + characterId + ", " +
19 | "Bounds: " + shapeBounds;
20 | str += shapes.toString(indent + 2);
21 | return str;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineShape3.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagDefineShape3 extends TagDefineShape2 implements IDefinitionTag
6 | {
7 | public static const TYPE:uint = 32;
8 |
9 | public function TagDefineShape3() {}
10 |
11 | override public function get type():uint { return TYPE; }
12 | override public function get name():String { return "DefineShape3"; }
13 | override public function get version():uint { return 3; }
14 | override public function get level():uint { return 3; }
15 |
16 | override public function toString(indent:uint = 0, flags:uint = 0):String {
17 | var str:String = Tag.toStringCommon(type, name, indent) +
18 | "ID: " + characterId + ", " +
19 | "Bounds: " + shapeBounds;
20 | str += shapes.toString(indent + 2);
21 | return str;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineSprite.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.SWFTimelineContainer;
5 |
6 | public class TagDefineSprite extends SWFTimelineContainer implements IDefinitionTag
7 | {
8 | public static const TYPE:uint = 39;
9 |
10 | public var frameCount:uint;
11 |
12 | protected var _characterId:uint;
13 |
14 | public function TagDefineSprite() {}
15 |
16 | public function get characterId():uint { return _characterId; }
17 | public function set characterId(value:uint):void { _characterId = value; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | _characterId = data.readUI16();
21 | frameCount = data.readUI16();
22 | /*
23 | if(async) {
24 | parseTagsAsync(data, version);
25 | } else {
26 | parseTags(data, version);
27 | }
28 | */
29 | parseTags(data, version);
30 | }
31 |
32 | public function publish(data:SWFData, version:uint):void {
33 | var body:SWFData = new SWFData();
34 | body.writeUI16(characterId);
35 | body.writeUI16(frameCount); // TODO: get the real number of frames from controlTags
36 | publishTags(body, version);
37 | data.writeTagHeader(type, body.length);
38 | data.writeBytes(body);
39 | }
40 |
41 | public function clone():IDefinitionTag {
42 | var tag:TagDefineSprite = new TagDefineSprite();
43 | throw(new Error("Not implemented yet."));
44 | return tag;
45 | }
46 |
47 | public function get type():uint { return TYPE; }
48 | public function get name():String { return "DefineSprite"; }
49 | public function get version():uint { return 3; }
50 | public function get level():uint { return 1; }
51 |
52 | override public function toString(indent:uint = 0, flags:uint = 0):String {
53 | return Tag.toStringCommon(type, name, indent) +
54 | "ID: " + characterId + ", " +
55 | "FrameCount: " + frameCount +
56 | super.toString(indent);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDefineText2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.utils.StringUtils;
4 |
5 | public class TagDefineText2 extends TagDefineText implements IDefinitionTag
6 | {
7 | public static const TYPE:uint = 33;
8 |
9 | public function TagDefineText2() {}
10 |
11 | override public function get type():uint { return TYPE; }
12 | override public function get name():String { return "DefineText2"; }
13 | override public function get version():uint { return 3; }
14 | override public function get level():uint { return 2; }
15 |
16 | override public function toString(indent:uint = 0, flags:uint = 0):String {
17 | var str:String = Tag.toStringCommon(type, name, indent) +
18 | "ID: " + characterId + ", " +
19 | "Bounds: " + textBounds + ", " +
20 | "Matrix: " + textMatrix;
21 | if (_records.length > 0) {
22 | str += "\n" + StringUtils.repeat(indent + 2) + "TextRecords:";
23 | for (var i:uint = 0; i < _records.length; i++) {
24 | str += "\n" + StringUtils.repeat(indent + 4) + "[" + i + "] " + _records[i].toString();
25 | }
26 | }
27 | return str;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagDoABCDeprecated.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagDoABCDeprecated implements ITag
8 | {
9 | public static const TYPE:uint = 72;
10 |
11 | protected var _bytes:ByteArray;
12 |
13 | public function TagDoABCDeprecated() {
14 | _bytes = new ByteArray();
15 | }
16 |
17 | public static function create(abcData:ByteArray = null):TagDoABCDeprecated {
18 | var doABC:TagDoABCDeprecated = new TagDoABCDeprecated();
19 | if (abcData != null && abcData.length > 0) {
20 | doABC.bytes.writeBytes(abcData);
21 | }
22 | return doABC;
23 | }
24 |
25 | public function get bytes():ByteArray { return _bytes; }
26 |
27 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
28 | var pos:uint = data.position;
29 | data.readBytes(bytes, 0, length - (data.position - pos));
30 | }
31 |
32 | public function publish(data:SWFData, version:uint):void {
33 | var body:SWFData = new SWFData();
34 | if (_bytes.length > 0) {
35 | body.writeBytes(_bytes);
36 | }
37 | data.writeTagHeader(type, body.length);
38 | data.writeBytes(body);
39 | }
40 |
41 | public function get type():uint { return TYPE; }
42 | public function get name():String { return "DoABCDeprecated"; }
43 | public function get version():uint { return 9; }
44 | public function get level():uint { return 1; }
45 |
46 | public function toString(indent:uint = 0, flags:uint = 0):String {
47 | return Tag.toStringCommon(type, name, indent) +
48 | "Length: " + _bytes.length;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagEnableDebugger.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagEnableDebugger implements ITag
8 | {
9 | public static const TYPE:uint = 58;
10 |
11 | protected var _password:ByteArray;
12 |
13 | public function TagEnableDebugger() {
14 | _password = new ByteArray();
15 | }
16 |
17 | public function get password():ByteArray { return _password; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | if (length > 0) {
21 | data.readBytes(_password, 0, length);
22 | }
23 | }
24 |
25 | public function publish(data:SWFData, version:uint):void {
26 | data.writeTagHeader(type, _password.length);
27 | if (_password.length > 0) {
28 | data.writeBytes(_password);
29 | }
30 | }
31 |
32 | public function get type():uint { return TYPE; }
33 | public function get name():String { return "EnableDebugger"; }
34 | public function get version():uint { return 5; }
35 | public function get level():uint { return 1; }
36 |
37 | public function toString(indent:uint = 0, flags:uint = 0):String {
38 | return Tag.toStringCommon(type, name, indent);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagEnableDebugger2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagEnableDebugger2 extends TagEnableDebugger implements ITag
8 | {
9 | public static const TYPE:uint = 64;
10 |
11 | // Reserved, SWF File Format v10 says this is always zero.
12 | // Observed other values from generated SWFs, e.g. 0x1975.
13 | protected var _reserved:uint = 0;
14 |
15 | public function TagEnableDebugger2() {
16 | super();
17 | }
18 |
19 | public function get reserved():uint { return _reserved; }
20 |
21 | override public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
22 | _reserved = data.readUI16();
23 | if (length > 2) {
24 | data.readBytes(_password, 0, length - 2);
25 | }
26 | }
27 |
28 | override public function publish(data:SWFData, version:uint):void {
29 | data.writeTagHeader(type, _password.length + 2);
30 | data.writeUI16(_reserved);
31 | if (_password.length > 0) {
32 | data.writeBytes(_password);
33 | }
34 | }
35 |
36 | override public function get type():uint { return TYPE; }
37 | override public function get name():String { return "EnableDebugger2"; }
38 | override public function get version():uint { return 6; }
39 | override public function get level():uint { return 2; }
40 |
41 | override public function toString(indent:uint = 0, flags:uint = 0):String {
42 | return Tag.toStringCommon(type, name, indent) +
43 | "Password: " + (_password.length ? 'null' : _password.readUTF()) + ", " +
44 | "Reserved: 0x" + _reserved.toString(16);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagEnableTelemetry.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagEnableTelemetry implements ITag
8 | {
9 | public static const TYPE:uint = 93;
10 |
11 | protected var _password:ByteArray;
12 |
13 | public function TagEnableTelemetry() {
14 | _password = new ByteArray();
15 | }
16 |
17 | public function get password():ByteArray { return _password; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | if (length > 2) {
21 | data.readByte();
22 | data.readByte();
23 | data.readBytes(_password, 0, length - 2);
24 | }
25 | }
26 |
27 | public function publish(data:SWFData, version:uint):void {
28 | data.writeTagHeader(type, _password.length + 2);
29 | data.writeByte(0);
30 | data.writeByte(0);
31 | if (_password.length > 0) {
32 | data.writeBytes(_password);
33 | }
34 | }
35 |
36 | public function get type():uint { return TYPE; }
37 | public function get name():String { return "EnableTelemetry"; }
38 | public function get version():uint { return 19; }
39 | public function get level():uint { return 1; }
40 |
41 | public function toString(indent:uint = 0, flags:uint = 0):String {
42 | return Tag.toStringCommon(type, name, indent);
43 | }
44 |
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagEnd.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagEnd implements ITag
6 | {
7 | public static const TYPE:uint = 0;
8 |
9 | public function TagEnd() {}
10 |
11 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
12 | // Do nothing. The End tag has no body.
13 | }
14 |
15 | public function publish(data:SWFData, version:uint):void {
16 | data.writeTagHeader(type, 0);
17 | }
18 |
19 | public function get type():uint { return TYPE; }
20 | public function get name():String { return "End"; }
21 | public function get version():uint { return 1; }
22 | public function get level():uint { return 1; }
23 |
24 | public function toString(indent:uint = 0, flags:uint = 0):String {
25 | return Tag.toStringCommon(type, name, indent);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagExportAssets.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFSymbol;
5 | import com.codeazur.utils.StringUtils;
6 |
7 | public class TagExportAssets implements ITag
8 | {
9 | public static const TYPE:uint = 56;
10 |
11 | protected var _symbols:Vector.;
12 |
13 | public function TagExportAssets() {
14 | _symbols = new Vector.();
15 | }
16 |
17 | public function get symbols():Vector. { return _symbols; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | var numSymbols:uint = data.readUI16();
21 | for (var i:uint = 0; i < numSymbols; i++) {
22 | _symbols.push(data.readSYMBOL());
23 | }
24 | }
25 |
26 | public function publish(data:SWFData, version:uint):void {
27 | var body:SWFData = new SWFData();
28 | var numSymbols:uint = _symbols.length;
29 | body.writeUI16(numSymbols);
30 | for (var i:uint = 0; i < numSymbols; i++) {
31 | body.writeSYMBOL(_symbols[i]);
32 | }
33 | data.writeTagHeader(type, body.length);
34 | data.writeBytes(body);
35 | }
36 |
37 | public function get type():uint { return TYPE; }
38 | public function get name():String { return "ExportAssets"; }
39 | public function get version():uint { return 5; }
40 | public function get level():uint { return 1; }
41 |
42 | public function toString(indent:uint = 0, flags:uint = 0):String {
43 | var str:String = Tag.toStringCommon(type, name, indent);
44 | if (_symbols.length > 0) {
45 | str += "\n" + StringUtils.repeat(indent + 2) + "Assets:";
46 | for (var i:uint = 0; i < _symbols.length; i++) {
47 | str += "\n" + StringUtils.repeat(indent + 4) + "[" + i + "] " + _symbols[i].toString();
48 | }
49 | }
50 | return str;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagFileAttributes.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagFileAttributes implements ITag
6 | {
7 | public static const TYPE:uint = 69;
8 |
9 | public var useDirectBlit:Boolean = false;
10 | public var useGPU:Boolean = false;
11 | public var hasMetadata:Boolean = false;
12 | public var actionscript3:Boolean = true;
13 | public var useNetwork:Boolean = false;
14 |
15 | public function TagFileAttributes() {}
16 |
17 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
18 | var flags:uint = data.readUI8();
19 | useDirectBlit = ((flags & 0x40) != 0);
20 | useGPU = ((flags & 0x20) != 0);
21 | hasMetadata = ((flags & 0x10) != 0);
22 | actionscript3 = ((flags & 0x08) != 0);
23 | useNetwork = ((flags & 0x01) != 0);
24 | data.skipBytes(3);
25 | }
26 |
27 | public function publish(data:SWFData, version:uint):void {
28 | data.writeTagHeader(type, 4);
29 | var flags:uint = 0;
30 | if (useNetwork) { flags |= 0x01; }
31 | if (actionscript3) { flags |= 0x08; }
32 | if (hasMetadata) { flags |= 0x10; }
33 | if (useGPU) { flags |= 0x20; }
34 | if (useDirectBlit) { flags |= 0x40; }
35 | data.writeUI8(flags);
36 | data.writeUI8(0);
37 | data.writeUI8(0);
38 | data.writeUI8(0);
39 | }
40 |
41 | public function get type():uint { return TYPE; }
42 | public function get name():String { return "FileAttributes"; }
43 | public function get version():uint { return 8; }
44 | public function get level():uint { return 1; }
45 |
46 | public function toString(indent:uint = 0, flags:uint = 0):String {
47 | return Tag.toStringCommon(type, name, indent) +
48 | "AS3: " + actionscript3 + ", " +
49 | "HasMetadata: " + hasMetadata + ", " +
50 | "UseDirectBlit: " + useDirectBlit + ", " +
51 | "UseGPU: " + useGPU + ", " +
52 | "UseNetwork: " + useNetwork;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagFrameLabel.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagFrameLabel implements ITag
6 | {
7 | public static const TYPE:uint = 43;
8 |
9 | public var frameName:String;
10 | public var namedAnchorFlag:Boolean;
11 |
12 | public function TagFrameLabel() {}
13 |
14 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
15 | var start:uint = data.position;
16 | frameName = data.readString();
17 | if ((data.position - start) < length) {
18 | data.readUI8(); // Named anchor flag, always 1
19 | namedAnchorFlag = true;
20 | }
21 | }
22 |
23 | public function publish(data:SWFData, version:uint):void {
24 | var body:SWFData = new SWFData();
25 | body.writeString(frameName);
26 |
27 | if (namedAnchorFlag) {
28 | data.writeUI8(1);
29 | }
30 |
31 | data.writeTagHeader(type, body.length);
32 | data.writeBytes(body);
33 | }
34 |
35 | public function get type():uint { return TYPE; }
36 | public function get name():String { return "FrameLabel"; }
37 | public function get version():uint { return 3; }
38 | public function get level():uint { return 1; }
39 |
40 | public function toString(indent:uint = 0, flags:uint = 0):String {
41 | var str:String = "Name: " + frameName;
42 | if (namedAnchorFlag) {
43 | str += ", NamedAnchor = true";
44 | }
45 | return Tag.toStringCommon(type, name, indent) + str;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagImportAssets.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFSymbol;
5 | import com.codeazur.utils.StringUtils;
6 |
7 | public class TagImportAssets implements ITag
8 | {
9 | public static const TYPE:uint = 57;
10 |
11 | public var url:String;
12 |
13 | protected var _symbols:Vector.;
14 |
15 | public function TagImportAssets() {
16 | _symbols = new Vector.();
17 | }
18 |
19 | public function get symbols():Vector. { return _symbols; }
20 |
21 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
22 | url = data.readString();
23 | var numSymbols:uint = data.readUI16();
24 | for (var i:uint = 0; i < numSymbols; i++) {
25 | _symbols.push(data.readSYMBOL());
26 | }
27 | }
28 |
29 | public function publish(data:SWFData, version:uint):void {
30 | var body:SWFData = new SWFData();
31 | body.writeString(url);
32 | var numSymbols:uint = _symbols.length;
33 | body.writeUI16(numSymbols);
34 | for (var i:uint = 0; i < numSymbols; i++) {
35 | body.writeSYMBOL(_symbols[i]);
36 | }
37 | data.writeTagHeader(type, body.length);
38 | data.writeBytes(body);
39 | }
40 |
41 | public function get type():uint { return TYPE; }
42 | public function get name():String { return "ImportAssets"; }
43 | public function get version():uint { return 5; }
44 | public function get level():uint { return 1; }
45 |
46 | public function toString(indent:uint = 0, flags:uint = 0):String {
47 | var str:String = Tag.toStringCommon(type, name, indent);
48 | if (_symbols.length > 0) {
49 | str += "\n" + StringUtils.repeat(indent + 2) + "Assets:";
50 | for (var i:uint = 0; i < _symbols.length; i++) {
51 | str += "\n" + StringUtils.repeat(indent + 4) + "[" + i + "] " + _symbols[i].toString();
52 | }
53 | }
54 | return str;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagImportAssets2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagImportAssets2 extends TagImportAssets implements ITag
6 | {
7 | public static const TYPE:uint = 71;
8 |
9 | public function TagImportAssets2() {}
10 |
11 | override public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
12 | url = data.readString();
13 | data.readUI8(); // reserved, always 1
14 | data.readUI8(); // reserved, always 0
15 | var numSymbols:uint = data.readUI16();
16 | for (var i:uint = 0; i < numSymbols; i++) {
17 | _symbols.push(data.readSYMBOL());
18 | }
19 | }
20 |
21 | override public function publish(data:SWFData, version:uint):void {
22 | var body:SWFData = new SWFData();
23 | body.writeString(url);
24 | body.writeUI8(1);
25 | body.writeUI8(0);
26 | var numSymbols:uint = _symbols.length;
27 | body.writeUI16(numSymbols);
28 | for (var i:uint = 0; i < numSymbols; i++) {
29 | body.writeSYMBOL(_symbols[i]);
30 | }
31 | data.writeTagHeader(type, body.length);
32 | data.writeBytes(body);
33 | }
34 |
35 | override public function get type():uint { return TYPE; }
36 | override public function get name():String { return "ImportAssets2"; }
37 | override public function get version():uint { return 8; }
38 | override public function get level():uint { return 2; }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagJPEGTables.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagJPEGTables implements ITag
8 | {
9 | public static const TYPE:uint = 8;
10 |
11 | protected var _jpegTables:ByteArray;
12 |
13 | public function TagJPEGTables() {
14 | _jpegTables = new ByteArray();
15 | }
16 |
17 | public function get jpegTables():ByteArray { return _jpegTables; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | if(length > 0) {
21 | data.readBytes(_jpegTables, 0, length);
22 | }
23 | }
24 |
25 | public function publish(data:SWFData, version:uint):void {
26 | data.writeTagHeader(type, _jpegTables.length);
27 | if (jpegTables.length > 0) {
28 | data.writeBytes(jpegTables);
29 | }
30 | }
31 |
32 | public function get type():uint { return TYPE; }
33 | public function get name():String { return "JPEGTables"; }
34 | public function get version():uint { return 1; }
35 | public function get level():uint { return 1; }
36 |
37 | public function toString(indent:uint = 0, flags:uint = 0):String {
38 | return Tag.toStringCommon(type, name, indent) + "Length: " + _jpegTables.length;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagMetadata.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagMetadata implements ITag
6 | {
7 | public static const TYPE:uint = 77;
8 |
9 | public var xmlString:String;
10 |
11 | public function TagMetadata() {}
12 |
13 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
14 | xmlString = data.readString();
15 | }
16 |
17 | public function publish(data:SWFData, version:uint):void {
18 | var body:SWFData = new SWFData();
19 | body.writeString(xmlString);
20 | data.writeTagHeader(type, body.length);
21 | data.writeBytes(body);
22 | }
23 |
24 | public function get type():uint { return TYPE; }
25 | public function get name():String { return "Metadata"; }
26 | public function get version():uint { return 1; }
27 | public function get level():uint { return 1; }
28 |
29 | public function toString(indent:uint = 0, flags:uint = 0):String {
30 | var str:String = Tag.toStringCommon(type, name, indent)
31 | var xml:XML;
32 | try {
33 | xml = new XML(xmlString);
34 | str += " " + xml.toXMLString();
35 | } catch(error:Error) {
36 | str += " " + xmlString;
37 | }
38 | return str;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagPlaceObject4.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.utils.StringUtils;
5 |
6 | /**
7 | * PlaceObject4 is essentially identical to PlaceObject3 except it has a different
8 | * swf tag value of course (94 instead of 70) and at the end of the tag, if there are
9 | * additional bytes, those bytes will be interpreted as AMF binary data that will be
10 | * used as the metadata attached to the instance.
11 | *
12 | * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#metaData
13 | */
14 | public class TagPlaceObject4 extends TagPlaceObject3 implements IDisplayListTag
15 | {
16 | public static const TYPE:uint = 94;
17 |
18 | public function TagPlaceObject4() {}
19 |
20 | override public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
21 | super.parse(data, length, version, async);
22 | if (data.bytesAvailable > 0) {
23 | metaData = data.readObject();
24 | }
25 | }
26 |
27 | override public function publish(data:SWFData, version:uint):void {
28 | var body:SWFData = prepareBody();
29 |
30 | if (metaData != null) {
31 | body.writeObject(metaData);
32 | }
33 |
34 | data.writeTagHeader(type, body.length);
35 | data.writeBytes(body);
36 | }
37 |
38 | override public function get type():uint { return TYPE; }
39 | override public function get name():String { return "PlaceObject4"; }
40 | override public function get version():uint { return 19; }
41 | override public function get level():uint { return 4; }
42 |
43 | override public function toString(indent:uint = 0, flags:uint = 0):String {
44 | var str:String = super.toString(indent);
45 | if (metaData != null) {
46 | str += "\n" + StringUtils.repeat(indent + 2) + "MetaData: yes";
47 | }
48 | return str;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagProtect.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagProtect implements ITag
8 | {
9 | public static const TYPE:uint = 24;
10 |
11 | protected var _password:ByteArray;
12 |
13 | public function TagProtect() {
14 | _password = new ByteArray();
15 | }
16 |
17 | public function get password():ByteArray { return _password; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | if (length > 0) {
21 | data.readBytes(_password, 0, length);
22 | }
23 | }
24 |
25 | public function publish(data:SWFData, version:uint):void {
26 | data.writeTagHeader(type, _password.length);
27 | if (_password.length > 0) {
28 | data.writeBytes(_password);
29 | }
30 | }
31 |
32 | public function get type():uint { return TYPE; }
33 | public function get name():String { return "Protect"; }
34 | public function get version():uint { return 2; }
35 | public function get level():uint { return 1; }
36 |
37 | public function toString(indent:uint = 0, flags:uint = 0):String {
38 | return Tag.toStringCommon(type, name, indent);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagRemoveObject.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagRemoveObject implements IDisplayListTag
6 | {
7 | public static const TYPE:uint = 5;
8 |
9 | public var characterId:uint = 0;
10 | public var depth:uint;
11 |
12 | public function TagRemoveObject() {}
13 |
14 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
15 | characterId = data.readUI16();
16 | depth = data.readUI16();
17 | }
18 |
19 | public function publish(data:SWFData, version:uint):void {
20 | data.writeTagHeader(type, 4);
21 | data.writeUI16(characterId);
22 | data.writeUI16(depth);
23 | }
24 |
25 | public function get type():uint { return TYPE; }
26 | public function get name():String { return "RemoveObject"; }
27 | public function get version():uint { return 1; }
28 | public function get level():uint { return 1; }
29 |
30 | public function toString(indent:uint = 0, flags:uint = 0):String {
31 | return Tag.toStringCommon(type, name, indent) +
32 | "CharacterID: " + characterId + ", " +
33 | "Depth: " + depth;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagRemoveObject2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagRemoveObject2 extends TagRemoveObject implements IDisplayListTag
6 | {
7 | public static const TYPE:uint = 28;
8 |
9 | public function TagRemoveObject2() {}
10 |
11 | override public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
12 | depth = data.readUI16();
13 | }
14 |
15 | override public function publish(data:SWFData, version:uint):void {
16 | data.writeTagHeader(type, 2);
17 | data.writeUI16(depth);
18 | }
19 |
20 | override public function get type():uint { return TYPE; }
21 | override public function get name():String { return "RemoveObject2"; }
22 | override public function get version():uint { return 3; }
23 | override public function get level():uint { return 2; }
24 |
25 | override public function toString(indent:uint = 0, flags:uint = 0):String {
26 | return Tag.toStringCommon(type, name, indent) +
27 | "Depth: " + depth;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagScriptLimits.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagScriptLimits implements ITag
6 | {
7 | public static const TYPE:uint = 65;
8 |
9 | public var maxRecursionDepth:uint;
10 | public var scriptTimeoutSeconds:uint;
11 |
12 | public function TagScriptLimits() {}
13 |
14 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
15 | maxRecursionDepth = data.readUI16();
16 | scriptTimeoutSeconds = data.readUI16();
17 | }
18 |
19 | public function publish(data:SWFData, version:uint):void {
20 | data.writeTagHeader(type, 4);
21 | data.writeUI16(maxRecursionDepth);
22 | data.writeUI16(scriptTimeoutSeconds);
23 | }
24 |
25 | public function get type():uint { return TYPE; }
26 | public function get name():String { return "ScriptLimits"; }
27 | public function get version():uint { return 7; }
28 | public function get level():uint { return 1; }
29 |
30 | public function toString(indent:uint = 0, flags:uint = 0):String {
31 | return Tag.toStringCommon(type, name, indent) +
32 | "MaxRecursionDepth: " + maxRecursionDepth + ", " +
33 | "ScriptTimeoutSeconds: " + scriptTimeoutSeconds;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagSetBackgroundColor.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.utils.ColorUtils;
5 |
6 | public class TagSetBackgroundColor implements ITag
7 | {
8 | public static const TYPE:uint = 9;
9 |
10 | public var color:uint = 0xffffff;
11 |
12 | public function TagSetBackgroundColor() {}
13 |
14 | public static function create(aColor:uint = 0xffffff):TagSetBackgroundColor {
15 | var setBackgroundColor:TagSetBackgroundColor = new TagSetBackgroundColor();
16 | setBackgroundColor.color = aColor;
17 | return setBackgroundColor;
18 | }
19 |
20 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
21 | color = data.readRGB();
22 | }
23 |
24 | public function publish(data:SWFData, version:uint):void {
25 | data.writeTagHeader(type, 3);
26 | data.writeRGB(color);
27 | }
28 |
29 | public function get type():uint { return TYPE; }
30 | public function get name():String { return "SetBackgroundColor"; }
31 | public function get version():uint { return 1; }
32 | public function get level():uint { return 1; }
33 |
34 | public function toString(indent:uint = 0, flags:uint = 0):String {
35 | return Tag.toStringCommon(type, name, indent) + "Color: " + ColorUtils.rgbToString(color);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagSetTabIndex.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagSetTabIndex implements ITag
6 | {
7 | public static const TYPE:uint = 66;
8 |
9 | public var depth:uint;
10 | public var tabIndex:uint;
11 |
12 | public function TagSetTabIndex() {}
13 |
14 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
15 | depth = data.readUI16();
16 | tabIndex = data.readUI16();
17 | }
18 |
19 | public function publish(data:SWFData, version:uint):void {
20 | data.writeTagHeader(type, 4);
21 | data.writeUI16(depth);
22 | data.writeUI16(tabIndex);
23 | }
24 |
25 | public function get type():uint { return TYPE; }
26 | public function get name():String { return "SetTabIndex"; }
27 | public function get version():uint { return 7; }
28 | public function get level():uint { return 1; }
29 |
30 | public function toString(indent:uint = 0, flags:uint = 0):String {
31 | return Tag.toStringCommon(type, name, indent) +
32 | "Depth: " + depth + ", " +
33 | "TabIndex: " + tabIndex;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagShowFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagShowFrame implements IDisplayListTag
6 | {
7 | public static const TYPE:uint = 1;
8 |
9 | public function TagShowFrame() {}
10 |
11 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
12 | // Do nothing. The End tag has no body.
13 | }
14 |
15 | public function publish(data:SWFData, version:uint):void {
16 | data.writeTagHeader(type, 0);
17 | }
18 |
19 | public function get type():uint { return TYPE; }
20 | public function get name():String { return "ShowFrame"; }
21 | public function get version():uint { return 1; }
22 | public function get level():uint { return 1; }
23 |
24 | public function toString(indent:uint = 0, flags:uint = 0):String {
25 | return Tag.toStringCommon(type, name, indent);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagSoundStreamBlock.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagSoundStreamBlock implements ITag
8 | {
9 | public static const TYPE:uint = 19;
10 |
11 | protected var _soundData:ByteArray;
12 |
13 | public function TagSoundStreamBlock() {
14 | _soundData = new ByteArray();
15 | }
16 |
17 | public function get soundData():ByteArray { return _soundData; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | data.readBytes(_soundData, 0, length);
21 | }
22 |
23 | public function publish(data:SWFData, version:uint):void {
24 | data.writeTagHeader(type, _soundData.length, true);
25 | if (_soundData.length > 0) {
26 | data.writeBytes(_soundData);
27 | }
28 | }
29 |
30 | public function get type():uint { return TYPE; }
31 | public function get name():String { return "SoundStreamBlock"; }
32 | public function get version():uint { return 1; }
33 | public function get level():uint { return 1; }
34 |
35 | public function toString(indent:uint = 0, flags:uint = 0):String {
36 | return Tag.toStringCommon(type, name, indent) + "Length: " + _soundData.length;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagSoundStreamHead2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.data.consts.SoundRate;
4 | import com.codeazur.as3swf.data.consts.SoundSize;
5 | import com.codeazur.as3swf.data.consts.SoundType;
6 | import com.codeazur.as3swf.data.consts.SoundCompression;
7 |
8 | public class TagSoundStreamHead2 extends TagSoundStreamHead implements ITag
9 | {
10 | public static const TYPE:uint = 45;
11 |
12 | public function TagSoundStreamHead2() {}
13 |
14 | override public function get type():uint { return TYPE; }
15 | override public function get name():String { return "SoundStreamHead2"; }
16 | override public function get version():uint { return 3; }
17 | override public function get level():uint { return 2; }
18 |
19 | override public function toString(indent:uint = 0, flags:uint = 0):String {
20 | var str:String = Tag.toStringCommon(type, name, indent);
21 | if(streamSoundSampleCount > 0) {
22 | str += "Format: " + SoundCompression.toString(streamSoundCompression) + ", " +
23 | "Rate: " + SoundRate.toString(streamSoundRate) + ", " +
24 | "Size: " + SoundSize.toString(streamSoundSize) + ", " +
25 | "Type: " + SoundType.toString(streamSoundType) + ", ";
26 | }
27 | str += "Samples: " + streamSoundSampleCount;
28 | return str;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagStartSound.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFSoundInfo;
5 |
6 | public class TagStartSound implements ITag
7 | {
8 | public static const TYPE:uint = 15;
9 |
10 | public var soundId:uint;
11 | public var soundInfo:SWFSoundInfo;
12 |
13 | public function TagStartSound() {}
14 |
15 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
16 | soundId = data.readUI16();
17 | soundInfo = data.readSOUNDINFO();
18 | }
19 |
20 | public function publish(data:SWFData, version:uint):void {
21 | var body:SWFData = new SWFData();
22 | body.writeUI16(soundId);
23 | body.writeSOUNDINFO(soundInfo);
24 | data.writeTagHeader(type, body.length);
25 | data.writeBytes(body);
26 | }
27 |
28 | public function get type():uint { return TYPE; }
29 | public function get name():String { return "StartSound"; }
30 | public function get version():uint { return 1; }
31 | public function get level():uint { return 1; }
32 |
33 | public function toString(indent:uint = 0, flags:uint = 0):String {
34 | var str:String = Tag.toStringCommon(type, name, indent) +
35 | "SoundID: " + soundId + ", " +
36 | "SoundInfo: " + soundInfo;
37 | return str;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagStartSound2.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFSoundInfo;
5 |
6 | public class TagStartSound2 implements ITag
7 | {
8 | public static const TYPE:uint = 89;
9 |
10 | public var soundClassName:String;
11 | public var soundInfo:SWFSoundInfo;
12 |
13 | public function TagStartSound2() {}
14 |
15 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
16 | soundClassName = data.readString();
17 | soundInfo = data.readSOUNDINFO();
18 | }
19 |
20 | public function publish(data:SWFData, version:uint):void {
21 | var body:SWFData = new SWFData();
22 | body.writeString(soundClassName);
23 | body.writeSOUNDINFO(soundInfo);
24 | data.writeTagHeader(type, body.length);
25 | data.writeBytes(body);
26 | }
27 |
28 | public function get type():uint { return TYPE; }
29 | public function get name():String { return "StartSound2"; }
30 | public function get version():uint { return 9; }
31 | public function get level():uint { return 2; }
32 |
33 | public function toString(indent:uint = 0, flags:uint = 0):String {
34 | var str:String = Tag.toStringCommon(type, name, indent) +
35 | "SoundClassName: " + soundClassName + ", " +
36 | "SoundInfo: " + soundInfo;
37 | return str;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagSymbolClass.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 | import com.codeazur.as3swf.data.SWFSymbol;
5 | import com.codeazur.utils.StringUtils;
6 |
7 | public class TagSymbolClass implements ITag
8 | {
9 | public static const TYPE:uint = 76;
10 |
11 | protected var _symbols:Vector.;
12 |
13 | public function TagSymbolClass() {
14 | _symbols = new Vector.();
15 | }
16 |
17 | public function get symbols():Vector. { return _symbols; }
18 |
19 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
20 | var numSymbols:uint = data.readUI16();
21 | for (var i:uint = 0; i < numSymbols; i++) {
22 | _symbols.push(data.readSYMBOL());
23 | }
24 | }
25 |
26 | public function publish(data:SWFData, version:uint):void {
27 | var body:SWFData = new SWFData();
28 | var numSymbols:uint = _symbols.length;
29 | body.writeUI16(numSymbols);
30 | for (var i:uint = 0; i < numSymbols; i++) {
31 | body.writeSYMBOL(_symbols[i]);
32 | }
33 | data.writeTagHeader(type, body.length);
34 | data.writeBytes(body);
35 | }
36 |
37 | public function get type():uint { return TYPE; }
38 | public function get name():String { return "SymbolClass"; }
39 | public function get version():uint { return 9; } // educated guess (not specified in SWF10 spec)
40 | public function get level():uint { return 1; }
41 |
42 | public function toString(indent:uint = 0, flags:uint = 0):String {
43 | var str:String = Tag.toStringCommon(type, name, indent);
44 | if (_symbols.length > 0) {
45 | str += "\n" + StringUtils.repeat(indent + 2) + "Symbols:";
46 | for (var i:uint = 0; i < _symbols.length; i++) {
47 | str += "\n" + StringUtils.repeat(indent + 4) + "[" + i + "] " + _symbols[i].toString();
48 | }
49 | }
50 | return str;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagUnknown.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | public class TagUnknown implements ITag
6 | {
7 | protected var _type:uint;
8 |
9 | public function TagUnknown(type:uint = 0) {
10 | _type = type;
11 | }
12 |
13 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
14 | data.skipBytes(length);
15 | }
16 |
17 | public function publish(data:SWFData, version:uint):void {
18 | throw(new Error("No raw tag data available."));
19 | }
20 |
21 | public function get type():uint { return _type; }
22 | public function get name():String { return "????"; }
23 | public function get version():uint { return 0; }
24 | public function get level():uint { return 1; }
25 |
26 | public function toString(indent:uint = 0, flags:uint = 0):String {
27 | return Tag.toStringCommon(type, name, indent);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/TagVideoFrame.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags
2 | {
3 | import com.codeazur.as3swf.SWFData;
4 |
5 | import flash.utils.ByteArray;
6 |
7 | public class TagVideoFrame implements ITag
8 | {
9 | public static const TYPE:uint = 61;
10 |
11 | public var streamId:uint;
12 | public var frameNum:uint;
13 |
14 | protected var _videoData:ByteArray;
15 |
16 | public function TagVideoFrame() {
17 | _videoData = new ByteArray();
18 | }
19 |
20 | public function get videoData():ByteArray { return _videoData; }
21 |
22 | public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false):void {
23 | streamId = data.readUI16();
24 | frameNum = data.readUI16();
25 | data.readBytes(_videoData, 0, length - 4);
26 | }
27 |
28 | public function publish(data:SWFData, version:uint):void {
29 | data.writeTagHeader(type, _videoData.length + 4);
30 | data.writeUI16(streamId);
31 | data.writeUI16(frameNum);
32 | if (_videoData.length > 0) {
33 | data.writeBytes(_videoData);
34 | }
35 | }
36 |
37 | public function get type():uint { return TYPE; }
38 | public function get name():String { return "VideoFrame"; }
39 | public function get version():uint { return 6; }
40 | public function get level():uint { return 1; }
41 |
42 | public function toString(indent:uint = 0, flags:uint = 0):String {
43 | return Tag.toStringCommon(type, name, indent) +
44 | "StreamID: " + streamId + ", " +
45 | "Frame: " + frameNum;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/etc/TagSWFEncryptActions.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags.etc
2 | {
3 | import com.codeazur.as3swf.tags.ITag;
4 | import com.codeazur.as3swf.tags.TagUnknown;
5 |
6 | public class TagSWFEncryptActions extends TagUnknown implements ITag
7 | {
8 | public static const TYPE:uint = 253;
9 |
10 | public function TagSWFEncryptActions(type:uint = 0) {}
11 |
12 | override public function get type():uint { return TYPE; }
13 | override public function get name():String { return "SWFEncryptActions"; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/tags/etc/TagSWFEncryptSignature.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.tags.etc
2 | {
3 | import com.codeazur.as3swf.tags.ITag;
4 | import com.codeazur.as3swf.tags.TagUnknown;
5 |
6 | public class TagSWFEncryptSignature extends TagUnknown implements ITag
7 | {
8 | public static const TYPE:uint = 255;
9 |
10 | public function TagSWFEncryptSignature(type:uint = 0) {}
11 |
12 | override public function get type():uint { return TYPE; }
13 | override public function get name():String { return "SWFEncryptSignature"; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/timeline/FrameObject.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.timeline
2 | {
3 | import com.codeazur.utils.StringUtils;
4 |
5 | public class FrameObject
6 | {
7 | // The depth of this display object
8 | public var depth:uint;
9 | // The character id of this display object
10 | public var characterId:uint;
11 | // The class name of this display object
12 | public var className:String;
13 | // The tag index of the PlaceObject tag that placed this object on the display list
14 | public var placedAtIndex:uint;
15 | // The tag index of the PlaceObject tag that modified this object (optional)
16 | public var lastModifiedAtIndex:uint;
17 |
18 | // Whether this is a keyframe or not
19 | public var isKeyframe:Boolean;
20 |
21 | // The index of the layer this object resides on
22 | public var layer:int = -1;
23 |
24 | public function FrameObject(depth:uint, characterId:uint, className:String, placedAtIndex:uint, lastModifiedAtIndex:uint = 0, isKeyframe:Boolean = false)
25 | {
26 | this.depth = depth;
27 | this.characterId = characterId;
28 | this.className = className;
29 | this.placedAtIndex = placedAtIndex;
30 | this.lastModifiedAtIndex = lastModifiedAtIndex;
31 | this.isKeyframe = isKeyframe;
32 | this.layer = -1;
33 | }
34 |
35 | public function clone():FrameObject {
36 | return new FrameObject(depth, characterId, className, placedAtIndex, lastModifiedAtIndex, false);
37 | }
38 |
39 | public function toString(indent:uint = 0):String {
40 | var str:String = "\n" + StringUtils.repeat(indent + 2) +
41 | "Depth: " + depth + (layer > -1 ? " (Layer " + layer + ")" : "") + ", " +
42 | "CharacterId: " + characterId + ", ";
43 | if(className != null) {
44 | str += "ClassName: " + className + ", ";
45 | }
46 | str += "PlacedAt: " + placedAtIndex;
47 | if(lastModifiedAtIndex) {
48 | str += ", LastModifiedAt: " + lastModifiedAtIndex;
49 | }
50 | if(isKeyframe) {
51 | str += ", IsKeyframe";
52 | }
53 | return str;
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/timeline/LayerStrip.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.timeline
2 | {
3 | public class LayerStrip
4 | {
5 | public static const TYPE_EMPTY:uint = 0;
6 | public static const TYPE_SPACER:uint = 1;
7 | public static const TYPE_STATIC:uint = 2;
8 | public static const TYPE_MOTIONTWEEN:uint = 3;
9 | public static const TYPE_SHAPETWEEN:uint = 4;
10 |
11 | public var type:uint = TYPE_EMPTY;
12 | public var startFrameIndex:uint = 0;
13 | public var endFrameIndex:uint = 0;
14 |
15 | public function LayerStrip(type:uint, startFrameIndex:uint, endFrameIndex:uint)
16 | {
17 | this.type = type;
18 | this.startFrameIndex = startFrameIndex;
19 | this.endFrameIndex = endFrameIndex;
20 | }
21 |
22 | public function toString():String {
23 | var str:String;
24 | if(startFrameIndex == endFrameIndex) {
25 | str = "Frame: " + startFrameIndex;
26 | } else {
27 | str = "Frames: " + startFrameIndex + "-" + endFrameIndex;
28 | }
29 | str += ", Type: ";
30 | switch(type) {
31 | case TYPE_EMPTY: str += "EMPTY"; break;
32 | case TYPE_SPACER: str += "SPACER"; break;
33 | case TYPE_STATIC: str += "STATIC"; break;
34 | case TYPE_MOTIONTWEEN: str += "MOTIONTWEEN"; break;
35 | case TYPE_SHAPETWEEN: str += "SHAPETWEEN"; break;
36 | default: str += "unknown"; break;
37 | }
38 | return str;
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/timeline/Scene.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.timeline
2 | {
3 | import com.codeazur.utils.StringUtils;
4 |
5 | public class Scene
6 | {
7 | public var frameNumber:uint = 0;
8 | public var name:String;
9 |
10 | public function Scene(frameNumber:uint, name:String)
11 | {
12 | this.frameNumber = frameNumber;
13 | this.name = name;
14 | }
15 |
16 | public function toString(indent:uint = 0):String {
17 | return StringUtils.repeat(indent) +
18 | "Name: " + name + ", " +
19 | "Frame: " + frameNumber;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/timeline/SoundStream.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.timeline
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | public class SoundStream
6 | {
7 | public var startFrame:uint;
8 | public var numFrames:uint;
9 | public var numSamples:uint;
10 |
11 | public var compression:uint;
12 | public var rate:uint;
13 | public var size:uint;
14 | public var type:uint;
15 |
16 | protected var _data:ByteArray;
17 |
18 | public function SoundStream()
19 | {
20 | _data = new ByteArray();
21 | }
22 |
23 | public function get data():ByteArray { return _data; }
24 |
25 | public function toString():String {
26 | return "[SoundStream] " +
27 | "StartFrame: " + startFrame + ", " +
28 | "Frames: " + numFrames + ", " +
29 | "Samples: " + numSamples + ", " +
30 | "Bytes: " + data.length;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/utils/ColorUtils.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.utils
2 | {
3 | import com.codeazur.utils.StringUtils;
4 |
5 | public class ColorUtils
6 | {
7 | public static function alpha(color:uint):Number {
8 | return Number(color >>> 24) / 255;
9 | }
10 |
11 | public static function rgb(color:uint):uint {
12 | return (color & 0xffffff);
13 | }
14 |
15 | public static function r(color:uint):Number {
16 | return Number((rgb(color) >> 16) & 0xff) / 255;
17 | }
18 |
19 | public static function g(color:uint):Number {
20 | return Number((rgb(color) >> 8) & 0xff) / 255;
21 | }
22 |
23 | public static function b(color:uint):Number {
24 | return Number(rgb(color) & 0xff) / 255;
25 | }
26 |
27 | public static function interpolate(color1:uint, color2:uint, ratio:Number):uint {
28 | var r1:Number = r(color1);
29 | var g1:Number = g(color1);
30 | var b1:Number = b(color1);
31 | var alpha1:Number = alpha(color1);
32 | var ri:uint = uint((r1 + (r(color2) - r1) * ratio) * 255);
33 | var gi:uint = uint((g1 + (g(color2) - g1) * ratio) * 255);
34 | var bi:uint = uint((b1 + (b(color2) - b1) * ratio) * 255);
35 | var alphai:uint = uint((alpha1 + (alpha(color2) - alpha1) * ratio) * 255);
36 | return bi | (gi << 8) | (ri << 16) | (alphai << 24);
37 | }
38 |
39 | public static function rgbToString(color:uint):String
40 | {
41 | return StringUtils.printf("#%06x", (color & 0xffffff));
42 | }
43 |
44 | public static function rgbaToString(color:uint):String
45 | {
46 | return StringUtils.printf("#%06x(%02x)", (color & 0xffffff), (color >>> 24));
47 | }
48 |
49 | public static function argbToString(color:uint):String
50 | {
51 | return StringUtils.printf("#(%02x)%06x", (color >>> 24), (color & 0xffffff));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/utils/MatrixUtils.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.utils
2 | {
3 | import com.codeazur.as3swf.data.SWFMatrix;
4 |
5 | public class MatrixUtils
6 | {
7 | public static function interpolate(matrix1:SWFMatrix, matrix2:SWFMatrix, ratio:Number):SWFMatrix {
8 | // TODO: not sure about this at all
9 | var matrix:SWFMatrix = new SWFMatrix();
10 | matrix.scaleX = matrix1.scaleX + (matrix2.scaleX - matrix1.scaleX) * ratio;
11 | matrix.scaleY = matrix1.scaleY + (matrix2.scaleY - matrix1.scaleY) * ratio;
12 | matrix.rotateSkew0 = matrix1.rotateSkew0 + (matrix2.rotateSkew0 - matrix1.rotateSkew0) * ratio;
13 | matrix.rotateSkew1 = matrix1.rotateSkew1 + (matrix2.rotateSkew1 - matrix1.rotateSkew1) * ratio;
14 | matrix.translateX = matrix1.translateX + (matrix2.translateX - matrix1.translateX) * ratio;
15 | matrix.translateY = matrix1.translateY + (matrix2.translateY - matrix1.translateY) * ratio;
16 | return matrix;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/utils/NumberUtils.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.utils
2 | {
3 | public class NumberUtils
4 | {
5 | public static function roundPixels20(pixels:Number):Number {
6 | return Math.round(pixels * 100) / 100;
7 | }
8 |
9 | public static function roundPixels400(pixels:Number):Number {
10 | return Math.round(pixels * 10000) / 10000;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/FD/src/com/codeazur/as3swf/utils/ObjCUtils.as:
--------------------------------------------------------------------------------
1 | package com.codeazur.as3swf.utils
2 | {
3 | public class ObjCUtils
4 | {
5 | public static function num2str(n:Number, twips:Boolean = false):String {
6 | if(twips) { n = Math.round(n * 100) / 100; }
7 | var s:String = n.toString();
8 | if (s.indexOf(".") == -1) {
9 | s += ".0";
10 | }
11 | return s + "f";
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FD/src/workers/Worker1.as:
--------------------------------------------------------------------------------
1 | package workers
2 | {
3 | import com.myflashlabs.utils.worker.WorkerBase;
4 |
5 | /**
6 | * ...
7 | * @author MyFlashLab Team - 1/28/2016 11:00 PM
8 | */
9 | public class Worker1 extends WorkerBase
10 | {
11 |
12 | public function Worker1()
13 | {
14 |
15 | }
16 |
17 | // these methods must be public because they are called from the main thread.
18 | public function forLoop($myParam:int):void
19 | {
20 | var thisCommand:Function = arguments.callee;
21 |
22 | for (var i:int = 0; i < $myParam; i++)
23 | {
24 | // call this method to send progress to your delegate
25 | sendProgress(thisCommand, i);
26 | }
27 |
28 | // call this method as the final message from the worker. When this is called, you cannot send anymore "sendProgress"
29 | sendResult(thisCommand, $myParam);
30 | }
31 |
32 | }
33 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013-2016 MyFlashLabs.com
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------