{"action":"created","issue":{"url":"https://api.github.com/repos/openfl/openfl/issues/1258","repository_url":"https://api.github.com/repos/openfl/openfl","labels_url":"https://api.github.com/repos/openfl/openfl/issues/1258/labels{/name}","comments_url":"https://api.github.com/repos/openfl/openfl/issues/1258/comments","events_url":"https://api.github.com/repos/openfl/openfl/issues/1258/events","html_url":"https://github.com/openfl/openfl/issues/1258","id":175200746,"number":1258,"title":"openfl.net.FileReference error","user":{"login":"r3d9u11","id":15020827,"avatar_url":"https://avatars.githubusercontent.com/u/15020827?v=3","gravatar_id":"","url":"https://api.github.com/users/r3d9u11","html_url":"https://github.com/r3d9u11","followers_url":"https://api.github.com/users/r3d9u11/followers","following_url":"https://api.github.com/users/r3d9u11/following{/other_user}","gists_url":"https://api.github.com/users/r3d9u11/gists{/gist_id}","starred_url":"https://api.github.com/users/r3d9u11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r3d9u11/subscriptions","organizations_url":"https://api.github.com/users/r3d9u11/orgs","repos_url":"https://api.github.com/users/r3d9u11/repos","events_url":"https://api.github.com/users/r3d9u11/events{/privacy}","received_events_url":"https://api.github.com/users/r3d9u11/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-06T09:27:33Z","updated_at":"2016-09-06T14:09:30Z","closed_at":null,"body":"Hi. I have some error, when I try to open file dialog.\r\n\r\nHaxe: 3.2.1\r\nNeko 2.1.0\r\nHaxelib:\r\n```\r\n   actuate: 1.8.6 [1.8.7]   \r\n   hxcpp: 3.2.205 [3.3.49]\r\n   openfl-html5: [1.0.5]\r\n   openfl-native: [1.4.0]\r\n   openfl-nativedialog: [1.2.0]\r\n   openfl-ouya: [1.0.2]\r\n   openfl-samples: [4.0.0] 3.3.1\r\n   openfl: 4.0.3 [4.1.0] 3.6.1\r\n   lime-samples: [2.6.0]\r\n   lime-tools: [1.5.7]\r\n   lime: 2.9.1 3.0.3 [3.1.0]\r\n```\r\nOS: Linux Mint 18 x64\r\n\r\nMain.hx:\r\n```\r\npackage;\r\n\r\nimport openfl.events.*;\r\nimport openfl.display.*;\r\nimport openfl.net.FileFilter;\r\nimport openfl.net.FileReference;\r\n\r\nclass Main extends Sprite {\r\n\tpublic function new () {\r\n\t\tsuper();\r\n\t\tthis.onLoadProjBtnClick();\r\n\t}\r\n\t\r\n\tfunction onLoadProjBtnClick () : Void {\r\n\t\tvar loadRef:FileReference = new FileReference();\r\n\t\tloadRef.browse([new FileFilter('XML', '*.xml')]);\r\n\t\tloadRef.addEventListener(Event.SELECT, function(e:Event) cast(e.target, FileReference).load());\r\n\t\tloadRef.addEventListener(Event.COMPLETE, function(e:Event) trace('selected: ${e.target.data}'));\r\n\t}\r\n}\r\n```\r\n\r\nIf target is neko, then I have error after launching compiled program:\r\n```\r\nAn exception occured in a neko Thread :\r\n./lime@lime_file_dialog_open_file\r\n```\r\n\r\nIf target is cpp, then nothing happens: have no errors, but and the dialog doesn't displays.\r\n\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/openfl/openfl/issues/comments/244961734","html_url":"https://github.com/openfl/openfl/issues/1258#issuecomment-244961734","issue_url":"https://api.github.com/repos/openfl/openfl/issues/1258","id":244961734,"user":{"login":"MSGhero","id":5033927,"avatar_url":"https://avatars.githubusercontent.com/u/5033927?v=3","gravatar_id":"","url":"https://api.github.com/users/MSGhero","html_url":"https://github.com/MSGhero","followers_url":"https://api.github.com/users/MSGhero/followers","following_url":"https://api.github.com/users/MSGhero/following{/other_user}","gists_url":"https://api.github.com/users/MSGhero/gists{/gist_id}","starred_url":"https://api.github.com/users/MSGhero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSGhero/subscriptions","organizations_url":"https://api.github.com/users/MSGhero/orgs","repos_url":"https://api.github.com/users/MSGhero/repos","events_url":"https://api.github.com/users/MSGhero/events{/privacy}","received_events_url":"https://api.github.com/users/MSGhero/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T14:09:30Z","updated_at":"2016-09-06T14:09:30Z","body":"In flash, the file reference object has to be a class-level variable. If it's a local variable like yours, the variable loses scope once the function ends, and the request is not followed through. \n\nMaybe the behavior is the same on the other targets. "}}
{"actor":{"display_login":"MSGhero"}}