|
|||
|
Q: In my SWF movie I have several buttons to load external movies, images, sounds, xml files and open local html files. It works quite well. But after I convert it to an exe file using SWFKit, it doesn’t work properly.
A: The reason is that you’re using relative path names. The parameters passed to the loadMovie, loadSound, loadXML or getURL methods are relative path names. That is to say, the path names aren’t absolute path names, but path names relative to a base path. An absolute path name is a path name includes the drive name and the full path name, such as “c:\my documents\my swfs\sample\test.swf”. The relative path name to “c:\my documents\my swfs” will be “sample\test.swf”. The swf movies will be packed into the output exe files if you convert them to exe files by using SWFKit. Then the swf movies cannot find where the external files are when they are preparing to load the external files using relative path names. For the exe files will extract the packed movies to temporary folders, the swf movies won’t be in the same path of the external files. Solution: set the base path of the swf movies using the “Application.setBasePath” method 1.***If the external files are in the same path of the converted exe file, set the base path to the application directory in the “Initialize” script in swfkit Code:
// Set the base path of the main movie to the app dir Application.setBasePath(); // this equals to // var path = getAppDir(); // Application.setBasePath(path); Code:
// Extract the packed attachments var path = getAdditionalFile(); // Set the base path to the path of the attached files Application.setBasePath(path); |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|