Header Ads

New Project Capuchin tutorial: how to handle external resources

This new tutorial for both Flash Lite™ and Java™ ME developers illustrates how to access external resources and data from Flash using the ExternalResourceHandler class in the Sony Ericsson Project Capuchin API. The tutorial provides step-by-step instructions, screenshots and code snippets on how to create a Thumbnail Viewer project and comes with an accompanying zip file containing the required resource files.

Download tutorial: Handling external resources with Project Capuchin for Flash and Java developers>>

Tutorial introduction
This tutorial outlines how to access external resources and data from Flash using the ExternalResourceHandler class of the Project Capuchin API. Java ME and Adobe® Flash CS3 technologies are used for creating a Thumbnail Viewer and instructions are provided for setting up the working environment.

The ExternalResourceHandler interface is used to load external resources that are referenced within Flash content. The interface has a default implementation, provided by the Project Capuchin API, that handles external files (file:///), Internet resources (http://) and MIDlet resources (res://).

In this tutorial, the default handler is overriden by using a custom implementation of the interface to provide a variety of use cases that can encounter Project Capuchin developers. Thus the method requestResource() is implemented to handle calls for ActionScript loadVars()and loadMovie() functions. The loadVars() function is used to retrieve names of the newest three pictures in the camera album, while loadMovie() calls are used to load thumbnails of each image that has been previously loaded by loadVars().

The Thumbnail Viewer project in two parts – Flash and Java
To build the Thumbnail Viewer, the instructions are presented in two sections:

The Flash part: The Flash file (.fla file) is created in Flash CS3. After compiling, the .fla file is published as a Shockwave (.swf) file. To create a .swf file for a Sony Ericsson phone, the .fla file content needs to be exported/compiled as a Flash Lite application.
The Java part: The Java application with Project Capuchin is produced by creating a FlashImage object with the Flash content, a FlashPlayer, attaching the FlashImage and a FlashCanvas that will be set as the current Displayable. The Java application contains all the logic and is responsible for handling all the requests from the Flash part.


The Thumbnail Viewer example in Flash CS3.

About Sony Ericsson's Project Capuchin technology

Sony Ericsson's Project Capuchin allows developers to combine the richness of both Java ME and Flash Lite by encapsulating Flash Lite content in Java ME applications making content created by Adobe Flash technology appear as Java ME applications.

Sony Ericsson's Project Capuchin SDK is a set of APIs, a packaging tool, documents and getting-started tutorials, available as separate files to make the SDK as accessible as possible to both Java and Flash Lite developers. Download>>


No comments:

Powered by Blogger.