'This example creates a 15 frame, 1 second looping Flash animation 'sequence as well as the .html file with which to view it using a 'Web browser with a Shockwave/Flash player installed. 'It consists of a single filled path item whose size and opacity 'are animated to create a motion sequence, and leverages the 'capability of Illustrator's Flash export to create frames from 'graphic elements defined in individual layers. Private Sub Command1_Click() Dim frameCount As Integer Dim swfFile As String Dim sourceDoc As Illustrator.Document Dim starItem As Illustrator.PathItem Dim newLayer As Illustrator.Layer Dim exportOpts As Illustrator.ExportOptionsFlash Dim starColor As Illustrator.RGBColor Dim appRef As New Illustrator.Application Set sourceDoc = appRef.Documents.Add(aiDocumentRGBColor) sourceDoc.Layers(1).Name = "Frame 1" Set starItem = sourceDoc.PathItems.Star(300, 400, 50, 20, 4) Set starColor = New Illustrator.RGBColor starColor.Red = 255 starItem.FillColor.RGB = starColor Dim ctr As Integer Dim dupItem As Illustrator.PathItem frameCount = 15 'The original path item (starItem) defined in the "Frame 1" layer 'is duplicated to a new named layer. The effect of the Resize and 'Opacity property changes is to gradually upscale the item while 'making it progressively more transparent. For ctr = 2 To frameCount Set newLayer = sourceDoc.Layers.Add newLayer.Name = "Frame " + CStr(ctr) Set dupItem = starItem.Duplicate dupItem.MoveToBeginning newLayer dupItem.Resize ctr * 100, ctr * 100, scaleAbout:=aiTransformCenter dupItem.Opacity = 100 - (100 / frameCount) * ctr Next ctr 'Flash export options are setup to export each layer as a separate 'compressed animation frame, and to specify a loopoing playback at 'the rate of 15 frames per second Set exportOpts = New Illustrator.ExportOptionsFlash exportOpts.ExportStyle = aiLayersAsFrames exportOpts.FrameRate = frameCount exportOpts.Looping = True exportOpts.ImageFormat = aiLossy exportOpts.ArtBoardClipping = True exportOpts.Replacing = aiSaveChanges 'The .swf and .html files are saved to the Illustrator directory swfFile = appRef.Path + "Animation.swf" sourceDoc.Export swfFile, aiFlash, exportOpts End Sub