Archive for March, 2008
RichFLV - FLV Editor - AIR
This is a very handy APP. It got me out a bind recently when the client sent us an FLV when we were expecting an uncompressed video. The production company was trying to charge more money just to send the uncompressed version we were originally expecting. I was able to chop the end off of the FLV without having to republish or recompress it. Use it!
APE Tutorial/Example 2 - Flash Physics Engine: Adding walls and multiple collisions
This example just builds off the last example but I was just having a little more fun. I added a few more walls and dynamically added wheels to the APEngine to see multiple wheel collisions. I also modified the default elasticity property of the wheel to make the collisions more bouncy. I know it’s not a whole lot different from the last one but is it an example of progression and elaboration. Once again you can plug in the code below on the first frame of a timeline and it should work as long as you are linked to the APE source files.// Imports
import org.cove.ape.*;
import flash.events.Event;
import flash.display.MovieClip// listeners
addEventListener(Event.ENTER_FRAME, run);// Create an instance of the APEngine.
APEngine.init(1/3);
APEngine.container = this;
APEngine.addForce(new VectorForce(false,0,2));
// Create group
var group1:Group = new Group();
group1.collideInternal = true;
// Create rectangle to serve as the floor.
var rect1:RectangleParticle = new RectangleParticle(280, 350, 130, 10, 0, true) // Bottom Right
var rect2:RectangleParticle = new RectangleParticle(120, 350, 130, 10, 0, true) // Bottom Left
var rect3:RectangleParticle = new RectangleParticle(60, 200, 10, 300, 0, true) // Left
var rect4:RectangleParticle = new RectangleParticle(340, 200, 10, 300, 0, true) // Right
// Add to group
group1.addParticle(rect1);
group1.addParticle(rect2);
group1.addParticle(rect3);
group1.addParticle(rect4);
// Add group to engine.
APEngine.addGroup(group1);
// Constantly run these functions to keep the engine running.
function run(evt:Event):void {
APEngine.step();
APEngine.paint();
}
// Add button
mcStart.addEventListener(MouseEvent.CLICK, mcStart_CLICK);
mcStart.buttonMode = true
function mcStart_CLICK(e:MouseEvent = null):void
{
var wheel:WheelParticle = new WheelParticle(50, 0, 10);
wheel.elasticity = .6
wheel.addForce(new VectorForce(false,100,0))
group1.addParticle(wheel);
}
mcStart_CLICK()
Damn you Line Golfer!!!

From the guy who brought you Line Rider, here comes Line Golfer. The game must be laced with crack cocaine because I couldn’t stop playing with it. At Wrigley’s CandyStand you can play other courses others have drawn or draw your own and submit it for consideration. The concept of the game incorporates multiple levels of genius; the simplicity, allowing others to build the courses for you, the addictiveness of it… don’t get me started. The game is built using APE, the flash Physics engine written by Alec Cove from what I understand. Very kool. It’s great to see people build on Flash technology that is out there. I guess that is why some thing like this is so inspiring for me. Let me know what you think.
From days of old
I remember back in the days of Flash 5 and 6 where you had to write everything from scratch. Things like easing (Tweening) and physics all needed to be coded and modified by hand. Usually you would need to look at someone else’s source files, gut out what you think you needed and change the code to fit your needs. Not that we still don’t do that now to an extent. Back then there were no classes as we know of them today, just a bunch of functions (prototypes) in the first frame of your movie that you would call globally. If you were really fancy you would have an external AS file that would get included. I remember in Flash 7 it being so hard to get out of the old practices and start working more Object Oriented with true classes. Thank God that with the maturity of ActionScript the options are wide open. Developers build for reusability and even create API’s that facillitate life. PaperVision, APE, Box2D, Caurina Tweener… imagine where we would be if these technologies weren’t out there for us to use. This is only my take on it, others I’m sure had different experiences. I can only speak for myself. Stay tuned, I have more physics tutorials coming!
APE Tutorial 1 - Flash Physics Engine: Getting started
I have searched for days now looking for good APE tutorials and I have found little to no help. I decided to gather what I know, digest it for the average human being and post tutorials. I will try to make this concise.
For this first tutorial I have decided to strip down using APE to it’s basic necessities; present a good foundation that can be easily built off of. The following is the sequence of what needs to happen to get a firm understanding of how APE is used.
- Import the APE package
- Create an instance of the engine
- Create a group that you will add particles to (wheels, circles, rectangles, etc)
- Create your particles
- Add your particles to the group
- Add the group to the engine
- Run the engine
Thats it, once you grasp this concept you are on your way to leading the industry with richer internet applications and you can promise the world a better tomorrow. I suggest going thru the APE documentation to see what you can add on to my file. I will do more Tutorials soon where I will go more in depth on how to use the bells and whistles. Below is the code I used to make the example. You can actually plug this code into the root of the timeline with no graphics and it will work as long as you have APE hooked up to your Flash AS3 class path. Hit me up with questions.
// Imports
import org.cove.ape.*;
import flash.events.Event;
// listeners
addEventListener(Event.ENTER_FRAME, run);
// Create an instance of the APEngine.
APEngine.init(1/4);
APEngine.container = this;
APEngine.addForce(new VectorForce(false,0,2));
// Create group
var group1:Group = new Group();
group1.collideInternal = true;
// Create wheel with motion.
var wheel1:WheelParticle = new WheelParticle(0, 0, 30);
wheel1.addForce(new VectorForce(false,30,0))
// Create rectangle to serve as the floor.
var rect1:RectangleParticle = new RectangleParticle(200, 300, 300, 10, 0, true)
// Add particles to group.
group1.addParticle(wheel1);
group1.addParticle(rect1);
// Add group to engine.
APEngine.addGroup(group1);
// Constantly run these functions to keep the engine running.
function run(evt:Event):void {
APEngine.step();
APEngine.paint();
}
Jeniuses at work
I thought this was hilarious. There is alot of traffic that goes by our room in the office. People yelling and laughing like angy hyenas down the hall. You know, just like every other office. So every once in a while we close the door. I figured we could keep people from thinking we were antisocial by placing a sign on the door that said “Jeniuces at work”. Everyone felt they had to add or correct it in some way I guess. The picture of me was so great I had to leave it.

