Physics Engine
This looks pretty cool. Box2DAs3 Physics Engine.
(via polygonal labs)
Other physics engines:
Flex and Flickr - Quick Start
I decided to do something that no one has thought of before - put flickr images into a Flex app. Here’s a very quick getting started guide. Here’s a link to the final app.
Get the following Adobe libraries:
flickr
corelib
Extract both folders and put into your FlexBuilder3 directory in myDocuments. I am using Flex Builder 3 Beta 2.
Change the names of the folders flickr and corelib (remove the version numbers - make sure “src” is a top level directory)
In Flex, right-click to add a new library. Use default path and name the projects flickr and corelib.
Once the projects are created, right-click on the project, choose Properties. Select FlexBuildPath. Set the main source path to “src”. Click on src to add the classes.
For the flickr library - right-click, select PropertiesClick “Flex Build Path”. Choose “Libraries”. Add the corelib library.
Then create a new project that will use the Flickr API. After creation. Right click on the project, select Properties. Click “Flex Build Path”. Choose “Libraries”. Add both flickr and corelib.
Paste this code into your app…
Actually, the formatting of this gets screwed up in the blog. Go to the app and right click to get source.
< ?xml version="1.0" encoding="utf-8"?>
< ![CDATA[
import com.adobe.webapis.flickr.Photo;
import com.adobe.webapis.flickr.PagedPhotoList;
import com.adobe.webapis.flickr.events.FlickrResultEvent;
import com.adobe.webapis.flickr.methodgroups.Photos;
import com.adobe.webapis.flickr.FlickrService;
private var myFlickr:FlickrService;
public function init():void{
myFlickr=new FlickrService("5b7c5a6ff6f1863f261d55f6afc391b6");
myLabel.text='searching for dog pictures';
photos=myFlickr.photos;
photos.search('', 'dog');
myFlickr.addEventListener(FlickrResultEvent.PHOTOS_SEARCH, searchComplete);
}
private var photos:Photos;
public function searchComplete(e:FlickrResultEvent):void{
myLabel.text='search complete';
var ppl:PagedPhotoList=e.data.photos as PagedPhotoList;
var o:Object=e.data;
var photoList:Array=ppl.photos;
var photo:Photo=photoList[0] as Photo;
var imageURL:String = "http://static.flickr.com/"+photo.server+"/"+photo.id+"_"+photo.secret+".jpg";
myImage.source=imageURL;
}
]]>
If you run that, you should get a picture of a dog. I included a flickr api key above. But, you should really get your own. Get it here. It’s immediate.
To do more than display a dog, below is a good example w/ source.
Flickr Flex app.