Using external existing SWF files to create new Flash movie with SWF Scout

Submitted by eLenka on 21 April, 2011 - 12:59

This example shows embedding SWF movieclip (sprite) from external SWF file.

SWF Scout is capable of embedding existing SWF files into new SWF Flash movies. To read the information about SWF file please check SWF file information reading example.

This flash movie was generated using shapes.swf and transformations.swf

VB Source Code:

' External.vbs you can find source code of this example along with required files
' in  "Examples\More Examples" sub-folder
  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,DEFAULT_CHARSET)
 
'//////////////////////////
' External SWF
'/////////////////////////
 
Text = Movie.AddText2 ("External SWF",0,0,0,255,FontBig, W / 2, 60,2)
Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
 
ExtSWF= Movie.AddExternalSWF ("Shapes.swf", 3, true) ' 3 is a Sprite mode so external movie is added as sprite and returned value is a sprite index in sprite collection
 
Movie.PLACE_SetTranslate 0, 0 ' set new position
Movie.PLACE_SetScale 0.5, 0.5 ' we set scale to 0.5
 
Movie.PlaceSprite ExtSWF, Movie.CurrentMaxDepth
 
ExtSWF= Movie.AddExternalSWF ("Transformations.swf", 3, true) ' 3 is a Sprite mode so external movie is added as sprite and returned value is a sprite index in sprite collection
 
Movie.PLACE_SetTranslate W / 2 , 0 ' set new position
Movie.PLACE_SetScale 0.5, 0.5 ' we set scale to 0.5
 
Movie.PlaceSprite ExtSWF, Movie.CurrentMaxDepth
 
Movie.ShowFrame 1
 
Movie.EndMovie
 
Movie.SaveToFile "ExternalSWF.swf"

 

Download source code: