This is a function I wrote way back to make large numbers look nicer.
private function separateByThousand(valueNumber : Number, splitter : String = " ") : String { var valueString : String = ""; var valueLength : Number = valueNumber.toString().length; for (var i : int = 0; i < valueLength ; i++) { if((valueLength-i)%3 == 0 && i != 0) valueString += splitter; valueString += valueNumber.toString().charAt(i); } return valueString; }
I have tested a new console for Flash called Flash-console v2.52 (created by Lu Aye Oo). This is by far the best console/monitor tool I’ve tried. With a few lines, you are up and running and have control over the FPS, memory, trace, channels, and more. You can open the command prompt, and modify instances at runtime. In the display the roles you get a list of all instances while hovering Them on stage. I know this has been done before, but this time it’s very well done.
I’m impressed.
Download it here:
http://code.google.com/p/flash-console/
We had a problem in a recent game project getting SharedObject to store the players progress. When we tested it in Flash Builder it worked fine but as soon as we uploaded the game to our server (or any server) the data were not saved. We found out that to avoid name conflicts, Flash looks at the location of the SWF file creating the shared object. The solution to our problem was simple. By setting the local path to “/” We opened communication between the files. This means of course that all files in the same domain can access the object, so you have to watch out for conflicts if you have other projects on the same domain.
To avoid inadvertently restricting access to a shared object, use the localpath parameter. The most permissive approach is to set localPath to / (slash), which makes the shared object available to all SWF files in the domain, but increases the likelihood of name conflicts with other shared objects in the domain. A more restrictive approach is to append localPath with folder names that are in the full path to the SWF file. For example, for a portfolio shared object created by the SWF file at www.myCompany.com/apps/stockwatcher.swf, you could set the localPath parameter to /, /apps, or /apps/stockwatcher.swf. You must determine which approach provides optimal flexibility for your application.
I found these two games that I created for a flash game contest at Kirupa in 2004. Barefoot Longjump got 1st price. The highscore does not work but I might fix that later. Probably not. Anyways … happy playing.
http://www.kazumakzak.com/games/hackysack/
http://www.kazumakzak.com/games/longjump
When you are working on an Actionscript project with a generated swf in Flex/Flash Builder you sometimes need to pass the work to someone else for review. If your swf is loading another swf you will not be able to get the files to work correctly. As soon as you copy the files to a local folder you are going to have problems because of the security in Flash player. If you run the html-file Flex/Flash Builder created you will get an error:
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2140: Security sandbox violation: file:///Users/mattiaswargren/Documents/Flex Builder 3/my-project/bin-release/Main.swf cannot load file:///Users/mattiaswargren/Documents/Flex Builder 3/my-project/bin-release/assets.swf. Local-with-filesystem and local-with-networking SWF files cannot load each other.
This is just the temporary solution to get it working in a local folder:
- Right-click your project and select properties.
- Select Actionscript Compiler.
- Write -use-network=false in the textbox for Additional compiler parameters.

Next time you run this project it is ready for local use.
You could also add the folder containing your files in the Global Security Settings panel found here:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
It is hard to remember the whole ASCII key list when listening to keyboard events in Flash Actionscript. I usually use the Keyboard Class (flash.ui.Keyboard) when tracking keyboard inputs but it does not contain all the keys you may want to use. Instead of googling tables with Keyboard keycodes I made this SWF to get quick access to the codes via the KeyboardEvent (flash.events.KeyboardEvent) class.
Sorry, either Adobe flash is not installed or you do not have it enabledSo, I got hacked. No big deal. Fresh start.
Calendar
May 2012 M T W T F S S « Nov 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Archives
Links




