- Home
- Products For Home & Business
- Tools For Developers
- Download
- Purchase
- Support
- Company
QUESTIONS OR COMMENTS ABOUT PRODUCTS? WRITE US AT SUPPORT@BYTESCOUT.COM OR USE THIS FORM
QUESTIONS OR COMMENTS ABOUT PRODUCTS? WRITE US AT SUPPORT@BYTESCOUT.COM OR USE THIS FORM
Create flash slideshow with fading effects from JPEG images using SWF Scout library
IMPORTANT: if you are looking for not for low-level SWF API but for "ready-to-use" library for converting JPG, BMP, PNG images into flash slideshow with transition effects - please check our SWF SlideShow Scout Library
Slide Show using simple fading out effect for images
Generated Flash slide show movie:
download ZIP with all required image files and VB script
VB source code:
Set Movie = CreateObject("SWFScout.FlashMovie")
Movie.InitLibrary "demo","demo"
' Movie creating and setting parameters
Movie.BeginMovie 0,0,W,H,1,FPS,6
Movie.Compressed = true
Movie.SetBackgroundColor 255,255,255
Movie.AddPreloader 0, 0,0,0,180, 0,255,0,30, "Loading (%d% completed)...", -1
CurDepth = Movie.CurrentMaxDepth
bUseFadeOut = true
for i=1 to ImagesCount
img = Movie.AddImageFromFileName("NewImage" & CStr(i) & ".jpg")
Movie.PlaceImage Img, CurDepth
CurDepth = CurDepth +1
Movie.PLACE_FadeOut FadeOutTime
Movie.ShowFrame PauseTime * FPS
Next
Movie.EndMovie
Movie.SaveToFile "SlideShowWithEffects_FadeOutImages.swf"
Below is a variation of example above modified to add support for starting slideshow on first mouse move:
W = 640
H = 480
MaxDepth = 65000
FadeOutTime = 1.5 ' seconds
PauseTime = 2 ' seconds
FPS = 12 ' frames per second
ImagesCount = 3 ' number of images
Set Movie = CreateObject("SWFScout.FlashMovie")
Movie.InitLibrary "demo","demo"
' Movie creating and setting parameters
Movie.BeginMovie 0,0,W,H,1,FPS,6
Movie.Compressed = true
Movie.SetBackgroundColor 255,255,255
Movie.AddPreloader 0, 0,0,0,180, 0,255,0,30, "Loading (%d% completed)...", -1
Font = Movie.AddFont( "Arial",12,true,false,false,false,0)
Text = Movie.AddText2 ("Move a mouse to start a slideshow",0,0,0,255,Font, W / 2, 60,2)
Movie.PlaceText Text,Movie.CurrentMaxDepth ' place text
' add sprite (movieclip) to listen to mouse events
Sprite = Movie.AddSprite
Movie.PlaceSprite Sprite, Movie.CurrentMaxDepth ' add sprite to the movie
Action = Movie.AddScript ' add new script
Movie.SCRIPT_AddCompiledBytecode "880D0002005F726F6F7400706C617900960700070000000008001C9602000801521700"
Movie.PLACE_SetScriptForEvent Action, 4, 0 ' 4=mouseMove event
' // uncomment line with ".PLACE_CompileEvent" function below
' // if you have additional AS license so can compile source code
' // instead of using pre-compiled bytecode
' Movie.PLACE_CompileEvent "onClipEvent(mouseMove){_root.play();}"
CurDepth = Movie.CurrentMaxDepth
bUseFadeOut = true
for i=1 to ImagesCount
img = Movie.AddImageFromFileName("NewImage" & CStr(i) & ".jpg")
Movie.PlaceImage Img, CurDepth
' stop movie after first image
if i=1 Then
' set action for first frame to stop movie right after first frame is shown
Action= Movie.AddScript
Movie.SCRIPT_AddAction 62 ' sacttStop = 62
Movie.SetFrameActions Action
Movie.ShowFrame 1
End If
Movie.PLACE_FadeOut FadeOutTime
Movie.ShowFrame PauseTime * FPS
CurDepth = CurDepth +1
Next
Movie.EndMovie
Movie.SaveToFile "SlideShowWithEffects_FadeOutImages_StartOnMouseMove.swf"
Tutorials: