Home

SWF Scout

SWF Scout screenshot (click to enlarge)



SWF Scout ActiveX/NET library

Sample: ButtonWithSprites.vbs

Generated Flash movie:

VB source code:

' ButtonWithSprite.vbs 

W = 640
H = 480
Set Movie = CreateObject("SWFScout.FlashMovie")
Movie.InitLibrary "demo","demo"

' Create new movie

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)

'-----------------------------
' Button with SPRITES
'-----------------------------

' place solid rectangle to make fadout on whole screen
Text = Movie.AddText2 ("Button with sprite",0,0,0,255,FontBig, 230, 40, 2)
Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text

' Shape

Shape = Movie.AddShape
Movie.SHAPE_Circle 200,200,100

Movie.SHAPE_BeginLinearGradient false
Movie.SHAPE_AddLinearGradientColor 70,20,45,200,1
Movie.SHAPE_AddLinearGradientColor 200,245,215,255,1
Movie.SHAPE_AddLinearGradientColor 100,190,70,200,1
Movie.SHAPE_AddLinearGradientColor 255,255,255,255,1
Movie.SHAPE_EndLinearGradient 0

' SpriteUp will be used as main button sprite
SpriteUp= Movie.AddSprite
j=Movie.CurrentMaxDepth
Movie.SPRITE_PlaceShape Shape,j

Text = Movie.AddText2 ("UP",0,0,0,255,Font, 200,200,2)
Movie.SPRITE_PlaceText Text, J+1 ' place text

Movie.SPRITE_ShowFrame 1

FOR i=1 TO 10
Movie.SPRITE_PlaceShape Shape, j
IF (i>5) THEN
Movie.PLACE_SetScale 1 + (10 - i)/ 10 ,1 + (10 - i)/ 10
Else Movie.PLACE_SetScale 1 + (i/ 10), 1 + (i/ 10)
END if
Movie.PLACE_AutoRemoveDepth= true
Movie.SPRITE_ShowFrame 1
NEXT

' SpriteOver will be used as button sprite on Over event
SpriteOver= Movie.AddSprite
j=Movie.CurrentMaxDepth
Movie.SPRITE_PlaceShape Shape,j

Text = Movie.AddText2 ("OVER",0,0,0,255,Font,200,200,2)
Movie.SPRITE_PlaceText Text, J+1 ' place text

Movie.SPRITE_ShowFrame 1

FOR i=1 TO 10
Movie.SPRITE_PlaceShape Shape, j
IF (i>5) THEN
Movie.PLACE_SetScale 1,1 + (10 - i)/ 10
Else Movie.PLACE_SetScale 1, 1 + (i/ 10)
END if
Movie.PLACE_AutoRemoveDepth= true
Movie.SPRITE_ShowFrame 1
NEXT


' SpriteDown will be used as button sprite on Over event
SpriteDown= Movie.AddSprite
j=Movie.CurrentMaxDepth
Movie.SPRITE_PlaceShape Shape,j

Text = Movie.AddText2 ("DOWN",0,0,0,255,Font, 200,200,2)
Movie.SPRITE_PlaceText Text, J+1 ' place text

Movie.SPRITE_ShowFrame 1

FOR i=1 TO 10
Movie.SPRITE_PlaceShape Shape, j
IF (i>5) THEN
Movie.PLACE_SetScale 1 + (10 - i)/ 10, 1
Else Movie.PLACE_SetScale 1 + (i/ 10), 1
END if
Movie.PLACE_AutoRemoveDepth= true
Movie.SPRITE_ShowFrame 1
NEXT

Buttonitem = Movie.AddButton( false, true)

Movie.BUTTON_AddSprite SpriteUp, 0 ' sbstUp = 0
Movie.BUTTON_AddSprite SpriteDown, 1 ' sbstDown = 1
Movie.BUTTON_AddSprite SpriteOver, 2 ' sbstOver = 2
Movie.BUTTON_AddShape Shape, 3 ' sbstHitTest = 3

Movie.PlaceButton Buttonitem, Movie.CurrentMaxDepth
Movie.ShowFrame 1
Movie.EndMovie

Movie.SaveToFile "ButtonWithSprite.swf"


Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials  |  News |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement