Error 2176 Flex
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Should I workaround Flex security error 2176 up vote -1 down vote favorite I got the following error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press. I found a similar thread here and the short explanation of the problem is: Adobe does this as a sort of security measure to ensure users are the ones messing with files rather than potentially harmful code However this thread doesn't answered my questions and that's why I am asking here: 1) Is there a good reason for me getting this error and is it really a security issue (and if so - maybe I shouldn't workaround it?). 2) What are the potential consequences if I do my workaround (I am asking because obviously Adobe decided that it shouldn't be workaround-ed) actionscript-3 security flex share|improve this question asked May 23 '14 at 11:31 s-rusev 85110 1 We don't have many clairvoyants over here, you'll have to show what you are doing to receive that error in the first place, and explain how you're planning to workaround it. –ndm May 23 '14 at 11:39 I will use the workaround with the two event listeners for the events MOUSE_DOWN and MOUSE_UP mentioned in the other thread. I am getting the error when I manually dispatch an MouseEvent.CLICK on a button that invokes action that goes trough the files. Maybe I wasn't clear enough - my concern is whether it is a good idea to workaround something that obviously isn't supposed to be workaround-ed and how this can do any harm. –s-rusev May 23 '14 at 12:02 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted No, don't try to work around it. Flash isn't allowed to download arbitrary files to your hard drive for some very good reasons. Instead, just use FileReference.download(). The Adobe docs talk more about it. Then you can trigger the download on the user's click. share|improve this answer answered May 30 '14 at 6:30 Brian 2,8363930 add a comment|
kolisko Latest reply from kolisko Tags: FileReference kolisko Novice BirdJoined: Aug '13Posts: 12 kolisko Novice BirdJoined: Aug '13Posts: 12 Hi, Could you help me please how to call FileReference.browse correctly from feathersUI? I have following code addPictureBtn = new Button(); addPictureBtn.label = "Album Picture"; addPictureBtn.name = Theme.SMALL_BOLD_BLUE; addPictureBtn.addEventListener(starling.events.Event.TRIGGERED, function onClick(event:starling.events.Event):void { // _data = new Object(); // hack aby se v draw() metode nespoustela clear() fileReference http://stackoverflow.com/questions/23828089/should-i-workaround-flex-security-error-2176 = new FileReference(); fileReference.browse(); }); And I get this error [Fault] exception, information=Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press. at flash.net::FileReference/browse() Posted 2 years ago # Val Senior http://forum.starling-framework.org/topic/error-2176-when-trying-call-filereferencebrowse-from-button-triggered-handler BirdJoined: Mar '13Posts: 129 Val Senior BirdJoined: Mar '13Posts: 129 it's a security reason ....i think you need to do that same way it was done in flex.... Posted 2 years ago # kolisko Novice BirdJoined: Aug '13Posts: 12 kolisko Novice BirdJoined: Aug '13Posts: 12 Thank you Val. I found this thread http://forum.starling-framework.org/topic/saving-loading-files#post-10560 and tried to write similar code to my app var obj:DisplayObject = this.hitTest(new Point(event.localX, event.localY), true); try { if (addPictureBtn.contains(obj)) { fileReference = new FileReference(); fileReference.browse(); } } catch (e:Error) { trace(e); } But always when click on addPictureBtn, the hitTest method returns ScrollContainer. My button and everything on the page is wrapped to the ScrollContainer. So how can I get reference to my addPictureBtn component when it is clicked? Thank you. Posted 2 years ago # kolisko Novice BirdJoined: Aug '13Posts: 12 kolisko Novice BirdJoined: Aug '13Posts: 12 I tried to remove "if" condition o
12, 2010 by Bogdan Manate The flash player 10 has new rules for UIA ( user initiated action ) so when I http://www.bogdanmanate.com/2010/05/12/flex-error-2176-when-using-filereference/ tried to use the FileReference save method I got the following error: https://issues.apache.org/jira/browse/FLEX-30375 Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press. After I made some research I found a very cool article here, but I didn't found error 2176 any workaround. Dispatching a MouseEvent won't work, because the user must interact with the application by clicking a mouse button or by pressing a keyboard key. I found a way to get rid of this error by displaying a popup and let the user to click a button in order to force the user to interact with error 2176 flex the application.
scripts to work without encountering Error #2176 for FileReference operation restrictions imposed by Flash player 10 Security