XML Node with Hyphen
Flash does not like node names that have hyphens. So it will complain about
1 | data.clip-board.clips |
We can get around this issue by using the square brakets.
1 | data['clip-board'].clips |
Add new PATH
export PATH=$PATH:/new_path
Added path to my local Android Tools folder.
export PATH=$PATH:/Users/yourusername/SDK/android/tools
32-bit or 64-bit Intel-based Mac?
About This Mac >> More Info… >> Hardware — Processor Name
Compare with
Intel Core Solo – 32 bit
Intel Core Duo - 32 bit
Intel Core 2 Duo – 64 bit
Intel Quad-Core Xeon – 64 bit
Dual-Core Intel Xeon – 64 bit
Quad-Core Intel Xeon – 64 bit
Core i3 – 64 bit
Core i5 64 bit
Core i7 64 bit
Setting the ListActivity Background Colour (Android)
The following code shows how you can set the background colour of a ListActivity.
1 2 | getListView().setCacheColorHint(Color.rgb(36, 33, 32)); getListView().setBackgroundColor(Color.rgb(36, 33, 32)); |
Setting or Editing Environment Variables on a Mac
When running ANT I use a Environment Variable to load the relevant property file for the machine that is running the build.
ANT_USER is the environment variable with the value “laptop”
1 | <property file="${env.ANT_USER}.properties"/> |
This will end up loading a property file called “laptop.properties”
You can set environment variables by editing an XML file that can be found in your home directory (If the file doesn’t exist, you can create it yourself).
~/.MacOSX/environment.plist
1 2 3 4 5 6 7 8 | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ANT_USER</key> <string>laptop</string> </dict> </plist> |
If you don’t fancy modifying XML directly you can use PlistEdit Pro to edit your environment file.
Move Dragable Clip to Top of Stack
1 2 3 4 5 | private function onMouseDown(evt:MouseEvent):void { _itemHolder.setChildIndex(evt.currentTarget as Sprite, _itemHolder.numChildren-1); evt.currentTarget.startDrag(); } |
_itemHolder – Sprite containing the dragable items.
Pretty Print JSON
Sometimes JSON is returned from a service as a single wrapped line and the data structure is not obvious. JSON Formatter can be used to turn the data into a more readable format and also validate it.
Matt also suggested JSONView a Firefox plugin as another alternative.
CS4 and Mac Spaces
I’ve noticed that applications from the CS4 suite don’t work too well with a dedicated space. For example; Flex Builder is in space 4 and the Flash IDE in space 5. When I move from 4 to 5, I need to select Flash to gain focus and use the application. On some occasions when tabbing around I’ve also noticed that some applications just seem to disappear into the background and require restarting to use again. There seems to be some sort of focus issue with applications from the CS4 suite, it might have something to do with the panels.
I’ve found that if you set applications from the CS4 suite to appear in all spaces then the issues are avoided.
Wget On Mac For Terminal
Terminal comes with Curl by default, but over the years I’ve got used to Wget.
I found an article on how to install Wget on the Mac over at Mac Tricks And Tips.
I did get a error when I ran ./configure and this was because the system couldn’t find a C compiler. I got round the issue by installing the latest version of xcode.
Open Video Player Initiative
The Open Video Player Initiative is a community project dedicated to sharing player code and best practices around video player development and monetization.