Browsing the tag Flex

In the project I am currently working on I got textfields that scrolled when I used the mouse wheel. To avoid this you simple disable the mouse for the textfield.

textfield.mouseEnabled = false;

Post to Twitter

Tagged with , , , ,

Since upgrading to Snow Leopard (Mac OS X 10.6) on my Mac I have had some problems with Flex Builder. The most irritating problem is that the right (and left) column that highlights class errors are not updating correctly.

Screen-shot-2009-09-18-at-11.09.52

I realised that this only happens if I use Flexbuilder on my external monitor. However … if I resize the window of Flex Builder it updates correctly. Really strange.

Solutions?

Post to Twitter

Tagged with ,

Every time you change the bitmapData source for a Bitmap you also need to set the smoothing property on your Bitmap to true (if you want the bitmap to use smoothing).

var bitmap : Bitmap = new Bitmap();
bitmap.smoothing = true;
trace(bitmap.smoothing); // true
bitmap.bitmapData = new BitmapData(320, 240);
trace(bitmap.smoothing); // false

Post to Twitter

Tagged with , , , ,

I stumbled upon a this new search engine dedicated to Actionscript.
Pretty neat.

www.hexosearch.com

Post to Twitter

Tagged with , ,

Flexbuilder generates a HTML wrapper file by default when you run your projects. I usually turn it off while developing to save some time waiting on my browser to reload the HTML file. After disabling this setting, your application will be launched within the standalone flash player. 

Open the project properties, and select Flex Compiler properties.

picture-98

 

Uncheck Generate HTML wrapper file.
 picture-1001

Post to Twitter

Tagged with ,

It is hard to remember the whole ASCII key list when listening to keyboard events in Flash Actionscript.

Example:

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.

picture-96

Post to Twitter

Tagged with ,

The Motor2 AS3 physics engine makes it really simple to create platform games. I have made a prototype game that only use BoxData and LineData (used for the jump through platform). There is really no functionality except walking and jumping, but then again it is a prototype.

The wall-jump bug is a feature! Or … the wall-jump feature is a bug.

UPDATE: Use the arrow keys to move Mario.

Post to Twitter

Tagged with , , , ,

When you are working on an actionscript project with a generated swf in Flex 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 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.

  1. Right-click your project and select properties.
  2. Select Actionscript Compiler.
  3. Write -use-network=false in the textbox for Additional compiler parameters.
  4. Next time you run this project it is ready for local use.

Post to Twitter

Tagged with , ,

I have been playing around with the Motor2 physics engine which is based on the Box2d engine. I really like this engine and think it has a lot of potential for actionscript game developers. Box2D has great documentation while Motor2 does not have any documentation at all. My advise when you start to work with the Motor2 engine is to have the class files rather than the swc files in the project. This will help you get a look into the code to check the parameters and methods.

Google Code
http://code.google.com/p/motor2/

Google Groups
http://groups.google.com/group/motor2

Box2D Documentation (may help)
http://www.box2d.org/manual.html

Post to Twitter

In 1994, Justin Hall started a blog. I will start one today. Yeah, I am a tad late. By the way, I am a Flash and Flex Developer at Hello There and I love to make games.

Post to Twitter

Tagged with , , ,