I had the same problem with my app. Once we shifted to flash player 10 my
downloads would keep giving the error.  I¹d generate a file on the user
click and then automatically start the download. From what I learnt it was a
security thing added in, to start the download event it requires user
interaction. I fixed it by added a message after the file gets created, once
the user selects ok, the download starts. Its not the prettiest solution,
but it works. 

-Paul


On 1/26/09 6:47 AM, "Mika Kiljunen" <mkintens...@gmail.com> wrote:

>  
>  
> 
> Yep I have the same problem and get the same error. But funny enough, my app
> works perfectly with Flash Player 9, but fails with Flash Player 10 throwing
> "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."
> 
> -Mika
> 
> 
> 
> On Wed, Jan 21, 2009 at 6:51 PM, valdhor <valdhorli...@embarqmail.com> wrote:
>>  
>>  
>> 
>> Once you create the zip file you need to return the correct headers to
>> the browser so that the browser will pop up the dialog box asking the
>> user what to do.
>> 
>> I don't use Java - I use PHP. When the user clicks a button in Flex I
>> create a new URLRequest and then navigateToURL. The PHP script creates
>> the file and when done sends the following headers:
>> 
>> Header("Content-type: application/octet-stream");
>> Header("Content-disposition: attachment; filename=zipTest.zip");
>> 
>> The script then streams the file to the browser. The headers sent back
>> to the browser cause the browser to pop up the save file window just
>> as if the user clicked a file link on an HTML page.
>> 
>> 
>> 
>> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ,
>> "oneworld95" <oneworl...@...> wrote:
>>> >
>>> > I've run into an interesting situation with Flex: I've got a Java
>>> > servlet that will generate a Zip file when the user clicks a button in
>>> > Flex. But the file download dialog after the server action requires
>>> > the user to click a button. It throws this 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.
>>> > 
>>> > So how do you handle these situations? After the server responds
>>> > successfully, do you display a second button to do the actual Flex
>>> > file download?
>>> > 
>>> > - Alex
>>> >
>> 
>>  
>>     
> 
>  
>     


Reply via email to