The Mindful Coder

Code, yes. But think about it a little first.

Archive for the ‘Flex Builder 3’ tag

Flex on the Mac

8 comments

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,

  1. Go to the compiler settings in  your project’s properties via Project->Properties->FlexCompiler
  2. In the ‘Additional compiler arguments:” settings, add
    -use-network=false
    image
  3. Click ok.

Should work fine. Hope it saves you some time if you are starting with Flex on the Mac.

Written by The Fat Oracle

December 23rd, 2008 at 2:53 pm