SWF Scout |
Playing streaming MP3 music in flash movie generated with SWF
Scout library
Download ZIP with the source code (swfscout_streamSound.zip, 4 KB) SWF Scout provides ability to use built-in ActionScript compiler (requires additional AS License) To create a flash movie with streaming audio we will create a simple flash movie and will place an actionscript code that will initialize Sound object and will load and play flowers.mp3 file as streaming audio ActionScript code is: var mysound:Sound = new Sound(); the second parameter in loadSound() function is IsStreaming. We set it to TRUE to load flowers mp3 as streaming audio. Important note: mp3 audio filename is case-sensitive! To compile this code just pass it to SCRIPT_Compile function and SWF Scout will compile actionscript code using internal ActionScript compiler. Please note that to use ActionScript compiler in registered version of SWF Scout you have to have additional AS License flowers.mp3 is 600KB in size but flash player will
start to play it after few seconds after initial buffering and will
download mp3 while playing. VBScript source code of StreamingSound.vbs example: W = 640 H = 480 Se Movie = CreateObject("SWFScout.FlashMovie") Movie.InitLibrary "demo","demo" 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) Text = Movie.AddText("Playing streaming sound(using
ActionScript) from:",0,0,0,255,Font, 0, 80, 170, 160) Script = Movie.AddScript Movie.SCRIPT_Compile "var mysound:Sound = new Sound(); mysound.loadSound('http://www.bytescout.com/demo/flowers.mp3', true);" ' The Second parameter in mysound.LoadSound is IsStreaming. We set it to TRUE Movie.ShowFrame 1 Movie.EndMovie Movie.SaveToFile "swfscout_StreamingSound.swf" |
|
|
||