Archive for Useful Scripts

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 : 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 : 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 »

AS3 : FPS and Memory Counter Package

ActionscriptIcon_400 One of my favorite class I used to include when developing games for flash is my FPS and Memory Counter Package. I use this to check my fps and memory consumption for my games.

This helps to identify which of my methods I wrote is taxing the CPU or not. Simply import package to your main.as and add it into the stage

 

Read the rest of this entry »

AS3 : Tips for Gaia Flash FrameWork Development

I decided to share some how tos today for Gaia Framework based on my development experience. For those reading this the first time and don’t know what is GAIA framework about, try going to this post and read more about it.

gaia_flash

Let’s get started – check out the list below for today’s how tos of the day :-

  1. How To : Get the length of the assets loaded inside the page?
  2. How To : To Load an Asset of Unknown Type?
    e.g. src=”http://www.mymp3.com/loadfile.php?id=123

Read the rest of this entry »

Page 1 of 512345