Tags: , ,

The new ActionScript 3.0 Client Library for Facebook Platform API, fully supported by Facebook and Adobe, makes it easy to build applications that combine the strengths of the Flash Platform and Facebook Platform.

The Adobe Flash Platform and Facebook Platform provide the ideal solution for building rich, social experiences on the web. Flash is available on more than 98% of Internet-connected PCs, so people can immediately access the applications, content, and video that enable social interactions. The Facebook Platform is used by millions of people everyday to connect and share with the people in their lives. Together, both platforms allow you to:

  • Share: Create rich interactions for users to share with friends.
  • Have fun: Make games social; let users compete against their friends.
  • Connect: Let users connect to your RIAs with Facebook Connect.
  • Solve problems: Build RIAs that harness the power of community.
  • Reach people: Reach millions of Facebook users through social distribution.

Getting Started

For tutorials, articles, and videos on using the new API, visit the Facebook page on the Adobe Developer Center. You can also see the docs for the most recent and stable build.

Project History

The API was originally developed by Jason Crist and authored under the direction of Terralever, an online marketing firm with strength in Flash-based media. Although Adobe has taken over day-to-day management of the project, Jason still maintains a consulting role. Under the direction of Adobe, the highly experienced team of Flash and Flex experts from gskinner.com have developed and architected the latest iteration of the API.

If you are looking for the deprecated code and samples, see the ‘tag/version2’ directory in the repository or search for files with the ‘Deprecated’ tag in the downloads section.

For questions and inquiries about this library, please contact Daniel Dura at Adobe Systems via email at ddura@adobe.com. Submit bug reports, patches, or feature requests via the issue tracker.







SVN Location


Combine PV3D & Webcam Motion Tracking

Combine PV3D & Webcam Motion Tracking

Categories: Showroom

GA for Flash

Categories: Actionscript 3

An XPath implementation for ActionScript 3.0.

From http://code.google.com/p/xpath-as3/

An XPath implementation for ActionScript 3.0.


XPath-AS3 can be used in any AS3 project, including:


Basic overview of how to use the XPath library

Executing XPath Statements

XPath queries are evaluated using the XPathQuery object.

// create the XPathQuery instance and parse the path
var myQuery:XPathQuery = new XPathQuery("path/to/evaluate");
// execute the statement on an XML object and get the result
var result:XMLList = myQuery.exec(myXML);

Using namespaces

To use namespaces, you need to register namespace prefixes with the corresponding URI. This prefix does not need to match the prefix used in the XML document, but must match the prefix that you use in your XPath statements.

var myQuery:XPathQuery = new XPathQuery("ns1:path/to/ns2:evaluate");
.context.namespaces["ns1"] = "http://domain.com/2006/ns1";
.context.namespaces["ns2"] = "http://domain.com/2007/ns2";

Short-hand Namespace handling

There are two more convenient ways of adding the namespaces, by either opening all the namespaces, or automatically declaring the same prefixes as the document.

By setting ‘useSourceNamespacePrefixes’ to true, any namespace declarations in you the XML document will be automatically declared for the XPath expression, using the same prefixes:

var myQuery:XPathQuery = new XPathQuery("ns1:path/to/ns2:evaluate");
.context.useSourceNamespacePrefixes = true;

The easiest (although perhaps least safe) way is with the openAllNamespaces property. Although, if there are several namespaces used in the document, there is a chance of name conflicts:

// no need for prefixes in this statement
var myQuery:XPathQuery = new XPathQuery("path/to/evaluate");
.context.openAllNamespaces = true;

The XPathContext object

The XPathContext object is how you can specify namespaces, variables and custom functions to use in your XPath statements. By creating an instance of XPathContext, you can pass it as an argument to the constructor all of your XPathQueries, so you do not have to set them all up individually.

// create the context instance
var context:XPathContext = new XPathContext();
// declare a namespace
.namespaces["ns1"] = "http://domain.com/2006/ns1";
// define a custom variable
.variables["myCustomVar"] = true;
// Pass the context to the XPathQuery instance
var myQuery:XPathQuery = new XPathQuery("path/to/evaluate", context);

Alternatively, you can customise the default XPathContext, which will then apply to all XPathQueries, as long as you don’t also pass one as an argument.

// this namespace will be available to all XPathQuery objects
XPathQuery.defaultContext.namespaces["ns1"] = "http://domain.com/2006/ns1";

Extending XPathContext

Sometimes it is more convenient to extend XPathContext and use instances of the subclass in your expressions. If you do this, it is important to override the copy() method, which is used internally in sub-expressions.

public class MyContext extends XPathContext {
public function MyContext(){
// add the custom functions to the functions table
['custom-function'] = customXPathFunction;

// custom XPath functions must receive a reference to the
// context as their first argument. You may have any number of other
// arguments of any type, and the return value can be any type.
private function customXPathFunction( context:MyContext, arg1, arg2.. ):String
// add code here

// extensions to MyContext must implement copy()
public override function copy():XPathContext
var clone:MyContext = new MyContext();
// use the utility method to make sure that all the built-in and
// internal properties are copied
( clone, this );
return clone;
var path:String = "path/to/evaluate[@att = custom-function(1,2)]";
var myQuery:XPathQuery = new XPathQuery(path, new MyContext());
SVN location
Categories: Actionscript 3 Tags: , ,

AS3 Webcam Motion Tracking

AS3 Motion Tracking and Detection

Detecting & Tracking Objects movement in Flash

Here’s how it works

  • After the camera object is set up, it is passed to a MotionTracker class I wrote, which extends the Point object. The MotionTracker class contains two BitmapData objects; one representing the current data from the webcam, the other is used to store the previous frame.
  • When the update method is called, the new frame is drawn on top of the previous using the difference filter.
  • The result then has a ColorMatrixFilter applied to it, increasing the contrast of the image and dropping the darker areas (with less movement) further into the background.
  • A blur filter is then applied in order to further reduce noise and to form blobs from areas where more movement is occurring.
  • The threshold method is then called in the resulting BitmapData, effectively causing all near black pixels to be ignored and all light pixels (where movement has been detected) to be set to a certain colour.

So that takes care of the motion detection, but what about the tracking?

  • First we call the getColorBoundsRect method on the BitmapData object, which gives us a Rectangle object representing the area occupied by pixels of the colour we used when applying the threshold filter.
  • If the rectangle has an area larger than a specified constant, then sufficient movement is occurring and it can be tracked (choosing to ignore small areas of movement helps to eradicate noise caused by background and other interferences).
  • We then find the centre point of this rectangle, and then move the x and y position of the MotionTracker instance to these coordinates, applying some gentle easing to give more continuity to the movement

AS3 Motion Tracking from Justin Windle on Vimeo.


from blog.soulwire.co.uk

Categories: Actionscript 3

Tweener (caurina.transitions.Tweener)

Tweener (caurina.transitions.Tweener) is a Class used to create tweenings and other transitions via ActionScript code for projects built on the Flash platform. It’s released and maintained for these versions:

* ActionScript 2.0, for Flash 7+ and Flash Lite 2.0+

* ActionScript 2.0, for Flash 8+

* ActionSctipt 3.0, for Flash 9+

Ported versions for other languages are also available:

* haXe version (ported by Baluta Cristian)

* JavaScript version (ported by Yuichi Tateno)

* JavaScript version (ported by Michael MacMillan)

* version using nodes

* version using a native C# dll (faster) (ported by by Rene Westhof)

* Python version (ported by Benjamin Harling)

* C++ version (ported by Wesley Marques)

There are also some other libraries inspired by it:

* Artefact Animator for Silverlight/WPF (by Jesse Graupmann, among others)

In layman’s terms, Tweener helps you move things around on the screen using only code, instead of the timeline.

The general idea of a tweening Class is that dynamic animation and transitions (created by code) are easier to maintain and control, and more stable than animation based on the regular Flash timeline, since you can control it by time rather than by frames.

Aimed both for designers and advanced developers, the Tweener syntax is created with simplicity of use in mind, while still allowing access to more advanced features. Because of this, it follows a ‘one-line’ design mentality when creating new tweenings, with no instancing required (as it’s a static Class) and a set of optional parameters. Also, there are no initialization methods required by Tweener, other than the mandatory ‘import’ command.

Its fluid syntax allows it to be used to tween any numeric property of any object of any class, so it is not tied to specific properties of built-in Classes such as MovieClips or TextFields. This flexibility grants a wider control on how transitions are performed, and makes creating complex sequential transitions on any kind of object easier.

Small file overhead is also one of the main goals of Tweener – once included on SWF movies, Tweener currently takes 8.8kb (AS2 FL2), 9.2kb (AS2) or 10.4kb (AS3) of the total compiled file size. It can be compiled with the Flash IDE, MTASC, or Flex SDK (even with strict rules on), with no errors or warnings thrown during compilation.

Tweener is also the spiritual successor to MC Tween. However, it follows ActionScript’s more strict OOP rules, and gets rid of the fixed parameter order syntax imposed by MC Tween. As a result, code written with Tweener is a lot more readable even for developers not versed on the Class.

Development wise, modularity is one of the main aspects of Tweener. The code is built in a way that new features such as transitions and special tweenings can be added (or removed) easily: for example, properties that are only acessible through methods and functions can be tweened by creating and registering new special properties. Expanding the feature set of the original Class can be done on a per-project basis, with no change to the original files.

Tweener Class – AS3
Tweener Class – AS2

SVN location

from http://code.google.com/p/tweener

Adobe Flash. Available Now on Mobile Android Devices.

News Flash: The monthly newsletter for Flash(R) Platform Developers

The Adobe® Flash® Platform has received several big updates. Adobe recently launched a public beta of Flash Player 10.1 for Android™ at Google I/O, the first full version of the Flash Player designed specifically for mobile devices. In addition, Adobe Creative Suite® 5 software has now started shipping, with Adobe Flash Builder™ 4 and Adobe Flash Catalyst™ now part of Adobe Creative Suite 5 Web Premium.

Earlier in May, we hosted an online developer week for developers to learn more about the tools and runtimes of the Adobe Flash Platform. All the sessions from that week have been recorded and posted online. Now we’re ready to do it again. From June 7–10, Adobe is hosting “Build an app in a week”—a week of online eSeminars that walk you through the entire process of building an application with Creative Suite 5 and the Flash Platform and running it on desktops and mobile devices. Register to attend and learn more about how Adobe helps designers and developers build amazing applications quickly.

The Adobe® Flash® Platform has received several big updates. Adobe recently launched a public beta of Flash Player 10.1 for Android™ at Google I/O, the first full version of the Flash Player designed specifically for mobile devices. In addition, Adobe Creative Suite® 5 software has now started shipping, with Adobe Flash Builder™ 4 and Adobe Flash Catalyst™ now part of Adobe Creative Suite 5 Web Premium.

Categories: Flash News Tags: