Flash async calls with mouse click permissions?
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 precede开发者_如何学Pythond 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?
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.
}
Make your workflow
user clicks a button
uploads a file
listen for file upload security issue
report issue
精彩评论