├── license.txt ├── bin ├── Fanvas.swf ├── demo │ ├── img1.png │ ├── 礼物.swf │ ├── img59.png │ ├── img62.png │ ├── img66.png │ ├── img69.png │ ├── img71.png │ ├── img73.png │ └── Test.html ├── 二次开发或批处理 │ ├── 批处理 │ │ ├── 批处理说明.txt │ │ └── FanvasService.swf │ ├── FanvasParserLib.swc │ └── FanvasParserLib说明.txt └── flashplayer_14_sa_debug.exe ├── exporter_src ├── readme.txt ├── lib │ ├── flash.swc │ ├── fzip.swc │ ├── skin.fla │ └── skin.swc └── src │ ├── com │ └── codeazur │ │ └── as3swf │ │ ├── tags │ │ ├── IDisplayListTag.as │ │ ├── IDefinitionTag.as │ │ ├── Tag.as │ │ ├── ITag.as │ │ ├── etc │ │ │ ├── TagSWFEncryptActions.as │ │ │ └── TagSWFEncryptSignature.as │ │ ├── TagDefineShape2.as │ │ ├── TagDefineShape3.as │ │ ├── TagEnd.as │ │ ├── TagShowFrame.as │ │ ├── TagUnknown.as │ │ ├── TagDefineFont3.as │ │ ├── TagRemoveObject2.as │ │ ├── TagDefineText2.as │ │ ├── TagSetTabIndex.as │ │ ├── TagRemoveObject.as │ │ ├── TagDefineFontInfo2.as │ │ ├── TagProtect.as │ │ ├── TagScriptLimits.as │ │ ├── TagEnableDebugger.as │ │ ├── TagMetadata.as │ │ ├── TagSoundStreamBlock.as │ │ ├── TagJPEGTables.as │ │ ├── TagSoundStreamHead2.as │ │ ├── TagStartSound.as │ │ ├── TagDefineBitsLossless2.as │ │ ├── TagSetBackgroundColor.as │ │ ├── TagStartSound2.as │ │ ├── TagEnableTelemetry.as │ │ ├── TagDefineFontName.as │ │ ├── TagImportAssets2.as │ │ ├── TagFrameLabel.as │ │ ├── TagVideoFrame.as │ │ ├── TagDoABCDeprecated.as │ │ ├── TagEnableDebugger2.as │ │ ├── TagDefineScalingGrid.as │ │ ├── TagCSMTextSettings.as │ │ ├── TagDebugID.as │ │ ├── TagDefineButtonCxform.as │ │ ├── TagExportAssets.as │ │ ├── TagSymbolClass.as │ │ ├── TagPlaceObject4.as │ │ ├── TagFileAttributes.as │ │ └── TagImportAssets.as │ │ ├── factories │ │ ├── ISWFTagFactory.as │ │ └── SWFFilterFactory.as │ │ ├── data │ │ ├── etc │ │ │ ├── IEdge.as │ │ │ ├── CurvedEdge.as │ │ │ └── StraightEdge.as │ │ ├── actions │ │ │ ├── IActionBranch.as │ │ │ ├── ActionUnknown.as │ │ │ ├── IAction.as │ │ │ ├── swf4 │ │ │ │ ├── ActionOr.as │ │ │ │ ├── ActionAdd.as │ │ │ │ ├── ActionAnd.as │ │ │ │ ├── ActionNot.as │ │ │ │ ├── ActionPop.as │ │ │ │ ├── ActionCall.as │ │ │ │ ├── ActionLess.as │ │ │ │ ├── ActionTrace.as │ │ │ │ ├── ActionDivide.as │ │ │ │ ├── ActionEquals.as │ │ │ │ ├── ActionEndDrag.as │ │ │ │ ├── ActionGetTime.as │ │ │ │ ├── ActionMultiply.as │ │ │ │ ├── ActionSubtract.as │ │ │ │ ├── ActionStartDrag.as │ │ │ │ ├── ActionStringAdd.as │ │ │ │ ├── ActionToInteger.as │ │ │ │ ├── ActionSetTarget2.as │ │ │ │ ├── ActionStringLess.as │ │ │ │ ├── ActionAsciiToChar.as │ │ │ │ ├── ActionCharToAscii.as │ │ │ │ ├── ActionCloneSprite.as │ │ │ │ ├── ActionGetProperty.as │ │ │ │ ├── ActionGetVariable.as │ │ │ │ ├── ActionSetProperty.as │ │ │ │ ├── ActionSetVariable.as │ │ │ │ ├── ActionRandomNumber.as │ │ │ │ ├── ActionRemoveSprite.as │ │ │ │ ├── ActionStringEquals.as │ │ │ │ ├── ActionStringLength.as │ │ │ │ ├── ActionMBAsciiToChar.as │ │ │ │ ├── ActionMBCharToAscii.as │ │ │ │ ├── ActionStringExtract.as │ │ │ │ ├── ActionMBStringLength.as │ │ │ │ ├── ActionMBStringExtract.as │ │ │ │ ├── ActionWaitForFrame2.as │ │ │ │ └── ActionPush.as │ │ │ ├── swf3 │ │ │ │ ├── ActionStop.as │ │ │ │ ├── ActionStopSounds.as │ │ │ │ ├── ActionPlay.as │ │ │ │ ├── ActionPreviousFrame.as │ │ │ │ ├── ActionToggleQuality.as │ │ │ │ ├── ActionNextFrame.as │ │ │ │ ├── ActionGotoFrame.as │ │ │ │ ├── ActionGotoLabel.as │ │ │ │ ├── ActionSetTarget.as │ │ │ │ ├── ActionWaitForFrame.as │ │ │ │ └── ActionGetURL.as │ │ │ ├── swf5 │ │ │ │ ├── ActionAdd2.as │ │ │ │ ├── ActionBitOr.as │ │ │ │ ├── ActionLess2.as │ │ │ │ ├── ActionBitAnd.as │ │ │ │ ├── ActionBitXor.as │ │ │ │ ├── ActionDelete.as │ │ │ │ ├── ActionModulo.as │ │ │ │ ├── ActionReturn.as │ │ │ │ ├── ActionTypeOf.as │ │ │ │ ├── ActionDelete2.as │ │ │ │ ├── ActionEquals2.as │ │ │ │ ├── ActionToNumber.as │ │ │ │ ├── ActionToString.as │ │ │ │ ├── ActionBitLShift.as │ │ │ │ ├── ActionBitRShift.as │ │ │ │ ├── ActionDecrement.as │ │ │ │ ├── ActionEnumerate.as │ │ │ │ ├── ActionGetMember.as │ │ │ │ ├── ActionIncrement.as │ │ │ │ ├── ActionInitArray.as │ │ │ │ ├── ActionNewMethod.as │ │ │ │ ├── ActionNewObject.as │ │ │ │ ├── ActionSetMember.as │ │ │ │ ├── ActionStackSwap.as │ │ │ │ ├── ActionBitURShift.as │ │ │ │ ├── ActionCallMethod.as │ │ │ │ ├── ActionInitObject.as │ │ │ │ ├── ActionTargetPath.as │ │ │ │ ├── ActionDefineLocal.as │ │ │ │ ├── ActionCallFunction.as │ │ │ │ ├── ActionDefineLocal2.as │ │ │ │ ├── ActionPushDuplicate.as │ │ │ │ └── ActionStoreRegister.as │ │ │ ├── swf7 │ │ │ │ ├── ActionThrow.as │ │ │ │ ├── ActionCastOp.as │ │ │ │ ├── ActionExtends.as │ │ │ │ └── ActionImplementsOp.as │ │ │ ├── swf6 │ │ │ │ ├── ActionGreater.as │ │ │ │ ├── ActionEnumerate2.as │ │ │ │ ├── ActionInstanceOf.as │ │ │ │ ├── ActionStrictEquals.as │ │ │ │ └── ActionStringGreater.as │ │ │ └── ActionExecutionContext.as │ │ ├── SWFScene.as │ │ ├── consts │ │ │ ├── SoundSize.as │ │ │ ├── SoundType.as │ │ │ ├── BitmapType.as │ │ │ ├── CSMTableHint.as │ │ │ ├── BitmapFormat.as │ │ │ ├── LineCapsStyle.as │ │ │ ├── LineJointStyle.as │ │ │ ├── GradientInterpolationMode.as │ │ │ ├── SoundRate.as │ │ │ ├── GradientSpreadMode.as │ │ │ ├── VideoCodecID.as │ │ │ ├── VideoDeblockingType.as │ │ │ ├── SoundCompression.as │ │ │ ├── ActionValueType.as │ │ │ └── BlendMode.as │ │ ├── filters │ │ │ ├── IFilter.as │ │ │ ├── Filter.as │ │ │ └── FilterBlur.as │ │ ├── SWFFrameLabel.as │ │ ├── SWFShapeRecordEnd.as │ │ ├── SWFRecordHeader.as │ │ ├── SWFRegisterParam.as │ │ ├── SWFFocalGradient.as │ │ ├── SWFZoneData.as │ │ ├── SWFRawTag.as │ │ ├── SWFSymbol.as │ │ ├── SWFKerningRecord.as │ │ ├── SWFShapeRecord.as │ │ ├── SWFSoundEnvelope.as │ │ ├── SWFGlyphEntry.as │ │ ├── SWFMorphFocalGradient.as │ │ ├── SWFGradientRecord.as │ │ ├── SWFMorphGradientRecord.as │ │ ├── SWFZoneRecord.as │ │ └── SWFClipActions.as │ │ ├── utils │ │ ├── NumberUtils.as │ │ ├── ObjCUtils.as │ │ ├── MatrixUtils.as │ │ └── ColorUtils.as │ │ ├── timeline │ │ ├── Scene.as │ │ ├── SoundStream.as │ │ └── LayerStrip.as │ │ ├── events │ │ ├── SWFErrorEvent.as │ │ ├── SWFWarningEvent.as │ │ ├── SWFProgressEvent.as │ │ └── SWFEventDispatcher.as │ │ └── exporters │ │ └── core │ │ ├── IShapeExporter.as │ │ └── DefaultShapeExporter.as │ ├── exporters │ └── IExporter.as │ ├── model │ ├── ImageData.as │ ├── ShapeData.as │ ├── frameAction │ │ ├── BaseFrameAction.as │ │ ├── RemoveElementAction.as │ │ ├── PlaceElementAction.as │ │ └── TweenAction.as │ ├── DisplayObjectData.as │ ├── SWFData.as │ ├── MovieClipData.as │ └── InstanceData.as │ └── parsers │ └── ShapeParser.as ├── copyright.txt └── README.md /license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/license.txt -------------------------------------------------------------------------------- /bin/Fanvas.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/Fanvas.swf -------------------------------------------------------------------------------- /bin/demo/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img1.png -------------------------------------------------------------------------------- /bin/demo/礼物.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/礼物.swf -------------------------------------------------------------------------------- /bin/demo/img59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img59.png -------------------------------------------------------------------------------- /bin/demo/img62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img62.png -------------------------------------------------------------------------------- /bin/demo/img66.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img66.png -------------------------------------------------------------------------------- /bin/demo/img69.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img69.png -------------------------------------------------------------------------------- /bin/demo/img71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img71.png -------------------------------------------------------------------------------- /bin/demo/img73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/demo/img73.png -------------------------------------------------------------------------------- /exporter_src/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/exporter_src/readme.txt -------------------------------------------------------------------------------- /bin/二次开发或批处理/批处理/批处理说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/二次开发或批处理/批处理/批处理说明.txt -------------------------------------------------------------------------------- /exporter_src/lib/flash.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/exporter_src/lib/flash.swc -------------------------------------------------------------------------------- /exporter_src/lib/fzip.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/exporter_src/lib/fzip.swc -------------------------------------------------------------------------------- /exporter_src/lib/skin.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/exporter_src/lib/skin.fla -------------------------------------------------------------------------------- /exporter_src/lib/skin.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/exporter_src/lib/skin.swc -------------------------------------------------------------------------------- /bin/flashplayer_14_sa_debug.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/flashplayer_14_sa_debug.exe -------------------------------------------------------------------------------- /bin/二次开发或批处理/FanvasParserLib.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/二次开发或批处理/FanvasParserLib.swc -------------------------------------------------------------------------------- /bin/二次开发或批处理/批处理/FanvasService.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TencentOpen/Fanvas/HEAD/bin/二次开发或批处理/批处理/FanvasService.swf -------------------------------------------------------------------------------- /exporter_src/src/com/codeazur/as3swf/tags/IDisplayListTag.as: -------------------------------------------------------------------------------- 1 | package com.codeazur.as3swf.tags 2 | { 3 | public interface IDisplayListTag extends ITag 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /bin/二次开发或批处理/FanvasParserLib说明.txt: -------------------------------------------------------------------------------- 1 | 这里把Fanvas Parser部分封装成swc,方便使用者二次开发 2 | 使用方法: 3 | stage.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void 4 | { 5 | var file:FileReference = new FileReference(); 6 | file.browse([new FileFilter("swf", "*.swf")]); 7 | file.addEventListener(Event.SELECT, function(e:Event):void 8 | { 9 | file.load(); 10 | file.addEventListener(Event.COMPLETE, function(e1:Event):void 11 | { 12 | //API其实只有这一句 13 | FanvasParser.parse(file.data, function(data:*):void 14 | { 15 | trace(data.swfData is ByteArray, data.swfData.length); //bytearray 16 | trace(data.warning); //string 17 | }, 'swfData'); //导出的js数据对象名称 18 | }); 19 | }); 20 | }); -------------------------------------------------------------------------------- /copyright.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/exporters/IExporter.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package exporters 15 | { 16 | import model.SWFData; 17 | 18 | /** 19 | * 20 | * @author tencent 21 | * @date Jul 7, 2014 22 | */ 23 | public interface IExporter 24 | { 25 | function export(swfData:SWFData):*; 26 | } 27 | } -------------------------------------------------------------------------------- /bin/demo/Test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | New Document 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/src/model/ImageData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model 15 | { 16 | import flash.utils.ByteArray; 17 | 18 | /** 19 | * 20 | * @author tencent 21 | * @date Aug 27, 2014 22 | */ 23 | public class ImageData extends DisplayObjectData 24 | { 25 | public var imageName:String; 26 | 27 | public function ImageData() 28 | { 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /exporter_src/src/model/ShapeData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model 15 | { 16 | import com.codeazur.as3swf.tags.TagDefineShape; 17 | 18 | /** 19 | * @author tencent 20 | * @date Jul 7, 2014 21 | */ 22 | public class ShapeData extends DisplayObjectData 23 | { 24 | public var data:TagDefineShape; 25 | public function ShapeData() 26 | { 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /exporter_src/src/model/frameAction/BaseFrameAction.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model.frameAction 15 | { 16 | /** 17 | * 18 | * @author tencent 19 | * @date Jul 9, 2014 20 | */ 21 | public class BaseFrameAction 22 | { 23 | public function BaseFrameAction() 24 | { 25 | } 26 | 27 | public function export () : Array { 28 | //抛出错误 29 | return null; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/frameAction/RemoveElementAction.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model.frameAction { 15 | 16 | /** 17 | * 实例从舞台上移出。 18 | * @author juliashen 19 | * @date Jul 16, 2014 20 | */ 21 | public class RemoveElementAction extends BaseFrameAction { 22 | 23 | public var instanceID : String; 24 | public function RemoveElementAction(instanceID : String) { 25 | super(); 26 | 27 | this.instanceID = instanceID; 28 | } 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/DisplayObjectData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model 15 | { 16 | import flash.geom.Rectangle; 17 | 18 | 19 | /** 20 | * @author tencent 21 | * @date Jul 7, 2014 22 | */ 23 | public class DisplayObjectData 24 | { 25 | /** 26 | * swf中用于识别这个定义唯一性的id 27 | */ 28 | public var characterId:uint = 0; 29 | public var parent:DisplayObjectData; 30 | public var rect:Rectangle; 31 | 32 | public function DisplayObjectData() 33 | { 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/frameAction/PlaceElementAction.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model.frameAction 15 | { 16 | 17 | import model.InstanceData; 18 | 19 | /** 20 | * 新建元件,放置到舞台上。 21 | * @author juliashen 22 | * @date Jul 10, 2014 23 | */ 24 | public class PlaceElementAction extends BaseFrameAction 25 | { 26 | public var instanceData : InstanceData; 27 | public function PlaceElementAction(instanceData : InstanceData) 28 | { 29 | super(); 30 | this.instanceData = instanceData; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/SWFData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model 15 | { 16 | import com.codeazur.as3swf.SWF; 17 | 18 | /** 19 | * @author tencent 20 | * @date Jul 11, 2014 21 | */ 22 | public class SWFData 23 | { 24 | public var backgroundColor:uint; 25 | public var stageWidth:int; 26 | public var stageHeight:int; 27 | public var frameRate:Number; 28 | /** 29 | * 存储所有定义,包括主MovieClip,默认0是第一个 30 | */ 31 | public var elementDefinitionPool:ElementDefinitionPool; 32 | public var swf:SWF; 33 | 34 | public function SWFData() 35 | { 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/MovieClipData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model 15 | { 16 | import model.frameAction.BaseFrameAction; 17 | 18 | 19 | 20 | /** 21 | * 时间轴动画 22 | * @author tencent 23 | * @date Jul 7, 2014 24 | */ 25 | public class MovieClipData extends DisplayObjectData 26 | { 27 | public var totalFrames:int; 28 | /** 29 | * 记录每一帧的动作(定义新shape、transform 30 | */ 31 | public var frameActionList:Vector.>; 32 | 33 | public function MovieClipData() 34 | { 35 | frameActionList = new Vector.>(); 36 | } 37 | 38 | } 39 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/parsers/ShapeParser.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package parsers 15 | { 16 | import com.codeazur.as3swf.tags.TagDefineShape; 17 | 18 | import model.ShapeData; 19 | 20 | 21 | /** 22 | * @author tencent 23 | * @date Jul 7, 2014 24 | */ 25 | public class ShapeParser 26 | { 27 | public function ShapeParser() 28 | { 29 | } 30 | 31 | public static function parse(shapeTag:TagDefineShape):ShapeData 32 | { 33 | var shapeData:ShapeData = new ShapeData(); 34 | shapeData.data = shapeTag; 35 | shapeData.characterId = shapeTag.characterId; 36 | shapeData.rect = shapeTag.shapeBounds.rect; 37 | return shapeData; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/frameAction/TweenAction.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model.frameAction { 15 | import model.InstanceData; 16 | import model.TweenData; 17 | 18 | /** 19 | * 实例的tween action。 20 | * @author juliashen 21 | * @date Jul 16, 2014 22 | */ 23 | public class TweenAction extends BaseFrameAction { 24 | 25 | public var instanceData : InstanceData; 26 | public var tweenData : TweenData; 27 | public var duration : int; 28 | 29 | public function TweenAction(instanceData : InstanceData, tweenData : TweenData, duration : int) { 30 | super(); 31 | 32 | this.instanceData = instanceData; 33 | this.tweenData = tweenData; 34 | this.duration = duration; 35 | } 36 | 37 | } 38 | } -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 什么是Fanvas? 2 | ------------------------------------------ 3 | 4 | Fanvas是一个把swf转为html5 canvas动画的系统,由两部分组成:Actionscript实现的解析器、js运行库。 5 | 6 | Flash做动画是最成熟最高效的方式,但由于终端基本不支持Flash播放,这给终端的动画制作带来了不少麻烦。 7 | 8 | Fanvas是Flash和Canvas的完美结合,可以把swf(包括矢量和位图)完美地转化为canvas动画,让美术妹子一次制作,到处运行。。。 9 | 10 | 嘿嘿~~~让美术妹子也搭上H5的快车。 11 | 12 | 13 | 14 | Fanvas的技术难点? 15 | ------------------------------------------ 16 | 1、兼容swf的各种格式,主要是各种矢量命令和多种多样的图片格式; 17 | 18 | 2、实现高效的html5运行库,自主实现了位图缓存、自动脏区识别、脏区重绘等技术。 19 | 20 | 21 | Fanvas的优势? 22 | ------------------------------------------ 23 | 能转化swf为H5动画的工具,除了Fanvas还有大名鼎鼎的google和adobe的产品——swiffy和flashcc。 24 | 对比之下,Fanvas有如下优势: 25 | 26 | 1、从swf文件直接转化为Html5动画(google的swiffy和adobe的flashcc都不支持,两个产品都需要通过fla源文件处理); 27 | 28 | 2、精简编排的JSON数据,使swf转化后的js数据文件非常小,普遍比flashcc导出的要小20%到50%; 29 | 30 | 3、精简的运行库,混淆后只有35k,gzip后只有10k左右。而swiffy和flashcc的运行库混淆后都超过100K; 31 | 32 | 4、开源,可供使用者二次开发(请保留Fanvas字样或版权声明)。 33 | 34 | 35 | 36 | 如何使用? 37 | ------------------------------------------ 38 | 只需要一键导入swf,转化完成后一键导出canvas动画js。 39 | 40 | 具体请参考bin目录的《使用说明》 41 | 42 | 43 | 源代码说明 44 | ------------------------------------------ 45 | exporter是as3.0实现的swf文件解析器,解析后输出json数据; 46 | 47 | runtime是js运行库,用于解析json数据,转化为最终canvas动画。 48 | 49 | 50 | DEMO 51 | ------------------------------------------ 52 | http://kenkozheng.github.io/fanvas/magicEmotion/demo1/ 53 | 54 | http://kenkozheng.github.io/fanvas/magicEmotion/demo2/ 55 | 56 | http://kenkozheng.github.io/fanvas/magicEmotion/demo3/ 57 | 58 | http://kenkozheng.github.io/fanvas/magicEmotion/demo4/ 59 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/src/model/InstanceData.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Fanvas available. 3 | * Copyright (C) 2015 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the 6 | * License. You may obtain a copy of the License at 7 | * http://opensource.org/licenses/MIT 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is 10 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 11 | * implied. See the License for the specific language governing permissions and limitations under the 12 | * License. 13 | */ 14 | package model { 15 | 16 | import flash.geom.ColorTransform; 17 | import flash.geom.Matrix; 18 | 19 | public class InstanceData { 20 | 21 | public var isPlaceElement : Boolean;//是添加新元件帧,区别于移动元件 22 | public var startFrame : int;//实例的起始帧 23 | public var definitionID : int;//库ID 24 | public var defIndex : int;//库Index,简化JS库中定义的搜索方式 25 | public var type : String;//Shape MovieClip 26 | public var InstanceID : String; 27 | public var depth : int; 28 | public var x : Number; 29 | public var y : Number; 30 | public var matrix : Matrix; 31 | public var skewX : Number; 32 | public var skewY : Number; 33 | public var alpha : Number; 34 | public var scaleX : Number; 35 | public var scaleY : Number; 36 | public var maskDepth : int; 37 | public var clipDepth : int; 38 | public var filters : Array; 39 | public var cacheAsBitmap : Boolean; 40 | public var colorTransform : ColorTransform; 41 | 42 | public function InstanceData() { 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | } -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | -------------------------------------------------------------------------------- /exporter_src/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 | --------------------------------------------------------------------------------