Now we will export this flash project as SWF file. Go to File menu and select Export Movie in Export sub-menu:
VB code that uses compiled bytecode extracted using SWFMixer:
' KeyPress.vbs. You can find source code of this example along with required files
' in "Examples\More Examples" sub-folder
' Bytecode was extracted from KeyPressEvent.swf. You can find this file in "Examples\More Examples" folder as well
W = 640
H = 480
Set Movie = CreateObject("SWFScout.FlashMovie")
Movie.InitLibrary "demo","demo"
' Movie creating and setting parameters
Movie.BeginMovie 0,0,W,H,1,12,6
Movie.Compressed = true
Movie.SetBackgroundColor 255,255,255
Font = Movie.AddFont( "Arial",12,true,false,false,false,0)
FontBig = Movie.AddFont("Arial",40,true,false,false,false,0)
'///////////////////
' Buttons
'//////////////////////
Text = Movie.AddText("Use arrow keys to move button",0,0,0,255,Font, 0, 80, 170, 160)
Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
Shape = Movie.AddShape
Movie.SHAPE_Circle 0, 0, 40
Movie.SHAPE_BeginRadialGradient
Movie.SHAPE_AddRadialGradientColor 255,255,255,255
Movie.SHAPE_AddRadialGradientColor 0,0,255,255
Movie.SHAPE_EndRadialGradient 35,35
Sprite = Movie.AddSprite
Movie.SPRITE_PlaceShape Shape, 1
Action= Movie.AddScript
' this compiled code below was extracted from KeyPress.swf using SWFMixer utility
Movie.SCRIPT_AddCompiledBytecode "88190005004B657900676574436F64650074686973005F78005F
7900960B0006000000000000000008001C9602000801528
70100009605000725000000669D02003500960700040007
27000000669D0200480096070004000726000000669D020
05B0096070004000728000000669D02006E009902008C00
96020008021C960400080308021C96020008034E9605000
7010000000B4F990200690096020008021C960400080308
021C96020008034E9605000701000000474F99020046009
6020008021C960400080408021C96020008044E96050007
010000000B4F990200230096020008021C9604000804080
21C96020008044E9605000701000000474F99020000000001"
' HINT: if bytecode string is too long then you can save it to file and then load it to string and then use this srtring variable with SCRIPT_AddCompiledBytecode
Movie.PlaceSprite Sprite, 2
Movie.PLACE_SetTranslate 200, 150
Movie.PLACE_SetScriptForEvent Script, 1, 0
Movie.ShowFrame 1
Movie.EndMovie
Movie.SaveToFile "KeyPress_SWFScout.swf"