“Be inspired, enjoy your work, keep learning and never forget to play.” — gskinner

Compiling with mxmlc (using external libraries) on Mac OS X

Posted: March 29th, 2010 | Author: nuno | Filed under: Actionscript3 | No Comments »

Recently I set myself to compile an Actionscript3 project by hand using the mxmlc tool on the command-line and wanted to share that in case you ever need to do something similar. It's no biggie and it might be useful for a number of things (making automatic builds, building on machines without the Flash IDE or Flash Builder, etc).

1. Open a console and go to the directory of your project

2. Export the PATH to include the flex sdk binaries, e.g. run:

export PATH=/Users/youruser/Desktop/yourproject/flexsdk/4.0.0/bin:$PATH

3. Invoke the compiler to produce the swf, e.g. run:

	mxmlc -static-link-runtime-shared-libraries \
	-sp ../externals/externlib \
	-l example.swc ../../flexsdk/4.0.0/frameworks/libs \
			 ../../flexsdk/4.0.0/frameworks/locale/en_US \
	-output output.swf \
	-locale en_US \
	-use-network=false \
	-file-specs MyExampleClass.as

Note: For those of you that don't know it already, the Flex SDK is a free of charge Actionscript3 library that allows the development of Flex & Actionscript 3-based applications, without the need to purchase Flex Builder/Flash Builder.


PV3D 2D->3D , 3D->2D

Posted: July 16th, 2009 | Author: Tiago Bilou | Filed under: 3D, Actionscript3, Papervision3d | 6 Comments »

This week I finally had a project that involved 3D (about time too).
Since it involved interacting with 3D models, using Flash 10 was out of the question. So I opted to go with papervision, instead of away3D or alternativa3D, since this was the engine we where more accustomed to.

Sometime along the development of the application I came across the need to convert 3D coordinates into 2D screen coordinates and also the opposite. It's nothing new and it's already implemented in papervision, but since it took me a little while to find it, I decided to share it.

Getting the 2D Screen coordinates from a DisplayObject3D

Since papervision 2.0 that every DisplayObject3D has a property called "screen", that will return the coordinate of the object on screen. Whenever I tried to access the screen property the number3D I got back was always (0,0,0). Probably because it's an expensive operation and it's something you only need sporadically, papervision will not calculate this automatically. You need to ask papervision yourself to calculate this coordinates. To do so, just use the "calculateScreenCoords" of the do3d

myDisplayObject3D.calculateScreenCoords(camera)

Now when you try to access the "screen" property you will get the number3D with the screen coordinates for your DisplayObject3D.

Getting the 3D coordinates from a 2D point (x,y)

For this one I found a great post by zupko that tells you exactly what you need to do.
In a nutshell, you need to take your 2D coordinates (x,y) and convert them into a direction vector. Having the vector and the camera position you can create a ray (line) that will go from the camera into infinity. Next you need to specify the Z, or in another words, where do you want to stop on that line. Zupko uses a 3D plane to do that using the "getIntersectionLineNumbers"

Just remember papervision's 3D Zero (0,0,0) is at the center of the screen and not on the upper left corner like the 2D Zero (0,0)


Flash Player update available to address security vulnerabilities

Posted: March 2nd, 2009 | Author: nuno | Filed under: Actionscript3 | 23 Comments »

A potential vulnerability has been identified in Adobe Flash Player 10.0.12.36 and earlier that could allow an attacker who successfully exploits this potential vulnerability to take control of the affected system. A malicious SWF must be loaded in Flash Player by the user for an attacker to exploit this potential vulnerability. Additional vulnerabilities have been addressed in this update. Adobe recommends users update to the most current version of Flash Player available for their platform.

More information about this security vulnerability is available at:

http://www.adobe.com/support/security/bulletins/apsb09-01.html

Follow us on Twitter: @morgadin, @tiagobilou, @lofih


gskinner’s tweetcoding competition

Posted: February 18th, 2009 | Author: Tiago Bilou | Filed under: News | No Comments »

gskinner had a great ideia last night for a competition using twitter. He called it tweetcoding
The ideia is to code something cool in <=140 characters of AS3 and post it to twitter.

We'll be sure to give it a go :)


pv3d gallery for actionscript 3 project

Posted: November 9th, 2008 | Author: Ivan Valadares | Filed under: 3D, Actionscript3, Code, Papervision3d | 2 Comments »

I start working on a photo library in papervision, so I look around I got an example from flashEnabledBlog, one of the problems was that the example was in flash cs3 and I need it in flex actionscript project, the other one was that the example was done with old papervision and tweener versions, so I had to port it. It’s a good start if you have to do something like it. I Include lasted versions of Tweener and Papervision in the zip file, you just have to run it.

pv3d_gallery_as3project


Custom MovieClip ScrollBar

Posted: October 28th, 2008 | Author: Ivan Valadares | Filed under: Actionscript3, Components | 22 Comments »

It’s a really easy to modify this vertical scrollbar. Use and Abuse!

Example
Source Zip


Where is as2 _root in as3?

Posted: October 27th, 2008 | Author: Ivan Valadares | Filed under: Actionscript3, Best Practices, Code | 8 Comments »

If you remember in as2 we had _root which let us access to methods and variables in the root of the project and refer to absolute paths, I thought that as3 didn’t have _root propriety, but I was wrong. root property can be useful if you want to share some value to all the classes in the project, add events to main class that call methods declared inside the class where we are working on or call generic methods declare in root class.

To use root propriety the class that you are working on most extend a DisplayObject (Sprite,MovieCLip,etc…) because you have to add the class to the parent class. And note, you can’t use the root propriety in the constructor method, because the addChild haven’t been process yet! Well let’s stop writing and see some code:

Main.as

In the Main class I’m declaring a variable named myValue which I did the proper sets and get. I am declaring two classes, in one of them I will set the value at the Main class and in the other I will get that value back. I’m also creating a movieClip just for test purposes.

ExampleClass.as

In ExampleClass I’m setting myValue that is propriety of the Main class with some text and I’m tracing the movieClip that I create in the Main Class.

AnotherClass.as

In AnotherClass I’m tracing the myValue propriety. So the result should be:
[object MovieClip]
This value is inside the Main Class

So it works ok, you only have to be carefull not refer root inside the constructor method, have the certain that you already addChild the class when you are referring to root and that the class extends a display object. If you do that, you can too have access to stage propriety, let’s check the next example:

ExampleClass.as

The result should be or stage width.

Another way to access to main proprieties, methods, etc… is with static members. In the next example I’m declaring a static property in the main class and setting and trace the value of it in the example class.

Main.as

ExampleClass.as

The result should be “Hello Word!”, if you didn’t know this, read some books about object oriented programming and static members.

Another way to do the same thing is to pass the instance of main class as an argument to the other classes.

Main.as

Example.as

There are still another ways to access to the Main class code. I don’t know which techniques are more correct, I usually use them all depending in what I need. I hope I help someone. :)


Interview with Alex Karpovich (Alternativa3D)

Posted: October 7th, 2008 | Author: Idoru | Filed under: Interviews | Tags: , , | 78 Comments »

Following our tradition of getting the makers of the most used 3D engines out there we landed an interview with Alex Karpovich, from Alternativa3D.

Read the rest of this entry »


FOTB 08 #3

Posted: October 3rd, 2008 | Author: Idoru | Filed under: FOTB 08, Flash on the Beach | Tags: , | 4 Comments »


Flash on the beach is over! It's always a mix of joy and sadness. This year's been terrific, with great talks, great parties and amazing people!

So here's my final day's reviews:

Rob on Away3D: It started with a little background on the platform and some early demos that described the problems that Away3D had to solve, and why they started  it in the first place, with stuff like Triangle Caching allowing some of the demos to have over 100 000 polygons on screen and still maintain quite acceptable frame rates! The he showed us a few amazing demos of current usage of Away3D including a RPG called Dragon Wars that was mind-blowing, overall very cool presentation.

Nicolas Lierman on AIR Analytics: This presentation focused on showing all that data that we collect from our sites and applications in meaningful ways and gave us a little technical and personal background on the AIR Analytics application.

André Michelle Make some noise: As always with André the presentation was energetic and ended with a rave, but this year he gave us a big technical insight on how the achieves his results.

Koen de Weggheleire - This was one of the coolest sessions in FOTB, Koen talked about Matrices and how they work, and i finally got it!

Mario Klingemann: What can I really say about Mario's session, it was impressive to say the least, this time he focused heavily on the concept part of manipulating pixels, and by not going into code he managed to provide us with the how he does it.

Jonathan Harris: I had seen Jonathan before at a TED talk, online that is, and was blown away when I found that he'd be at FOTB '08. He went through his life experience explaining each endeavor and showing us amazing examples, that you just can't help but to fall in love with.
To close his session he delivered a speech to the community about how he feels us, an eye opener!

And to finalize I won a FOTB 08 Jacket and that's just cool!

It was amazing as always, living up to the Hype and there's a lot of it! And I hope to you guys here next year!


FOTB ‘08 Day #2

Posted: October 1st, 2008 | Author: Idoru | Filed under: FOTB | Tags: | No Comments »

FOTB 08 Day #2

Ok so here we are at day #2 of FOTB '08 and today was inspiring to say the least, I chose to go a bit more on the inspiring side and less on the technical part and it paid off brilliantly. This is clearly one of the areas I feel myself lacking and I feel like I've learned quite alot!

Mike Downey on AIR - Mike's session about how to pitch and sell AIR applications was an eye opener and consolidated a lot of concepts I already had.
He told us about the Lighthouse project that is meant to give out a hand to developers, and companies, in pitching AIR applications and they might even help you prototype it! Also he spoke about the AIR marketplace and how it can boost your app, good stuff!

Adobe Townhall Meeting - So every year the Adobe teams comes together and answers our questions. There were plenty of questions this year but I'll leave you with the most exciting answers: Flash is coming to the iPhone!!! And AIR is coming to mobile!

Jam Session - This was one of the coolest sessions in the conference, with André Michelle, Carlos Ulloa, Ralph Hauwert, Mario Klingemann, Joa Ebert where they showed off amazing stuff they've been working on, I'll try and refer you to a better post as soon as find one!

GSkinner - This year Grant went more on the how to handle your workflow and solve programming problems, and eye opener.

Hoss - Hoss was amazing, with an energetic presentation of his work and telling us to focus on the user eXperience instead of everything else, because in the end that's all that matter, plus nudity!

So that was it for day two, I attended a few more sessions but i didn't see them as relevant as they were more for inspiration.