-
1. Re: associate a file extension with my executable, how to receive filename?
moccamaximum Feb 5, 2014 12:52 AM (in response to Nando Darder Mallorca)if you are using AIR you should look into this:
-
2. Re: associate a file extension with my executable, how to receive filename?
Nando Darder Mallorca Feb 5, 2014 2:52 AM (in response to moccamaximum)Hello, Thank you!
but I don want to do what this example do:
The following code lets the user navigate to an MP3 file and open it in the default application for playing MP3 files.
What I want is:
(I change the example:)
I want to click on a textFile for example hello.txt, with the content: "My name is Fernando"
1 - create an application My_edit_txt.exe (with only one text_field, MY TEXT)
2 - install the application.
3- associate the extension txt to my editor: My_edit_txt.exe
4- when I click on hello.txt,
5- the system launches -> My_edit_txt.exe (so far works ok)
6- then I dont know: Inside My_edit_txt.exe:
Which file clicked the user?
if I knew the file I could read hello.txt and put the text "My name is Fernando" in the textfield MYTEXT.
perhaps this example is better to undestand my question :-)
thanks so much
-
3. Re: associate a file extension with my executable, how to receive filename?
moccamaximum Feb 5, 2014 4:40 AM (in response to Nando Darder Mallorca)As far as I kow what you are trying to do is not exactly possible.
A workaround is to use a LocalConnection
I used this FrameWork:
http://flash.area-network.de/projekte/aslocalconnect/as3/eng/
to pass systemvars to a multilanguage projector so that he would start up with the users system language active.
You should be able to create an air application which you can drag&drop your my_sample.epl on and then the file name is used as a param to launch
your Edit_eplp.exe with this file opened.
-
4. Re: associate a file extension with my executable, how to receive filename?
Nando Darder Mallorca Feb 5, 2014 6:34 AM (in response to moccamaximum)I solve it!
Question:
I want to click on a textFile for example hello.txt, with the content: "My name is Fernando"
1 - create an application My_edit_txt.exe (with only one text_field, MY TEXT)
2 - install the application.
3- associate the extension txt to my editor: My_edit_txt.exe
4- when I click on hello.txt,
5- the system launches -> My_edit_txt.exe (so far works ok)
6- then I dont know: Inside My_edit_txt.exe:
Which file clicked the user?
Resolution:
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
package silbo.esment.general.base_juegos
{
import flash.desktop.NativeApplication;
import flash.display.MovieClip;
import flash.events.InvokeEvent;
import flash.text.TextField;
public class Clip_editor_epl extends MovieClip
{
public var t_texto:TextField;
public function Clip_editor_epl()
{
super();
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
}
function onInvoke(event:InvokeEvent):void {
mitrace("on invoke");
mitrace("arg="+event.arguments);
mitrace("file to open:"+event.arguments[0]);
}
function mitrace(trozo){
if(trozo==null){
trozo="";
}
t_texto.appendText(trozo+"\n");
}
}//clase
}


