MAC Desktop "execution error: no user interaction allowed"

Hi all,

out of the blue I get this strange error when I try to show a file dialog. No code changes on my side and it was still running fine when I last complied (neko64) 5 days ago.

I’m on OSX 10.12. openfl 4.9.2/lime 4.0.3 - ((5.0.0)/4.1.0 produce the same result.)

Any ideas? I’m really at a loss as to what is happening.

Ok, clearing out the files from previous compiles solved it, but I still have not idea why this happened …

Unfortunately, the problem is back with a vengeance. Now, no amount of cleaning out helps. All I’m getting now is the error.

Please help!

What I tried:

  • going back to 4.9.2/4.0.3
  • Cleaning out all complied flies manually
  • compiling with “-clean”

it seems to be a problem that crops up every now and then:

I just updated “tinyfiledialogs”, which we use for dialog boxes. Perhaps the newer version resolves this problem?

If not, we’ll need to try and patch it ourselves

I just tried with the current git openfl - same problem. However, I do not see any commits about tinyfiledialogs. Did I get the wrong version?

You would need to use a GIT version of Lime, and git submodule update before running lime rebuild mac :slight_smile:

So I followed your instructions, using git versions of openfl and lime, updated submodules and lime rebuild mac

Now I get this error:

Assets.hx:413: [Assets] There is no String asset with an ID of “libraries/library.json”

Got it running - this is what I see now:

  1. get the file dialog box
  2. I select a file and open it
  3. the select event never seems to fire

This sample appears to be working:

package;


import lime.ui.FileDialog;
import openfl.display.Sprite;


class Main extends Sprite {
	
	
	public function new () {
		
		super ();
		
		var sprite = new Sprite ();
		sprite.graphics.beginFill (0xFF0000);
		sprite.graphics.drawRect (0, 0, 100, 100);
		addChild (sprite);
		
		addEventListener ("enterFrame", function (_) sprite.x += 0.5);
		
		var dialog = new FileDialog ();
		dialog.onSelect.add (function (path) trace (path));
		dialog.browse ();
		
	}
	
	
}

Are you using FileDialog, or FileReference?

OpenFL FileReference uses Lime FileDialog internally. If FileDialog works but FileReference does not, let me know what your code looks like and I can look into it

This is what I have (and it worked fine before):

private function showDialog():Void{
	trace("showDialog");
	file = new FileReference();
	var textFileTypes:FileFilter = new FileFilter("Text (*.txt)", "*.xml");
	 
		file.browse([textFileTypes]);
		file.addEventListener(Event.SELECT, selectFile);
	}
	 
private	function selectFile(e:Event):Void
	{
		trace("file selected"+file);
		file.addEventListener(Event.COMPLETE, loadFile);
		file.load();
	}

private	function loadFile(e:Event):Void{
		
		storyXML = Std.string(file.data);
        processStory(storyXML);

	}

Thanks for the code

Could you try my sample code real quick, and see if it traces the file path you select? That will help us know if it is an OpenFL or a Lime issue

Yes, your code works fine and traces the path

Hmm, this worked for me… I’m on Linux right now, though:

package;


import openfl.display.Sprite;
import openfl.events.Event;
import openfl.net.FileFilter;
import openfl.net.FileReference;


class Main extends Sprite {
	
	
	private var file:FileReference;
	
	
	public function new () {
		
		super ();
		
		showDialog ();
		
	}
	
	
	private function showDialog():Void{
		trace("showDialog");
		file = new FileReference();
		var textFileTypes:FileFilter = new FileFilter("Text (*.txt)", "*.xml");
	
		file.browse([textFileTypes]);
		file.addEventListener(Event.SELECT, selectFile);
	}
		
	private	function selectFile(e:Event):Void
	{
		trace("file selected"+file);
		file.addEventListener(Event.COMPLETE, loadFile);
		file.load();
	}

	private	function loadFile(e:Event):Void{
		
		var storyXML = Std.string(file.data);
		trace (storyXML);
		//processStory(storyXML);
		
	}
	
	
}

Oh, try and listen to Event.SELECT before you call file.browse, it might be occurring synchronously on your system

I tried listening for the event before and after. Does not make a difference.

I am using development builds of both Lime and OpenFL, what versions are you using?

Same - latest git versions of both

I’m using the latest macOS version, are you running an older one? I can’t think of what else would be different

I’m running OS Sierra 10.12.6

Hm. Ok this is what I see now. Essentially the COMPLETE event after loading does not seem to fire, even though all data is there in the trace after the load command

private function showDialog():Void{
	trace("showDialog");

	file=new FileReference();
	var textFileTypes:FileFilter = new FileFilter("Text (*.txt)", "*.xml");
	 			
		file.addEventListener(Event.SELECT, selectFile);
		file.browse([textFileTypes]);
	}

//above works
 
private	function selectFile(e:Event):Void
	{
		trace("file selected"+file.name+" data"+file.data); //file.data = null
		
		file.addEventListener(Event.COMPLETE, loadFile);
		file.load();
		trace("file selected"+file.name+" data"+file.data); //file.data is there, so loading does work.
	}

Not sure what the problem is but the original error is back. I clean installed HAXE 3.2.1 and openfl and currently are at 6.1.2/5.5.0.

For now I’ve switched to systoools for the dialog function which seems to work fine.