Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2005, 11:08 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Q & A: Why my SWF movie doesn’t work properly in SWFKit?

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);
2.***If the external files are added into the attachment list in swfkit, extract the packed files and set the base path to the path of the unpacked files
Code:
// Extract the packed attachments
var path = getAdditionalFile();
// Set the base path to the path of the attached files
Application.setBasePath(path);
It is a SWFKit 2 problem. In SWFKit V3, there is not such a path problem, and hence generally you need not call the setBasePath method
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:47 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.