Archive for the ‘ActionScript 3’ Category

Flash: Direct Memory Access via Native Extension

Sunday, April 28th, 2013

A couple weeks before the Flash Gaming Summit I found an interesting blog post from Colin Northway about managing texture memory in Starling applications. In this post he describes how he forces an error in ActionScript to receive an object's memory address which he then uses as a unique id. I thought this was a pretty cool trick and was discussing it with our engine developer at the office when we suddenly had a thought: if you can get the memory address of an object in ActionScript, what's to stop you from passing that address into native code and doing whatever you want with it? (more...)

Scout Survival Kit

Friday, February 1st, 2013

If you aren't using Adobe's Scout profiling tool yet, you should be. Scout is a fantastic tool for debugging your code and finding performance bottlenecks. You can get basic data by simply running Scout and then launching Flash content. However, for more in-depth profiling you must enable advanced telemetry in your swf (the actionscript stack is only available for AS3-based projects). To assist with this, I've put together a Scout Survival Kit that contains all the tools necessary to get you up and running.

The pack includes the Scout set up executable, this FlashDevelop plugin, this Scout enabler program and a helpful html readme document describing how to use the plugin. All of these items can be downloaded individually elsewhere, but I figured it made sense to put them all in one place. Click the image below to download the kit!

Airxbc Update

Monday, December 10th, 2012

Woohoo! I finally had time to sit down and update the Airxbc native extension for Windows! If you aren't familiar with the extension, it allows you to accept input via an Xbox 360 controller for your Adobe AIR games.

With this latest release, my major goal was to wrap up the controller definition in a real class. If you'll recall, the original version simply gave back a generic ActionScript object. The new version returns a com.rhuno.X360Gamepad object that wraps up a lot of the controller functionality nicely, exposes some helpful methods and contains some constants for controller buttons. New functionality includes the ability to check if a button was just released and also to get the trigger values as a percentage or as a value. Below is an example of how to use the new extension.

import com.rhuno.Airxbc;
import com.rhuno.X360Gamepad;

var ext:Airxbc = new Airxbc();
var gpad:X360Gamepad;

// pollGamePad now returns an X360Gamepad object
gpad = ext.pollGamePad();

// various ways of checking for button presses
gpad.isXButtonDown();
gpad.isButtonDown(X360Gamepad.GAMEPAD_X);

// ways of checking for button releases
gpad.wasLeftShoulderReleased();
gpad.wasButtonReleased(X360Gamepad.GAMEPAD_LEFT_SHOULDER);

// get trigger value
var value:int = gpad.leftTrigger;

// get trigger percentage (0 thru 1)
var percent:Number = gpad.leftTriggerAsPercent;

// NOTE: you still use the extension to set vibration
ext.setVibration(30000, 30000);

You can download an updated example project and the new ANE below. Enjoy!

NOTE: This post is out of date, for latest on Airxbc, go here!

Airxbc 0.9 example project
Airxbc 0.9 ANE

Citrus Engine: Box2d Revolving Platform

Sunday, November 18th, 2012

This class was officially added to the Citrus Engine on November 26, 2012.

After seeing Lee Brimelow's tutorial on the Citrus Engine, I was intrigued and decided to play around with it. The engine's platformer package is already great and has some very useful objects for game developers. I took a look at the code for the box2d Platform and MovingPlatform classes and extended the functionality to create a RevolvingPlatform class. (more...)

Introducing Airxbc 0.5

Sunday, November 11th, 2012

UPDATE December 30, 2012
This post is out of date. For information on the latest version of Airxbc, see this page.

Lately I've been working on a new native extension that makes it possible to control your Adobe AIR games using the Xbox 360 controller. I'm currently calling it Airxbc (Air Xbox controller - ha HA!) and this 0.5 release is pretty much just an alpha test to get something out there. It think its pretty cool and plan on putting more work into it in the relatively near future. If you're interested, check out the video and details below!

(more...)

Tutorial: Multiplayer P2P Demo with AS3MUL

Wednesday, September 26th, 2012

A couple months ago I created a simple demo using the AS3 Multiuser Library. The post has generated very positive feedback and I've also received a few requests for a tutorial so here it is! In this tutorial you will learn how to build a basic multiplayer, p2p application. (more...)

Axel Exporter Plugin for Mappy

Monday, August 20th, 2012

I've recently been toying around with the Axel Game Library (www.axgl.org). I'm really liking the library so far as it is based on Flixel, but also utilizes hardware rendering. This means you get better performance and is especially nice for mobile devices.
(more...)

Multithreading in ActionScript 3.0: A Bad Idea?

Monday, August 6th, 2012

One of the most talked about features in the new Flash Player 11.4 beta is the new concurrency model which allows developers to spawn worker threads to handle intensive operations. While many people are singing the praises of multithreading, I can't help but to feel like this may not be such a great thing.

I've always had certain misgivings about multithreading. Without question, threading has become common practice for achieving performance gains through parallelism in programming. However, just because something becomes accepted practice does not necessarily mean that it's a good thing. If you want an exhaustive look into the topic, I recommend reading Edward A. Lee's report The Problem with Threads. The author is a distinguished professor and former chair of Berkeley's Electrical Engineering and Computer Sciences department. (more...)

Fix for Ground – Bullet Collision Bug in Flixel

Wednesday, July 18th, 2012

A few friends and I have been working on a game together for the last few weeks. Everything was going well at first, but then we ran into a major snag: bullets were colliding with the ground when they clearly shouldn't have been. We are using Flixel and FlxWeapon from the Flixel Power Tools and we would see the issue pop up only on uneven terrain. If we changed our map to a basic, flat piece then everything worked as expected. However, introducing varying height platforms in the map would cause the issue. The image below demonstrates the problem.


(more...)

Flash Player 11.4 and AIR 3.4 available now

Tuesday, July 17th, 2012

Both Flash Player 11.4 and the AIR 3.4 SDK are available now from the Adobe Labs site. The update brings some pretty big features to the Flash platform including multithreading and better support for iOS development.

I'm not a big proponent of threading and concurrency in programming, but the iOS additions sound pretty nice. You can now deploy your applications to your iOS device without going through iTunes and you can receive push notifications and utilize iOS SDK 5.1 features.

You can go here for more on AIR 3.4 and here for Flash Player 11.4.

Subscribe to RSS feed FGS5 Badge