AS3 : Using FlashVars functions in a neat class – JadBox

I’m sure some of you might be looking for a class that can allow you to do reading in flashvars. You can still do it using the my previous way but, is much neater using classes. Well fortunately, there is such thing. It’s called JadBox Flashvar class. You can get the util class here. Here an example how this class is used (remember to import the jadbox class into your main first before using it)

var myFlashvar:String = FlashVars.parameters["myFlashvar"];

or you can access the flashvar values this way.

var myFlashvar:String = FlashVars.parameters.myFlashvar;

AS3 : Using Flash Console Commandline

This post is short tutorial about using the command line feature in Flash Console Class as mentioned in previous post here. Aside from cool features like mouseOver Roller, inspect utility, measurement tool; the commandLine is one of the Flash Console greatest feature.

To control an instance on Stage with the console. You must first understand what is a Scope.

A Scope is basically, what Object the console is currently point as reference at. By default the Scope is always pointing to the Stage.

Read the rest of this entry »

AS3 : Collision Detection Kit

Ever wonder, is there an easier way instead of making loops and check for every hitTest with all sorts of  shapes and sizes? Well, may I present to you – Collision Detection Kit!

The Collision Detection Kit is a package of classes created for pixel-precise, shape-based collision detection for all display objects. It is written in Actionscript 3.0 and meant for Flash Player version 9 and higher.

The Collision Detection Kit comes with several features to control how collisions are detected, and provides data for the user of the class so they can do something about the collision:

  • Set an alpha threshold to ignore colors below the threshold.
  • Specify colors and color ranges to exclude from collision detection.
  • Receive an angle of collision for each collision. We’re not talking about bounding boxes here – the angle is calculated based on the shapes of the display objects at the site of the collision. Great for when you’re working with physics!
  • Receive the pixels that overlapped in a collision in stage coordinates. Combined with the returned angle, and your physics engine will have no problems traversing complicated shapes or performing off-axis rotation.
  • Takes transformations (scale, rotation, color transforms, etc.) of individual instances of your display objects into account.
  • Add items for collision detection regardless of their nesting.
  • You can have as many CollisionGroup and CollisionList instances as you want, allowing you to easily manage different interactions and behaviors.
  • Works with all display objects – MovieClips, Sprites, Bitmaps, TextFields, FLVs, and on and on!

Read the rest of this entry »

AS3 : Explosion Burst Class

Developing games like Shooter in As3 can be boring without good explosion effects. Over the weekends, I ported a simple class ( from As2 )which does some randomized explosion movie-clips.

This is to be used when there’s an explosion in the game. The class allows you to create explosion effect based on number of particles, size of distance and alpha. All you need is to instantiate it and pass in the variables needed. See sample below.

Read the rest of this entry »

AS3 : Flash-Console

console_controls01

Every wonder that, there’s something to display your run-time variables smoothly without using the laggy trace. Not to say trace command is useless, but at times is much less cpu intensive to debug values especially on enterFrame run time to an on screen textbox instead of using trace.

But, lately I stumbled upon a good console interface like debugger called Flash Console in a form of as3 class package!

Read the rest of this entry »

Page 1 of 512345