Sample: SlideShowWithEffects.vbs - create flash slide show using JPG images
Submitted by eLenka on 12 May, 2011 - 15:59
Create flash slideshow using low-level methods to implement effects (rotation, scaling, movements).
Generated Flash slide show:
VB source code:
W = 640 H = 480 MaxDepth = 65000 FramesPerImage = 18 ' number of frames for every image in slide show 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 ' //////// image #1 img1 = Movie.AddImageFromFileName("NewImage1.jpg") Shape1 = Movie.AddShape Movie.SHAPE_RoundRect 0, 0, W, H, 10 Movie.SHAPE_SetImageFill img1, 1 ' sfimFit fill image mode = 1 ' ////////// just show first image Place1 = Movie.PlaceShape (Shape1, 1) ' show first image Movie.PLACE_FadeOut 0.5 Movie.ShowFrame 5 ' ///////// image #2 img2 = Movie.AddImageFromFileName("NewImage2.jpg") Shape2 = Movie.AddShape Movie.SHAPE_RoundRect 0, 0, W, H, 10 Movie.SHAPE_SetImageFill img2, 1 ' sfimFit fill image mode = 1 Movie.PlaceShape Shape2, 2 ' place new image on next depth ' ///////// moving FOR k = 1 to 10 Movie.PlaceShape Shape2, 2 ' place new image on next depth Movie.PLACE_SetScale 0.1, 0.1 Movie.PLACE_SetTranslate k*30, k*30 Movie.PLACE_AutoRemoveDepth = true Movie.ShowFrame 1 NEXT ' ///////// scaling, rotating FOR k = 1 to 10 Movie.PlaceShape Shape2, 2 ' place new image on next depth Movie.PLACE_SetScale k*0.1, k*0.1 Movie.PLACE_SetTranslate 300-k*30,300 -k*30 Movie.PLACE_SetRotate k*36 Movie.PLACE_AutoRemoveDepth = true Movie.ShowFrame 1 NEXT Place2 = Movie.PLACE_Index Movie.ShowFrame 5 ' /////////// image #3 img3 = Movie.AddImageFromFileName("NewImage3.jpg") Shape3 = Movie.AddShape Movie.SHAPE_RoundRect 0, 0, W, H, 10 Movie.SHAPE_SetImageFill img3, 1 ' sfimFit fill image mode = 1 Movie.ShowFrame 5 Movie.RemoveObject 1 Movie.PlaceShape Shape3, 1 ' place new image instead of first image Movie.PLACE_Index = Place2 Movie.PLACE_FadeIn 1 Movie.RemoveObject 2 Movie.ShowFrame 5 Movie.PlaceShape Shape1, 0 ' place new image on next depth ' /// rotate FOR k = 1 to 10 Movie.PlaceShape Shape3, 1 ' place new image on next depth Movie.PLACE_SetTranslate W - k*50, H - k*50 Movie.PLACE_SetScale 3/k, 3/k Movie.PLACE_SetRotate 36*k Movie.PLACE_AutoRemoveDepth = true Movie.ShowFrame 1 NEXT ' /// translate x,y FOR k = 1 to 20 Movie.PlaceShape Shape3, 1 ' place new image on next depth Movie.PLACE_SetScale 0.3/k, 0.3/k Movie.PLACE_SetRotate 36*k Movie.PLACE_AutoRemoveDepth = true Movie.ShowFrame 1 NEXT Movie.RemoveObject 1 Movie.ShowFrame 5 Movie.EndMovie Movie.SaveToFile "SlideShowWithEffects.swf"
Download source code: