Archive for the “ActionScript 3” Category

I use Flex for the majority of my Flash related work, even for writing plain ActionScript. Lately I've barely even used the Flash authoring environment to create stuff. When I do use the Flash authoring environment, it's mostly for automation and prep work of content. If you are like me, you write JSFL to do that stuff.

I love automating redundant tasks. One thing that bugs me when importing graphical assets to Flash's stage is having to resize the document to what I imported. I like that I can do this by going to the Document Properties and setting the document to match the content size, but if I have to do this each time I import/export content it becomes a irksome chore. I write JSFL scripts that run tasks on multiple files, having a "match contents" function would be useful to me in my case...maybe to you as well. I do not see a JSFL way to do this. (Maybe there is and I had a brain fart?). Until then, here is a script I wrote to do it in JSFL...
Read the rest of this entry »

Vote in HexoSearch

Comments 1 Comment »

When I am writing a flash app or game which uses the keyboard to control a character's movement, there is a situation that becomes annoying while controlling the character. I do not know the proper term for it ("sticky keys"?) but I will describe it...keyboard

When an app or game is written we "expect" the user to precisely press the proper key or key combination at a time to execute programmatic actions. However, most of us have ten fingers and we use more than one finger to press more than one button on the keyboard. The expected program reaction from multiple fingered keyboard input might not occur because you have another function executing when you expect just one at a time.
Read the rest of this entry »

Vote in HexoSearch

Comments 13 Comments »

This post might seem of little importance to some but today I was thinking back to my high school days and (vaguely) remember the 4 quadrants of a Cartesian coordinate plane discussed in class. Depending on the positive or negative sign of a Point's X and Y value, that point in the Cartesian coordinate plane will be located in one of these 4 quadrants.

Quadrant 1 = (+,+)
Quadrant 2 = (-,+)
Quadrant 3 = (-,-)
Quadrant 4 = (-,+)

My interest in this post is about the positive or negative sign of what the Cosine, Sine, and Tangent functions return for the same angle...the angle from one Point to another Point. The sign of these 3 Math functions are different also whenever a Point is located in one of the 4 quadrants.

Quadrant 1 = +Sine,+Cosine,+Tangent
Quadrant 2 = +Sine,-Cosine,-Tangent
Quadrant 3 = -Sine,-Cosine,+Tangent
Quadrant 4 = -Sine,+Cosine,-Tangent

Personally I don't think the order or name of the quadrants are important, as long as you keep them consistent with the coordinate system. For my usage, I order my quadrants "1,2,3,4" clockwise since ActionScript's radians values go clockwise.

I feel this will become useful sometime in the future for me when dealing with angles of Points and determining their positions relative to each other.
In a future situation I might not be given X and Y information, but may only have angle data instead. Seeing the difference of signs from the Cosign, Sine, Tangent output of the angle value will be helpful clues.

So some things come back to haunt you, if they are the ghosts of my math teachers, I will surely pay attention in class this time :) .

Get Adobe Flash player


Read the rest of this entry »

Vote in HexoSearch

Comments No Comments »

Thanks for visiting www.keith-hair.net