Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative links with getURL()

Status
Not open for further replies.

Cheech

Technical User
Nov 6, 2000
2,933
0
0
EU
I am trying to use getURL to link to a word doc. The file info will be taken from an xml file.
The code below works fine if the absolute path is used but we will running this swf on a dvd and we will not know what the drive letter is in the users pc so we have to use a relative link, unless anyone knows of a way I can simulate the FSO Path within actionscript. Or can anyone spot anything else wrong?
Actionscript:
Code:
var myDoc = docs.childNodes[0].attributes.file;
	doc1_mc.onRelease = function () {
        getURL(myDoc);
}
xml:
Code:
<document desc="doc 1" file="docs\doc1.doc" title ="dogs"/>

Cheech

[Peace][Pipe]
 
With a bit of investigation I have come up with this
Code:
	var myDoc = docs.childNodes[0].attributes.file;
	function searchAndReplace(holder, searchfor, replacement) {
	temparray = holder.split(searchfor);
	holder = temparray.join(replacement);
	return (holder);
}
	doc1_mc.onRelease = function () {
		var myPath = this._url;
		var myreplaced = searchAndReplace(myPath, "myMovie.swf", myDoc);
		getURL(myreplaced);
}

With IEset as the default browser this work perfectly. However if the user has Firefox set as their default you have to click on the link 3 times to get it to work. The first click opens an instance of FF, the second does nothing & then the third gives the Open/Save dialogue box.

Anyone?

[Peace][Pipe]
 
You can use [tt]fscommand exec[/tt] - since you're targeting Windows only you can create a BAT file and execute that.

But the best way is to use one of the wrapper apps available. I'm sure all of them are capable of opening a Word file in Word.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top