views:

49

answers:

2

The current workflow is as follows:

user clicks a button
  sends a Loader to see if the user has permission
  if the user has permission
    uploads a file

Unfortunately, this gives:

SecurityError: 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.

It appears that as a security feature, Flash 10 disallows certain functions (such as uploading a file) unless it is preceded by a mouse click or button press. However, since I am first loading the request for permission, it no longer see the MouseEvent event (presumably in the stack) and thus throws a SecurityError.

Any solutions for getting around it?

+1  A: 

Make your workflow

user clicks a button
    uploads a file

listen for file upload security issue
    report issue
Cory Petosky
Makes sense. Unfortunately, the API doesn't report any issue - if you don't have permission for it, it will not fail, just does a subset of what it should do..
Timmy
Not knowing your API, all I can say is that you have to re-engineer it. Flash 10 added this unfortunate "feature" and it's taken a lot of possibilities away from everybody.
Cory Petosky
+1  A: 

Still on Flash 9 here, but can you not try to upload in the first place, without having that loader to check, and if that fails, prompt the user ?

as Cory mentions

what about try,catch ?

try{
//upload file
}catch(e:SecurityError){
//prompt user, etc.
}
George Profenza