SWF Scout |
How to replace links in the existing SWF flash movie using SWF Scout library SWF Scout library is capable of replacing text in actionscript string variables and values in existing flash movies. For example, this can be used to replace all links from one URL to another. In this example we will take existing flash movie with button and will replace all links to http://www.myurl.com to http://www.bytescout.com/ IMPORTANT: clicking on button may not work on some browsers like Internet Explorer as they forbid opening a links in flash movies by default Download source code of this example: swfscout_replacing_url_in_swf_template.zip(2KB) Source flash movie (ButtonWithURL.swf) with button (with actionscript assigned to "press" event) and text edit (before replacement):
Source code of replacement a) links www.myurl.com in actionscript to www.bytescout.com; b) replacing www.myurl.com to www.bytescout.com in all text edit objects: Set Movie = CreateObject("SWFScout.FlashMovie") Movie.InitLibrary "demo","demo" Movie.BeginMovieFromTemplate "PARSEACTIONS://ButtonWithURL.swf",true Movie.AddTemplateRule_Text "www.myurl.com","www.bytescout.com
(replaced)",false Movie.EndMovie Movie.SaveToFile "ButtonWithURL_ReplacedURL.swf" Produced flash movie (ButtonWithURL_ReplacedURL.swf)
Download source code of this example: swfscout_replacing_url_in_swf_template.zip(2KB) |
|
|
||