Adding external SWF files to the AIR package thru Flash Builder (Flex)

I reached a wall recently when trying to add external SWF files to my AIR package via Flex for added functionality and it took me a few days to figure it out. Flash CS5 gives you the option straight forward in the Properties panel under AIR settings. FlashBuilder is perceptively not as friendly. My problem was that in Dev, I kept all of my external SWF files in the bin-debug folder where I could easily load a file by calling it’s name as a string in a relative path:

swfLoader.load( “my_external_file.swf” );

But as soon as I did an “export release build” the AIR app could not find that file being that it was not included in the exported AIR package. The files need to be included or removed during the export dialogue process. To view a list of files being included or excluded do the following process:

- Go to “Project” on the top menu.
- Select “Export Release Build”.
- Fill in necessary fields, click “Next”.
- Fill in necessary fields, click “Next”.
- The AIR file contents screen should give you a list of files to include/exclude.
- Click “Finish”.

If your files are not included on the list, then you need to place a copy of the file(s) in the “src” folder of the project (this is where I went wrong). Retry the above steps and you should be golden. Export your AIR app and you will now have access to your external included files on the root of your app.

Cheers.

Pic of the day: #1

pod_20101018

This is my friend Pie, handing out treats only true Flash Developers should enjoy… Please don’t ever buy me these things btw ;)

Slush Puppy Developers Crew

This is what happens when Developers drink too much Slush Puppy sugar and start having visions.

Interactive Touchscreen Display Window on South Beach

I found this touchscreen store display window today in the middle of no where. I guess if you’re a store on Lincoln Rd in South Beach you have the money to rig something like this up.

Powerful learning tool to help Seniors become web savvy

Healthy Choice AR Campaign Article

Very kool to see our work being recognized. Great quote by our own Adam Hollander (Sr. Producer of Agency Operations):

“At Sapient, we’re seeing more and more of our consumer brand clients request concepts that incorporate Augmented Reality. The challenges we currently face in AR development are bandwidth and processing power of the end-user’s actual device. Our designers and developers are constantly pushing the boundaries to balance production quality with performance and accessibility.

As the novelty of the technology fades, a successful AR concept will need to be truly relevant to both the brand and audience. Sapient is well positioned for this future demand and stands out from other agencies with smart creative + strong technology.”

Augmented Reality on Healthy Choice

healthy_choice_AR

We built an AR piece for Healthy Choice recently. I must say that I am pleased with how it came out. Here’s the link. Let me know what you think.

New Augmented Reality in Samsung IFA09

This is a new Augmented Reality piece we recently launched. The technology is actually pretty kool. You can place a glyph/marker on the wall and a Samsung TV shows up in place, perfectly proportioned where it should actually go in the room. Alot of hard work went into this, we should all be proud of our efforts, I know I am.

Getting rotation properties from Matrix3D transform – Flash AS3, Augmented Reality, PV3D

First off, I am no mathematician. I’ve been doing a lot of Augmented Reality in Flash AS3 lately and there is one hurdle I’ve overcome that may be useful to document for some of you out there. How do you get the rotation properties of a 3D Object after the Matrix3D Transform has been applied to it in PaperVision? The problem is that if you have an object rotated in 3D space, those properties get overwritten once the Matrix3D Transform gets applied to it. All rotation values return as zero. I found this sliver of information on the Adobe ActionScript 3.0 Language Reference:

“Display objects cache their axis rotation properties to have separate rotation for each axis and to manage the different combinations of rotations. When a method of a Matrix3D object is called to transform a display object, the rotation cache of the object is invalidated.”

Of course there’s no documentation on how to get the rotation information in degrees for after the fact. That would be too easy. I couldn’t find any straightforward info from the PaperVision docs either. I’ll save you the story of pain and suffering on how I figured it out, but the solution is to use the matrix2euler() function in the org.papervision3d.core.math.Matrix3D package. What the hell is a Euler? I have no idea. Why hadn’t anyone explained how and why one should use it? I have no clue. Here is what I do know:

  • you need to pass the transform property of a DisplayObject into the matrix2euler function after the Matrix3D transform has been applied to it.
  • The matrix2euler() function returns a Number3D object storing its rotationX, rotationY, rotationZ properties deceivingly in the Number3D’s x,y, and z properties. rotationX = x, rotationY = y, rotationZ = z (I figured this out on my own at 3am the morning my project was due)

Here’s how your code should somewhat look like:
var rotationObj:Number3D = Matrix3D.matrix2euler(myDisplayObject.transform);
trace(rotationObj.x);// Whatever the current rotation on the X axis is.

If I have time in the future I’ll put up an actual example of it’s use. In the meantime, here is a graphic I made that explains what the rotations look like when converted to Eulers:

Matrix2Eulers

Post Office using Augmented Reality

I came across this today. This is a very pragmatic way of using Augmented Reality. If there’s a right way to use AR as a business solution, this is one of them.