-1

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)

Community
  • 1
  • 1
s-rusev
  • 150
  • 1
  • 11
  • 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

1 Answers1

0

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.

Brian
  • 3,850
  • 3
  • 21
  • 37