Actions
Loading in the Level
When you have published your movie it is compiled in SWF file. If your Flash website or application is large and not necessary user may need all it during single visit it may be wise to keep the content in separate files.
Still it’s possible to manipulate SWF files from one “parent” movie and load them in your page or application. You are accustomed to the concept of layers – where content is placed in “stack” and upper levers cover lower without mixing. The same work for separate Flash files but is called “Levels”.
- Create a file and add several small-size pictures to it. It would be better if you edit it in external editor to make sure that they are small in file size before you import them to Flash
- Place each image to the stage and transform it to a button.
- Now create as many separate flash files as many “thumbnail” images you have and import one larger image in each of them. Give them recognizable names
- Highlight first thumbnail button and enter a script in the Action panel
- To do that select from the lert side of the panel Actions-Browser/Network and drag LoadMovie script to the right part of panel.
- In URL input box enter the name of the large picture file (it should stay in the same folder) with it’s extension, for example pic1.swf. Select number more than 0 for Level – it will place it above the current file with the thumbnails
- Perform the same operation for other thumbnail buttons with the same level number
- Test your movie. After clicking each button big picture will be loaded. Next button will push out previous picture from it’s level
- We added also a button for the title “Our Gallery” . It uses script unloadMovie(10). 10 is number of level where we loaded images. It clear up this level.
Be careful with this script. If you load another file at the 0 level it will clear all the content and fully substitute it with new movie. Be aware that new files are loaded in the left top corner of the “parent” movie and if you want to load it with margins – it is simple to reposition content on the stage of the loaded file.