Main : Files Tab

The SWF Studio Layout allows you to bundle files, referred to as "Resources", directly into your application. This way, rather than distributing your application with a number of separate support files, you can ship a single EXE or SCR file with all the resources embedded within it.

File resources can be marked at either AutoExtract or No AutoExtract. AutoExtract files are extracted to a randomly named temporary folder when your application starts. Files marked as No AutoExtract remain inside the application, but can be accessed at any time using ssCore.Layout.extractFile to extract a file resource to the location of your choice. You can also use use ssCore.Layout.loadFile to load the contents of a file resource directly into a Flash variable without extracting it to disk.

For example, to extract a file resource named "file08.dat" (from the resource list in the snapshot shown below) you have to tell ssCore.Layout.extractFile which resource to extract and where to place it. The following command would extract file08.dat and copy it to the folder where your application was started from (using the "startdir://" file moniker).

ssCore.Layout.extractFile({resource:"\\autoextract encrypted\\file08.dat", destination:"startdir://file08.dat"});

Note: Don't refer to "Layout" in a resource reference, all resource paths start with a backslash.

Resources

1. The Layout item is the root of the Resources treeview and can't be moved, deleted or renamed. When you start a new project, this will be the only item in the treeview. When you right click on the Layout item or press the F10 key or the Shift+F10 key you will see a menu like the ones below (depending on whether the Layout has children or not). The items on this menu allow you to add new files and folders or change properties of the child items.

2. Folder resources are not really stored as part of the layout, they exist only as containers for file resources and do not correspond to physical folders. The names you assign to folders become part of the paths to the file resources they contain. When you allow file resources to be extracted automatically, the folder structures under the Layout will be recreated to hold the files in the temporary folder.

File resources (3, 4, 5 and 6) are links to physical files that you want SWF Studio to embed in your application. When you add a file to the layout, SWF Studio gives the file resource the same name as the physical file, but you can change the name of the file resource to whatever you like. The name of the file resource (as it appears in the layout) is the name that will be given to the file resource when it is extracted automatically. When you extract a file resource manually using ssCore.Layout.extractFile you can give the file whatever name you like.


3. File resources marked as AutoExtract and No Encryption will be automatically extracted to the temporary folder when your application starts and will be available for use as soon as your application starts. When you display the right click menu for this type of file resource you will be presented with the list of options displayed on the left. These options are fully explained below.

4. File resources marked as AutoExtract and Encrypted will be automatically extracted to the temporary folder when your application starts and will be available for use as soon as your application starts. When you display the right click menu for this type of file resource you will be presented with the list of options displayed on the left. These options are fully explained below. Although you can Encrypt files that are marked for AutoExtract there really isn't much point in encrypting files that will be extracted to the hard drive at startup. Encrypting these files offers no additional protection and just consumes additional CPU cycles and time at startup.

5. File resources marked as No AutoExtract and Encrypted are fully protected resources because they are not extracted automatically and remain safe inside your application until you extract or load them. When combined with SWF Studio's secure loading features you achieve the maximum possible protection for your files because they can be loaded directly into Flash without ever touching the disk. When you display the right click menu for this type of file resource you will be presented with the list of options displayed on the left. These options are fully explained below.

6. File resources marked as No AutoExract and No Encryption are protected resources, but not fully protected because they are not encrypted. Without encryption there is the possibility that a hacker could locate this file resource in your application. This is extremely unlikely but possible. Use these settings on file resources that you want to protect from casual hackers or when you protection is not as important as maximum access speed. For files under 1MB the additional overhead added by encryption will not make a noticeable difference so this option will probably not be used often. When you display the right click menu for this type of file resource you will be presented with the list of options displayed on the left. These options are fully explained below.

7. As you mouse over the file resources in the treeview, SWF Studio displays summary information about the file. At a glance you can see the path to the file, whether it is marked for autoextraction or not, whether it is encrypted or not and the file size. Tooltip information is not displayed for the Layout item or folder items. Note: All resources are compressed before they are added to your application to the size you see here may not accurately reflect the space required in the output file.

Adding Resources to the Files Tab

When the Files tab is selected, you can drag and drop files and folders onto the SWF Studio interface to add files to your application. If the Files tab is not selected, SWF Studio use special rules for ICO and SWF files to determine what you might want to do with those files (like make an SWF file your new main movie). It's always best to select the Files tab before using drag and drop to add files to your application. You can right click on the treeview or press Insert, F10 or Shift+F10 to display the Add Files/Folders context menu. You may see a slightly different menu depending on the currently selected item in the treeview, but Add File and Add Folder will be present on all of them.

When you drag and drop a folder in the Layout, SWF Studio scans the file system and creates a copy of that folder along with the entire list of files and subfolders in the treeview. SWF Studio doesn't actually copy the files and folders it just creates a link to the physical objects. When you build your project, SWF Studio gathers up all the files under the Layout item and adds them to your output file. Empty folders are ignored and not added to the output file.

Menu Item : Edit Path

The Edit Path dialog box (below) allows you to change the file that is assigned to the selected file resource. If you added this file resource manually then the path will be empty when this dialog is first opened. If you used drag and drop to create this resource by adding a file to the layout then the path will point to the file you added.



1. This is the path to the physical file that will be assigned to this resource. You can supply an absolute path or a relative path to the file.

2. Opens a standard Windows File Open dialog that allows you to select a file. If the edit path is already populated, that value will be used to initialize the start directory for the File Open dialog, otherwise the system default folder will be used. If you enter the file path manually, you can make sure the file exists by mousing over the file in the layout. If the file does not exist, the tip you see will look like this (below) and an error will be generated in the build results when you build the project.



3. Saves your changes to the path and updates the resource.

4. Abandons your changes to the path and leaves the resource unmodified.

Menu Item : Add Files

Opens a standard Windows File Open dialog that allows you to select one or more files to be added to the layout. You can select multiple files by holding down the Ctrl key or the Shift key as you click on files. The File Open dialog only allows you to select files from one folder at a time, to add files from different folders just choose the Add Files option from the menu again. All the files you select will be added as children to the item that was selected when you selected the Add Files option (the Layout item or a Folder).

Menu Item : Add Folder

Immediately adds a new child folder called "New Folder" or "New Folder (2)", or "New Folder (3)" etc. You can change the name of the newly added folder by selecting it and pressing F2 (rename) or by right clicking on the new folder and choosing the Rename option.

Menu Item : Remove

Removes the selected item. If the selected item is a folder, all of that folders children will also be removed. Depending on the confirmation settings you have selected, you may be prompted to confirm the file or folder delete operation.

  

Menu Item : Rename

Selecting the rename option makes the file or folder name editable. When you are done renaming the file simply press enter. Press the Esc key to cancel the rename operation. You can also activate the Rename feature by pressing the F2 key with a file or folder selected.

Renaming a file resource does not change the physical file that will be attached to the resource, but when the file is extracted automatically, the name of the resource will be given to the file instead of the actual physical file name. Using this feature you can change the physical file attached to a resource without affecting your project.

So if you have an AutoExtract SWF file resource with a name like "test.swf", this is the name you use in Flash loadMovie calls like mc.loadMovie("test.swf") because SWF Studio will give that name to the resource when it is extracted. However, using the Edit Path feature you could make this resource point at a file with a completely different name like "debugtest.swf", or "releasetest.swf" allowing you to use assign different SWF files to the resource for testing etc.

Menu Item : AutoExtract

Change the selected item's status to AutoExtract. If the selected item is a folder, all of that folders children will also be changed. Depending on the confirmation settings you have selected, you may be prompted to confirm the status change operation.

Menu Item : No AutoExtract

Change the selected item's status to No AutoExtract. If the selected item is a folder, all of that folders children will also be changed. Depending on the confirmation settings you have selected, you may be prompted to confirm the status change operation.

Menu Item : Encrypt

Change the selected item's status to Encrypt. If the selected item is a folder, all of that folders children will also be changed. Depending on the confirmation settings you have selected, you may be prompted to confirm the status change operation.

Menu Item : No Encryption

Change the selected item's status to No Encryption. If the selected item is a folder, all of that folders children will also be changed. Depending on the confirmation settings you have selected, you may be prompted to confirm the status change operation.

Keyboard and Mouse Shortcuts

F2Rename selected file resource or folder.
F10Show menu (same as right clicking).
Shift+F10Show menu (same as right clicking).
InsertShow the Add Files/Add Folders menu. This only works when the Layout item or a folder is selected.
DeleteDelete the selected file resource or folder. In the case of a folder, the children will also be deleted.
Double ClickToggle the AutoExtract flag.
Shift+Double ClickToggle the Encryption flag.
Right ClickShow menu.