Error #2176 Certain Actions
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
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 Flex's FileReference.save() can only be called in a user event handler — http://stackoverflow.com/questions/23828089/should-i-workaround-flex-security-error-2176 how can I get around this? up vote 12 down vote favorite 5 I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing http://stackoverflow.com/questions/3301839/flexs-filereference-save-can-only-be-called-in-a-user-event-handler-how-ca an Error exception." (from the documentation here) This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so then exactly which user events are valid? (Perhaps there's an event that will never be dispatched by user interaction with my application and I could register an event handler function for that event type and make the save() call from within that function?) My difficulty is that I can't safely call the FileReference.save() method until my web service returns with the data that will be used as the argument of the FileReference.save() method call, so the event that triggers the FileReference.save() call is actually a ResultEvent rather than a user event, and I'm leery of dispatching a new (faux) user event type in order to be able to trigger the FileReference.save() call unless it's definitely a user event that would never be dispatched as a result of actual user interaction with my application. In a nutshell what I'm doing now is this: I have a function that is registered as a handler for a button click. In this function I make
ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError: You don't have JavaScript enabled. https://forums.adobe.com/thread/787945 This tool uses JavaScript and much of it will not http://www.bogdanmanate.com/2010/05/12/flex-error-2176-when-using-filereference/ work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in ActionScript 3 All CommunitiesAdobe error #2176 Animate CC - HomeActionScript 3 2 Replies Latest reply on Feb 6, 2011 3:52 PM by icecappacino SecurityError: Error #2176 icecappacino Feb 6, 2011 11:33 AM Hey guys,I'm using AS3 and the FB Graph API to upload bitmap data to facebook. However,on a MouseEvent.CLICK event I get the following error #2176 certain errorSecurityError: 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::URLStream/load()at flash.net::URLLoader/load()at com.facebook.graph.net::FacebookRequest/loadURLLoader()[D:\Work\cartoon\com\facebook\grap h\net\FacebookRequest.as:372]
This is weird because it was triggered by an onclick. In psuedo codeuser clicks uploadI encode datawhen this is finish I send to facebook apiI guess I should note that the encoding process also triggers and event and passes tru several steps again before reaching the facebook apiIs there anyway to keep the mouse event within the calls stack? I have the same question Show 0 Likes(0) 3373Views Tags: none (add) This content has been marked as final. Show 2 replies 1. Re: SecurityError: Error #2176 kglad Feb 6, 2011 11:55 AM (in response to icecappacino) copy your real code that executes your pseudo-code steps. Like Show 0 Likes(0) Actions 2. Re: SecurityErr12, 2010 by Bogdan Manate The flash player 10 has new rules for UIA ( user initiated action ) so when I tried to use the FileReference save method I got the following error: 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 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 the application.