Skip to main content
Inspiring
October 7, 2009
Answered

custom Flex swf tabbed palette can't access local file system

  • October 7, 2009
  • 2 replies
  • 1658 views

OK, with Flash Player 10 we can load and save local files from a flex web application, then why can't I within Bridge, when I load the same swf file in a Bridge tabbed palette, the load and save functions no longer work.

Is it because I am loading as a ScriptUI called flash palette, instead of an HTML palette?

I have tried the Global Flash Player Security to allow my swf permission and created a .cfg but nothing seems to work.

Please help.

thanks,  Todd

This topic has been closed for replies.
Correct answer dfranzen_camera_raw

I'm not sure exactly how your panel is failing. I've attached three sample Flex projects that include Flash panels and JavaScripts for Bridge. These all work for me in Bridge CS4.

To access the local file system I used FileRefrence.save() in these tests --note that this method is was added in Flash Player 10, and so it won't work in Bridge CS3, which uses Flash Player 9  when you use a Flash Player widget in ScriptUI. Also, to compile the example I had to modify the Flex builder projects to require Flash Player 10 by changing the settings on the "Flex Complier" page of the project settings in Flex Builder.

If you are using some other method to access the file system that works with Flash Player 9, please let me know what it is and I can test it.

Two of the SWFs also access the network. To enable the SWFs to access the network, I had to add a global security settings file. Information about creating those files is available here:

http://www.adobe.com/devnet/flashplayer/articles/flash_player_10_security.pdf

But as an example, on my mac, I put all these projects in a folder "BridgeFlashPanels" on my Desktop. Then I created the file BridgeFlashPanels.cfg in /Library/Application Support/Macromedia/FlashPlayerTrust. The .cfg file had one line: the path to the folder on my desktop.

A description of the panels:

PanelWithNetworkAccess -- this panel has a "Test" button, when you click it loads http://www.adobe.com and puts it in the Text Area (note, it will just put the raw HTML there, not render the page).

PanelWithFileSystemAccess -- for Flash Player 10 only, this panel  has a Test button and a text field. When you click the Test button, it writes the contents of text area to the file BridgeTest.txt, unless you choose another file.

PanelWithNetworkAndFileSystemAccess -- for Flash Player 10 only, this panel has a text field and two buttons: "Load Test" and "Save Test". The load test loads http://www.adobe.com into the text field, and the save tests saves the content of the text field to BridgeTest.txt.

To try the panels, Browse with Bridge to the bin-debug folders for each project--the .swfs and .jsx files are there. Double-click on the thumbnail for the .jsx, and Bridge should run the script and add the panel showing the SWF.

-David

2 replies

tstorb1Author
Inspiring
October 9, 2009

Wow, thank you for your detailed reply, with examples.  I was using Bridge CS3 with Flash Player 10, but may be a good excuse to force an upgrade to CS4.

Thanks!

dfranzen_camera_raw
Adobe Employee
dfranzen_camera_rawCorrect answer
Adobe Employee
October 8, 2009

I'm not sure exactly how your panel is failing. I've attached three sample Flex projects that include Flash panels and JavaScripts for Bridge. These all work for me in Bridge CS4.

To access the local file system I used FileRefrence.save() in these tests --note that this method is was added in Flash Player 10, and so it won't work in Bridge CS3, which uses Flash Player 9  when you use a Flash Player widget in ScriptUI. Also, to compile the example I had to modify the Flex builder projects to require Flash Player 10 by changing the settings on the "Flex Complier" page of the project settings in Flex Builder.

If you are using some other method to access the file system that works with Flash Player 9, please let me know what it is and I can test it.

Two of the SWFs also access the network. To enable the SWFs to access the network, I had to add a global security settings file. Information about creating those files is available here:

http://www.adobe.com/devnet/flashplayer/articles/flash_player_10_security.pdf

But as an example, on my mac, I put all these projects in a folder "BridgeFlashPanels" on my Desktop. Then I created the file BridgeFlashPanels.cfg in /Library/Application Support/Macromedia/FlashPlayerTrust. The .cfg file had one line: the path to the folder on my desktop.

A description of the panels:

PanelWithNetworkAccess -- this panel has a "Test" button, when you click it loads http://www.adobe.com and puts it in the Text Area (note, it will just put the raw HTML there, not render the page).

PanelWithFileSystemAccess -- for Flash Player 10 only, this panel  has a Test button and a text field. When you click the Test button, it writes the contents of text area to the file BridgeTest.txt, unless you choose another file.

PanelWithNetworkAndFileSystemAccess -- for Flash Player 10 only, this panel has a text field and two buttons: "Load Test" and "Save Test". The load test loads http://www.adobe.com into the text field, and the save tests saves the content of the text field to BridgeTest.txt.

To try the panels, Browse with Bridge to the bin-debug folders for each project--the .swfs and .jsx files are there. Double-click on the thumbnail for the .jsx, and Bridge should run the script and add the panel showing the SWF.

-David

dfranzen_camera_raw
Adobe Employee
Adobe Employee
October 8, 2009

Here is one more example panel, it loads an image from a URL. The save button in this test panel will get the bitmap data from the image, encode it to a PNG and save the PNG in the file system as BridgeTest.png.

-David