Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-22-2007, 01:09 AM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Getting version information

Is there an FFish mechanism to get the application version? (ie the version number as it appears in the About box)

Also according to Help, the FlashPlayer.getMovieInfo(movie) method returns an object with several properties, one of which is supposed to be "version". I am finding this property is "undefined". Do I need to set a version property in the swf file? If so, how?

Thanks
Reply With Quote
  #2 (permalink)  
Old 08-22-2007, 01:35 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Getting version information

To get the version of an application, please use the Shell.getFileVersionInfo method, as shown in the following code:
Code:
var x = Shell.getFileVersionInfo(
  "c:\\WINNT\\system32\\Macromed\\Flash\\flash.ocx");
trace("Comments: " + x.comments);
trace("CompanyName: " + x.companyName);
trace("FileDescription: " + x.fileDescription);
trace("FileVersion: " + x.fileVersion);
trace("InternalName: " + x.internalName);
trace("LegalCopyright: " + x.legalCopyright);
trace("LegalTrademarks: " + x.legalTrademarks);
trace("OriginalFilename: " + x.originalFilename);
trace("PrivateBuild: " + x.privateBuild);
trace("ProductName: " + x.productName);
trace("ProductVersion: " + x.productVersion);
trace("SpecialBuild: " + x.specialBuild);
The "FlashPlayer.getMovieInfo" method can only get the version of a swf file. For example, if a swf is built for flash player 7, its version will be 7.
Reply With Quote
  #3 (permalink)  
Old 08-22-2007, 08:43 AM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Re: Getting version information

Thanks for the reply. My question is how to get the version of my _own_ application created with SWFKit. ie the field that's entered in the Application definition - Information tab (which is the same information as displayed in the About box).

I see that I could get it with the Shell.getFileVersionInfo method if I knew the name and location of my compiled application. So how does a program get it's _own_ program name in FFish Script?
Reply With Quote
  #4 (permalink)  
Old 08-22-2007, 09:12 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Getting version information

Code:
var info = Shell.getFileVersionInfo(getExeName());
trace(info.productVersion);
Reply With Quote
  #5 (permalink)  
Old 08-22-2007, 01:01 PM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Re: Getting version information

Thanks very much - I'd forgotten the getExeName method. Great program! Great service!
Reply With Quote
  #6 (permalink)  
Old 08-23-2007, 12:10 AM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Re: Getting version information

Sorry - now I have a further problem/bug? related to this.

There seems to be something "non-standard" about the property values of the getFileVersionInfo object. If I take from your example

var x Shell.getFileVersionInfo("c:\\Windows\\system32\\M acromed\\Flash\\flash.ocx");
trace("CompanyName: " + x.companyName);
>>CompanyName: testMacromedia, Inc.
as expected.

But if I try to manipulate that string by standard methods eg

trace("CompanyName: " + "string added to start " + x.companyName + " string added to end");
>>CompanyName: string added to start Macromedia, Inc.
ie the string added to the end is missing

I suspect that the property values being returned by getFileVersionInfo are/aren't null terminated or whatever FFish Script requires.

Help/fix will be appreciated.

Thanks.
Reply With Quote
  #7 (permalink)  
Old 08-23-2007, 04:02 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Getting version information

Yes, the "companyName" property contains an extra null character, but ffish script strings are not null terminated. Please apply the following patch to fix the problem:
http://www.swfkit.com/download/swfkit/propatch.zip

To apply the patch, please extract the files into "c:\program files\swfkit pro 3\data" and replace the old files. Really sorry for the inconvenience.
Reply With Quote
  #8 (permalink)  
Old 08-23-2007, 07:54 AM
RJS RJS is offline
Member
 
Join Date: Sep 2003
Posts: 56
Default Re: Getting version information

Great! That's fixed it.
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 04:31 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.