Packing & Extracting Files


 

Step 1

 

Create a new file in Adobe Flash (or your preferred SWF Authoring tool) and create a new button on the canvas. With the button selected, expand the Actions Window and enter the following code:

 

 

       on(release){        

               packedFile = "myFile.txt";

               extractedFile = mdm.System.Paths.desktop+"myFile.txt";

               mdm.Application.Library.extractToFile(packedFile, extractedFile);

       }

 

 

Create a second button, and attach the following code to it:

 

 

       on(release){        

               packedFile = "myPic.tif";

               extractedFile = mdm.System.Paths.temp+"myPic.tif";

               mdm.Application.Library.extractToFile(packedFile, extractedFile);

       }

 

 

Each of these two buttons extracts a different packed file to a different location. The first is extracting a TXT file to the DESKTOP whilst the second button is going to extract a TIF file to the users TEMP directory. Notice that we use the {mdm}Script™ 2.0 Properties to retrieve the Desktop and Temp Paths.

 

Continue to Step 2