Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-04-2007, 01:14 AM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Commandline program

Need help again

I'm making a frontend like Windows Media Center but doing so I need to give commandlines to programs to open files. For example I should be able to do:
Paint.exe -sample.bmp

Where sample.bmp is the file it should open when executed, works great but...sample.bmp should be in the directory where Paint.exe is located, right now it thinks the folder where the SWFkit project is executed is 'home' and looks for sample.bmp there.

Help?
Reply With Quote
  #2 (permalink)  
Old 11-04-2007, 01:18 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Commandline program

Code:
var filename = getFullPathName(Application.cmdItems[0]);
trace(filename);

function getFullPathName(fname) {
	var index = fname.indexOf(":");
	if (index >= 0) return fname;
	
	return getAppDir() + fname;
}
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:37 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.