Flex on the Mac
I am used to doing most of my Flex dev on Windows. At home, I do it on my XP VM on my Mac. But I was having a conversation with some friends on Friendfeed a couple of days back about Microsoft having a development bias while Mac had a consumer bias – and during the course of the discussion, it came home to me that I see my Mac as a pleasure boat – and not a platform I want to develop on. I immediately realized this was ridiculous because I have no problem developing on Linux – and the Mac OS is the pretty refined cousin of Linux who hasn’t forgotten her roots.
So I’ve decided to do at least some part of my dev on the Mac. Conveniently, I am currently working on architecting a Flex application for 3D modeling that uses Papervision3d. Flex Builder is Eclipse based and available on the Mac – perfect!
To keep my workspace and files synchronized between my work Windows machine and my Mac at home, I am in the process of setting up Windows Live Mesh. Live Mesh is looking amazing and works pretty flawlessly. The only problem is that their Mac client is still in tech preview and my account doesn’t have authorization yet to use it on the Mac
. So I am using my XP VM on the Mac as my conduit to synch for now. I can’t wait for the Mac client to go live. More on how I use Mesh in future posts.
So I opened up my Flex project on the Mac version of Flex Builder 3. You soon realize subtle differences between the Windows and Mac versions of both the Flex Builder and the Flex compiler. Also, since I was using both Mac and Windows, I started mixing up my keyboard shortcuts – got annoying very quickly.
The first issue with using Flex on the mac was that as soon as I tried debugging my app, I got a ‘Security Sandbox Violation’. It was working just fine on Windows.
*** Security Sandbox Violation ***
Connection to xxxxxx_frontElev.dae halted – not permitted from file://localhost/Volumes/Anatta/work/xxxxxx/Prototype I/bin-debug/main.swf
SecurityError: Error #2148: SWF file file://localhost/Volumes/Anatta/work/xxxxxxx/Prototype I/bin-debug/main.swf cannot access local resource yyyyy_frontElev.dae. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at org.ascollada.io::DaeReader/read()[/Volumes/Anatta/work/xxxxxxx/xxxxxxx/Libraries/papervision3d_SVN_Checkout/as3/trunk/src/org/ascollada/io/DaeReader.as:76]
at org.papervision3d.objects.parsers::DAE/load….
After digging around a little, turns out this was because of the sandbox settings on the Flash player on the Mac.
To fix this,
- Go to the compiler settings in your project’s properties via Project->Properties->FlexCompiler
- In the ‘Additional compiler arguments:” settings, add
-use-network=false
- Click ok.
Should work fine. Hope it saves you some time if you are starting with Flex on the Mac.
Category: Code,Flex, Updated at December 23, 2008 by The Fat Oracle | Log in
thanks!!!!!!!!
I was just going through the tutorials for flex from adobe and ran into this. Thank you so much for the solution!
You guys are welcome!
How did you go about copying the Flex project from Windows to the Mac, did you re-create it or just copy it over? Can you use the same project on either platform?
RC, you can just copy over the project from Windows over to the Mac and the other way around. To open the copied project, go to File–>Import–>Flex Project and select the project folder. Your project will open up in Flex.
You might have to change file-path dependent settings of your project such as folders in the Flex build path of your project (in Project Properties) since path notation is different between the two platforms. But otherwise, should work fine for you.
In my work I started working on MAC, before 2 weeks. Yet I have to work on a Flex Project and that was the first issue i met. Very helpful information. Add the line and everything is back to normal
I’m glad this helped Lyobomir
.