Home

SWF Scout

SWF Scout screenshot (click to enlarge)



SWF Scout ActiveX/NET library

How to create and use sprites (movieclips) using SWF Scout library

Generated Flash movie:

' Sprites.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)
 
'-----------------------------
' SPRITES
'-----------------------------
 
 ' place solid rectangle to make fadout on whole screen
 Shape = Movie.AddShape
 Movie.SHAPE_Rectangle 0, 0, W, H
 Movie.SHAPE_SetSolidColor 255,255,255,true,255
 Movie.PlaceShape Shape,Movie.CurrentMaxDepth
 Movie.PLACE_FadeOut 1
 
 Text = Movie.AddText2 ("Sprites",0,0,0,255,FontBig, W / 2, H / 2,2)
 Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
 Movie.PLACE_FadeOut 0.5 ' fade out text
 Movie.ShowFrame 10
 Movie.PLACE_FadeIn 0.5 ' fade in
 
' Move
 
 Text = Movie.AddText ("Moving",0,0,0,255,Font, 0, 10, 150, 160)
 Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
 Movie.PLACE_FadeOut 0.5 ' fade out text
 
 Shape = Movie.AddShape
 Movie.SHAPE_Rectangle 5,95,115,125
 
 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
 
 Sprite= Movie.AddSprite
 j=Movie.CurrentMaxDepth
 Movie.SPRITE_PlaceShape Shape,j
 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
 
       FOR i=1 TO 30
       Movie.PlaceSprite Sprite,j
      Movie.PLACE_SetRotate 180 * i / 30
     Movie.PLACE_SetTranslate 0 + i*3, 220
       IF (i>1) THEN
       Movie.PLACE_AutoRemoveDepth = true
       END IF             
        Movie.ShowFrame 1
      NEXT
 
 
  Movie.ShowFrame 10
 
 ' move & clone
 Text = Movie.AddText ("Move & Clone",0,0,0,255,Font, 160, 10, 310, 165)
 Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
 Movie.PLACE_FadeOut 0.5 ' fade out text
 
 Shape = Movie.AddShape
 Movie.SHAPE_Rectangle 160,25,275,95
 
 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
 
 Sprite= Movie.AddSprite
 j=Movie.CurrentMaxDepth
 Movie.SPRITE_PlaceShape Shape,j
 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
 
       Movie.PlaceSprite Sprite,J+1 ' place clone into next depth
       Movie.PLACE_SetTranslate 20, 100
 
       For i = 1 to 30
       Movie.PlaceSprite Sprite,j
       Movie.PLACE_SetRotate -360 * i / 30
       Movie.PLACE_SetTranslate 100 + i*2, 160
        if (i>1) THEN 
       Movie.PLACE_AutoRemoveDepth = true        
       END IF
        Movie.ShowFrame 1
       NEXT
  Movie.ShowFrame 20
 
 ' place solid rectangle to make fadout on whole screen
 Shape = Movie.AddShape
 Movie.SHAPE_Rectangle 0, 0, W, H
 Movie.SHAPE_SetSolidColor 255,255,255,true,255
 Movie.PlaceShape Shape,Movie.CurrentMaxDepth
 Movie.PLACE_FadeOut 1
 
 Movie.EndMovie
 
 Movie.SaveToFile "Sprites.swf"

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

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