Geting started with Starling, running Flash in GPU.

With Flash player 11 comes Stage3D, which enables us to run Flash content in GPU. While its all good, coding for a simple task looks as if something real big.

Fortunately Starling-framework makes the life easier. Its a framework on top of Stage3D(codenamed Molehill). The best part of it is one can just use it as if using flash’s own API. It has movieclip, sprite, events and displaylist. While I was trying my first handson this framework, found some must to do things, which may save someone’s time.

Minimum requirement,

To run
1. First of all, it needs Flash Player 11.
2. It must be run inside a browser. Yeah, SWF must be embedded inside a HTML page.
3. Inside the embed code, “mode” must be set to “direct”.

<param name="wmode" value="direct">

4. Embeding the swf with SWFObjectdoes not work for me. So used the minimum default Object-embed method. To author 1. Need Flash Player 11 SDK 2. Overlap it on Flex SDK 4.5.1 , so that you got the compiler ready. 3. Compile with extra compiler argument as ” -swf-version=13 “.

The basic HTML boilerplate code to embed look as

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
        <title>HelloStarling</title>
        <meta name="google" value="notranslate">         
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="600" height="600" id="movie_name" align="middle">
    <param name="movie" value="Startup.swf"/>
    <param name="wmode" value="direct">
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="Startup.swf" width="600" height="600">
        <param name="wmode" value="direct">
    </object>
    <!--<![endif]-->
</object>   
   </body>
</html>

 

 

Happy Flashing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s