Useful Tips

How to download external SWF files for Adobe Flash Player

Pin
Send
Share
Send
Send


Files with the extension .swf are designed to display vector graphics and animations in all modern browsers with a Flash player installed. Simply put, these are flash videos with which you can watch beautiful ads on the Internet, small browser games, original presentations and other types of animated media content. It is logical that users, having seen an interesting and beautiful flash movie, are looking for the answer to the question of how to download swf from the site so that the content they like is not lost in the vast expanses of the Internet.

There are several different save swf files. Consider the most simple and affordable.

    Using the Mozilla Firefox Browser. Launch a browser and open the web page in which you want to download the swf file. In any empty place on this page, right-click and in the context menu that appears, select Page Information.

In the window that opens, go to the tab Multimedia. Select the first line in the field Address and scroll through the list of multimedia files until you find the address with the extension .sfw. Press button Save as and download this file to the specified location on the disk.

With the free Flash SWF Downloader extension for Google Chrome. Previously, you need it from the online application store for Chrome. Open it at https://chrome.google.com/webstore/category/apps in the Chrome browser and enter the query in the search bar Flash SWF Downloader. After the application is found, click Is free to install it.

Confirm adding a new extension.

After installing the application, open or go to the web page from which you want to download the flash movie. Click the extension icon to the right of the browser address bar. In the application window that opens, a list of all SWF files found on the page will be displayed. Select the one you need and press the button Download.

When prompted by the browser security system, confirm the file is saved.

The easiest way to find the downloaded swf file on your computer is through managing downloads from a browser by pressing a key combination Ctrl + J. By clicking on the link Show in Folder You can view the file in the directory in which it was saved. Typically this will be the user's Downloads folder.

Using the Loader Class in ActionScript 3.0

The Loader class in ActionScript 3.0 is a subclass of the DisplayObject that is used to load and display external content. To load the SWF file, use the load method of this class. The load method requires one parameter — an instance of URLRequest containing the URL of the content to load.

The following code example creates an instance of Loader and loads a SWF file called myExternalMovie.swf.

The URL of the downloaded SWF file can be relative or absolute. See the Relative Paths section below for details on how Flash Player handles URLs. For details on the Loader class, see the Loader section of the ActionScript platform language reference.

When referring to root, we mean the topmost object in the part of the screen, which displays the tree structure of the list indicating the SWF file. (As for images, root refers to the Bitmap object.)

Note. In ActionScript 3.0, there is no equivalent for the _lockroot and _level properties in ActionScript 2.0. See Display Programming Fundamentals in the ActionScript 3.0 Developer's Guide.

Related Content for ActionScript 3.0:

  • Sample files for this technical note. A set of 3 FLA files and three corresponding SWF files, including the parent SWF file and two SWF files that it downloads.
  • Help> AS3 Developer's Guide> Downloading an External SWF File
  • Help> AS3 Developer's Guide> Dynamically Loading Displayed Content
  • Uploading multiple external SWF files to the main SWF file - CreativeCow.net forums
  • Video tutorial: ActionScript 101 - Series 6. Adding named objects to the workspace. Posted by Doug Winnie An example of how to add a loaded external resource to the workspace and change its position or other properties.
  • Guide: Downloading and uploading SWF files - FlashAndMath.com

Using the loadMovie Command in ActionScript 2.0

Using the loadMovie command in ActionScript 2.0 loads an external SWF file or image in MovieClip or another layer of the parent movie.

The loadMovie commands have two different forms:

  • MovieClip.loadMovie Method: The MovieClip method is used to load external content into a special movie instance.
  • Global function loadMovie: The global loadMovie function can be used to load content into movies and levels. There are also two options for the global version - loadMovie and loadMovieNum. When using the first option, the content is loaded into films or into levels, and when using the second (loadMovieNum) - only into levels.

MovieClip.loadMovie

Adobe recommends loading Movie Content into movie instances using the MovieClip loadMovie method. This version of the command can be invoked directly in the movie into which you want to load the content by pasting the content URL.

The URL of the downloadable content can be relative or absolute. See the Relative Paths section below for details on how Flash Player handles URLs.

When loaded, the contents are displayed inside the container roller. The location, as well as other basic properties of the container roller, are preserved. However, all user-defined properties or functions defined in the container clip are deleted. The new content replaces all previous content (including codes and event handlers, such as onRelease). Therefore, you cannot use the onLoad event handler for the movie. In this case, you can use the MovieClipLoader class instead (see below). For more information about MovieClip.loadMovie, see MovieClip.loadMovie in the ActionScript 2.0 Language Reference.

Global functions loadMovie and loadMovieNum

The loadMovie command is also used as a global function. This function requires two parameters - the URL of the external content and the destination into which it is loaded. The target parameter can be a string or a link. Using the following lines is equivalent to loading the myExternalMovie.swf file into a movie instance called myContainer:

By using the loadMovie command, you can also load content into different levels of Flash Player. Levels in Flash Player are similar to player layers. You can play multiple movies in one instance of Flash Player without layering one movie on another. Each level represents a unique root object in which movies are played independently of other levels (there is no need to use _lockroot).

You can reference layers in ActionScript by using the _level command followed by a number that indicates the number of the layer. The first movie uploaded to Flash Player is at _level0 level. Additional levels can be added on top of this level. The next time you loadMovie, the file myExternalMovie.swf is loaded at level 1 at the top of the current movie being played in the player.

Another variation of the global loadMovie function is loadMovieNum. This method is similar to the loadMovie method except that levels are specified by number, not by name. To upload an external SWF file, for example, to level 1 (_level1), use the following guide:

Adobe recommends using the loadMovieNum command rather than loadMovie when loading into levels. For more information, see the global loadMovie section of the ActionScript 2.0 Language Reference.

Using _lockroot to prevent _root conflicts

When you load an external movie into another movie, the _root link timeline of the downloaded movie changes to the timeline of the movie in which it is loaded. In other words, _root always refers to the topmost timeline in the hierarchy. If you do not want _root to refer to the topmost timeline, set the _lockroot property on the main timeline of the downloaded movie to true. Due to this property, all child films from this timeline, referring to _root, also refer to this timeline.

Note.When published to Flash Player 7 or later, the _lockroot property is the only available property.

Pin
Send
Share
Send
Send