SWF Scout |
Quick Guide:
How to create SWF flash animation movie from VBScript ("Hello, World!"example)
You can download the source code of this example here: swfscout_vbscript.zip SWF Scout library can be used in scripting languages that support ActiveX/COM objects: Javascript, VBScript, Visual Basic scripted language. This page will show how create the SWF flash animation movie using VBScript and SWF Scout library. Windows 98/2000/ME/XP
have built-in VBScript
support and all files with ".VBS"
are recognized as VBScript
files and can be executed by system.
1)
Install SWF Scout
library on your computer
2)
Run Notepad
3)
To create SWF flash animation movie in VBScript we have to write a very
simple script:
W = 640 '
width
H = 480 '
height
Set
Movie = CreateObject("SWFScout.FlashMovie")
Movie.InitLibrary "demo", "demo"
Movie.BeginMovie 0, 0, W, H, 1, 12,
6
Movie.SetBackgroundColor 255, 255,
255 ' set background
color to white
Font = Movie.AddFont("Arial", 18,
True,
False,
False,
False,
0) ' add font
'
create and place text
Text = Movie.AddText("Hello, World!",
0, 0, 0, 255, Font, 0, 100, 250, 160)
Movie.PlaceText Text, Movie.CurrentMaxDepth
' place text into current
depth
Movie.PLACE_FadeOut 0.5 '
fade out text
Shape = Movie.AddShape '
add new shape
Movie.SHAPE_Rectangle 0, 140, 150,
285 ' draw rectangle
Movie.SHAPE_SetSolidColor 50, 255,
50, True,
255 ' set solid fill
for shape
Movie.PlaceShape Shape, Movie.CurrentMaxDepth
' place shape into current
depth
Movie.ShowFrame 10 '
show 10 frames
Movie.EndMovie '
end movie generation
Movie.SaveToFile "shapes.swf" '
save file
'
disconnect from library
Set
Movie = Nothing
Feel free to copy code from this
page, paste into the notepad and save as a "HelloWorld.VBS":
4)
Double-click "HelloWorld.VBS"
file from Explorer or from another file manager and script will be executed.
You can view generated flash file (.SWF) using Internet Explorer or another application that is capable of viewing and playing of flash animations. ![]() You can download the source code of this example here:
swfscout_vbscript.zip
|
|
|
||