Adobe Scout and how to use ANT to enable Advanced Telemetry in FDT

Hello there,

So as you might have heard by now adobe just launched the Game Developer Tools in their Creative Cloud including the Adobe Gaming SDK 1.0 which includes the latest Adobe Flash platforms tools to get started creating cross-platform desktop and mobile games.

The SDK contains the following:

  • The AIR SDK 3.5 for compiling and packaging your mobile (AIR) and web (Flash Player) based games.
  • Native Extensions (ANE) Beta including extensions for iOS Game center, Product Store, SOcial, StageAD, BetaTesting.
  • Starling The 2D (Stage3D) open-source framework.
  • Feathers The 2D (Stage3D) open-source UI component framework.
  • Away3D The 3D open-source framework to power your 3D games.
  • ATF Tools Command-line utilities for the creation of ATF ( compressed textures) for Stage3D
  • Samples 3 Flash Builder 4.7 example Projects that use a combination of the tools included in the SDK.

Alongside the release of this SDK Adobe also released the first public beta of Adobe Scout (previously codenamed Monocle) the next-generation advanced profiling tool for Flash Player and AIR.

Quoting Adobe:

“Adobe Scout will revolutionize the way developers profile and optimize ActionScript based content. For the first time, developers have access to very granular information about CPU and GPU rendering, network or ActionScript stack.”

Which lead us to the second part of this post

Using ANT to enable Advanced Telemetry in FDT

So if you follow me on twitter or are a frequent reader of this blog you must know by  now that my weapon of choice for Flash Platform projects is FDT  so i wanted  to try the advanced features of Adobe Scout in my FDT projects, in order to use those advanced features Scout relies on the telemetry feature that was introduced in Flash Player 11.4 and Adobe AIR 3.4. This feature gathers detailed information about the internals of the Flash runtime, as well as the ActionScript code that it executes, and sends it all to Scout. To access all the data that is available, such as information on your ActionScript code and detailed information about DisplayList rendering and Stage3D, you need to enable advanced telemetry on your SWF.

If You’re a Flash Builder 4.7 user the enable advanced telemetry is built in so all you need to do is to click a checkbox in order to enable it. The FDT is currently working to implement an advanced telemetry option in the FDT IDE. But being the obsessive folk that i am i wanted to try those features “RIGHT NOW!” so i build a little ANT task file that enables advanced telemetry in your SWF by using a Python script (add-opt-in.py).

Heres how to use it:

To use this ANT task You need to have the following components:

1.- At least Adobe Flex 4.6 SDK with AIR 3.4 or the Flash Player 11.4.
Adobe Scout desktop application. You can find the Adobe Scout and the latest AIR SDK at:
http://gaming.adobe.com/

2.- In order to run the add-opt-in.py script  you’ll need to have python installed (I’m using Python 2.7.3 Mac OS X 64-bit/32-bit x86-64/i386)

Download Python at:
http://www.python.org/download/

3.- You can download or fork the add-opt-in.py script (it’s already included in this project in the scripts folder)  from:
https://github.com/adamcath/telemetry-utils

4.- Learn more about Adobe Scout reading the “Getting started with Adobe Scout” article by Thibault Imbert:
http://www.adobe.com/devnet/flashruntimes/articles/adobe-scout-getting-started.html

Here’s the ANT task project:

The Ant project has instructions and comments on how to use each of the tasks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--?xml version="1.0" encoding="UTF-8"?-->
<?xml version="1.0" encoding="UTF-8"?>
<project name="Advanced Telemetry" default="03. Run Application">
	<!--/////////////////////// Project Properies //////////////////////-->
	<!-- Your Project's name -->
	<property name="project_name" value="AdvancedTelemetryAntExample"/>
	<!-- Your Project's source folder. -->
	<property name="src_dir" value="${basedir}/../../src/classes"/>
	<!-- Your Project's deploy folder. -->
	<property name="deploy.dir" value="${basedir}/../../bin"/>
	<!-- Your Project's script folder (where your Python Script is). -->
	<property name="scripts_dir" value="${basedir}/scripts"/>
	<!-- Path to the 'Main' or 'Document' class for your .SWF file.-->
	<property name="main_class" value= "${src_dir}/com/swfgeek/test/AdvancedTelemetryAntExample.as"/>
	<!-- Flag whether to compile the SWF for debugging.-->
	<property name="debug_enabled" value="false"/>
	<!-- The name of your swf file.-->
	<property name="swf_name" value="${deploy.dir}/AdvancedTelemetryAntExample"/>
	<!-- The launcher you'll be using once your SWF is compiled.
	The below values are applicable when using the swflauncher argument:
		External SWF Viewer
		Adobe Flash Player
		Browser
		Internal SWF Viewer
		AIR Debug Launcher -->
	<property name="launcher" value="Adobe Flash Player"/>
 
	<!-- The "Build SWF File" task will compile your SWF and add it to your deploy directory.-->
	<target name="01.Build SWF File">
		<fdt.launch.application 
			projectname="${project_name}" 
			mainclass="${main_class}" 
			debug="${debug_enabled}"  
    		target="${swf_name}.swf" 
    		startswf="false" 
    		swflauncher="${launcher}"/>
	</target>
 
	<!-- The "Add Advanced Telemetry" task will execute the add-opt-in.py thon script on  your SWF and add the  EnableTelemetry tag to for use with Adobe Scout (You can also run this task if you've already compiled the SWF).
	When adding [password] just after the ${swf_name}.swf advanced telemetry will only be visible
	if a matching password is entered in Adobe Scout. -->
	<target name="02. Add Advanced Telemetry"  depends="01.Build SWF File">
		<exec dir="${scripts_dir}" executable="python" failonerror="true">
		    <arg line="add-opt-in.py ${swf_name}.swf" />
		</exec>
	</target>
 
	<!-- The "Run Application" task is the default in your ANT project and will compile, add telemetry and run your SWF. Once your SWF is running you'll be able to see the Advanced Telemetry options in Adobe Scout.-->
	<target name="03. Run Application" depends="02. Add Advanced Telemetry">
		<fdt.loadProjectProperties/>
		<fdt.startSwf projectname="${project_name}" swflocation="${swf_name}.swf" swflauncher="${launcher}" />
	</target>
</project>

Examples

Here are the examples with advanced telemetry enabled, you can open both this SWFs in your browser and if you have Adobe Scout opened you’ll see the the advanced telemetry information the file outputs to Scout.

Starling Example (with a cool animated character stolen from Chris Georgenes).
Flash Display Example (just random color circles)

Here is the zipped project including the AdvancedTelemetryANT Project and the source code for compiling both examples:

Advanced Telemetry ANT Example Project

Adobe Wallaby Prerelease 1 Example

Yesterday I posted a video of  how Adobe’s new Flash to HTML5 conversion tool “Wallaby” works. I was so excited by this new black magic stuff that I forgot to put up an example(big duhhh), so thanks to Antonio Holguin‘s comment in my previous post here’s the Wallaby generated HTML5 I showed in the video I made small modifications to the .html and .css files to add the Flash Animation so You can compare the Flash and the HTML5 versions.

Click on the image to see the example:

Here is the HTML file Wallaby generated:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!-- Created with Adobe(R) technology -->
 
    <script src="jquery-1.4.2.js" type="text/javascript"><!--mce:0--></script>
    <script src="index.js" type="text/javascript"><!--mce:1--></script>
    <script src="swfobject.js" type="text/javascript"><!--mce:2--></script>
	<script type="text/javascript"><!--mce:3--></script>
 
 
 
<div class="mainDiv">
 
 
<div class="myFontHTML5">
 
<a>Wallaby HTML5 Generated Animation</a>
</div>
 
 
 
<div class="wlby_movie">
 
 
<div class="wlby_1">
        <!-- Start of symbol: daveflota -->
 
 
<div class="wlby_2">
          <!-- Start of symbol: Tween 1 -->
          <img class="wlby_3" src="index_assets/svgblock_0.svg" alt="" />
 
 
<div class="wlby_4">
            <!-- Start of symbol: sombrero -->
 
 
<div class="wlby_5">
              <!-- Start of symbol: Tween 7 -->
              <img class="wlby_6" src="index_assets/svgblock_1.svg" alt="" />
              <!-- End of symbol: Tween 7 --></div>
 
            <!-- End of symbol: sombrero -->
 
</div>
 
 
 
<div class="wlby_7">
            <!-- Start of symbol: ojitosdave2 -->
 
 
<div class="wlby_8 wlby_sprite">
              <img class="wlby_17 wlby_fs" src="index_assets/svgblock_2.svg" alt="" />
              <img class="wlby_18 wlby_fs" src="index_assets/svgblock_3.svg" alt="" />
              <img class="wlby_18 wlby_fs" src="index_assets/svgblock_3.svg" alt="" />
              <img class="wlby_19 wlby_fs" src="index_assets/svgblock_3.svg" alt="" />
              <img class="wlby_20 wlby_fs" src="index_assets/svgblock_4.svg" alt="" />
              <img class="wlby_21 wlby_fs" src="index_assets/svgblock_5.svg" alt="" />
              <img class="wlby_22 wlby_fs" src="index_assets/svgblock_4.svg" alt="" />
              <img class="wlby_23" src="index_assets/svgblock_2.svg" alt="" /></div>
 
            <!-- End of symbol: ojitosdave2 -->
 
</div>
 
          <!-- End of symbol: Tween 1 -->
 
</div>
 
        <!-- End of symbol: daveflota -->
 
</div>
 
 
</div>
 
 
 
<div class="myFontFlash">
 
<a>Flash CS5 Original Animation</a>
</div>
 
 
 
<div class="myFlashContent">
 
 
<div id="flashContent">
		<a href="http://www.adobe.com/go/getflashplayer" target="_blank">
	        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
	    </a></div>
 
 
</div>
 
 
 
<div class="animCredits">
 
 
<a>Character design and animation by:</a> <a href="http://www.cecymeade.com"> Cecy Meade</a>
 
 
</div>
 
 
</div>
 
 

And the CSS file Wallaby generated:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
div.wlby_movie
{
	overflow: hidden;
	position: absolute;
	left: 0px;
	top: 40px;
	width: 550px;
	height: 400px;
	margin-left:560px;
}
.wlby_text p { padding: 0; margin: 0; }
 
a.wlby_classic-link { color: inherit; text-decoration: none; }
a.wlby_classic-link:link { color: inherit; text-decoration: none; }
a.wlby_classic-link:hover { color: inherit; text-decoration: none; }
a.wlby_classic-link:active { color: inherit; text-decoration: none; }
a.wlby_classic-link:visited { color: inherit; text-decoration: none; }
 
a.wlby_tlf-link { color: inherit; text-decoration: none; }
a.wlby_tlf-link:link { color: inherit; text-decoration: none; }
a.wlby_tlf-link:hover { color: inherit; text-decoration: none; }
a.wlby_tlf-link:active { color: inherit; text-decoration: none; }
a.wlby_tlf-link:visited { color: inherit; text-decoration: none; }
 
.wlby_button &gt; * { visibility: hidden; }
.wlby_button &gt; .wlby_button_normal { visibility: visible; }
.wlby_button:hover &gt; .wlby_button_normal { visibility: hidden; }
.wlby_button:hover &gt; .wlby_button_hover { visibility: visible; }
.wlby_button:active &gt; .wlby_button_normal { visibility: hidden; }
.wlby_button:active &gt; .wlby_button_hover { visibility: hidden; }
.wlby_button:active &gt; .wlby_button_active { visibility: visible; }
 
@-webkit-keyframes wlby_frameset-animation {
	from { }
	to { }
}
 
.wlby_fs, .wlby_graphic 
{
	-webkit-animation-name: wlby_frameset-animation;
}
 
.wlby_graphic 
{
	-webkit-animation-duration: 1s;
}
 
.wlby_masked 
{
	height: inherit;
	position: inherit;
	width: inherit;
}
 
.wlby_sprite 
{
	-webkit-animation-name: wlby_frameset-animation;
	-webkit-animation-iteration-count: infinite;
}
 
@-webkit-keyframes wlby_KF_5 {
from {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
	opacity: 1;
}
46.66% {
	-webkit-transform: matrix(1, 0, 0, 1, 0, -10);
	opacity: 1;
}
96.66% {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
	opacity: 1;
}
96.67%, to {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
}
}
@-webkit-keyframes wlby_KF_9 {
from {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
	opacity: 1;
}
46.66% {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 5);
	opacity: 1;
}
96.66% {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
	opacity: 1;
}
96.67%, to {
	-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
}
}
.wlby_3
{
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -102.635, -127.95);
}
 
.wlby_23
{
	-webkit-animation-duration: 0.0322581s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -76.161, -31.85);
}
 
.wlby_20
{
	-webkit-animation-duration: 0.129032s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -76.161, -31.85);
}
 
.wlby_17
{
	-webkit-animation-duration: 0.612903s;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -76.161, -31.85);
}
 
.wlby_22
{
	-webkit-animation-duration: 1.64516s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -76.161, -31.85);
}
 
.wlby_19
{
	-webkit-animation-duration: 0.0322581s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -75.875, -7.3);
}
 
.wlby_18
{
	-webkit-animation-duration: 0.16129s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -75.875, -7.3);
}
 
.wlby_21
{
	-webkit-animation-duration: 0.290323s;
	display: none;
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -75.875, -7.3);
}
 
.wlby_6
{
	position: absolute;
	-webkit-transform: matrix(1, 0, 0, 1, -29.813, -20.309);
}
 
.wlby_8
{
	-webkit-animation-duration: 3.06452s;
}
 
.wlby_2
{
	-webkit-animation-duration: 0.967742s;
	-webkit-animation-name: wlby_KF_5;
	-webkit-animation-iteration-count: infinite;
	-webkit-transform-origin: 0px 0px;
	-webkit-animation-timing-function: linear;
}
 
.wlby_5
{
	-webkit-animation-duration: 0.967742s;
	-webkit-animation-name: wlby_KF_9;
	-webkit-animation-iteration-count: infinite;
	-webkit-transform-origin: 0px 0px;
	-webkit-animation-timing-function: linear;
}
 
.wlby_1
{
	-webkit-animation-duration: 0.0322581s;
	-webkit-transform: matrix(1, 0, 0, 1, 275.45, 200.45);
	-webkit-transform-origin: 0px 0px;
}
 
.wlby_7
{
	position: absolute;
	-webkit-transform:matrix(1,0,0,1,-0.4,14.9);
}
 
.wlby_4
{
	position: absolute;
	-webkit-transform:matrix(1,0,0,1,48.65,-137.45);
}
 
div.mainDiv{
	position: relative;
	width: 1150px;
	height: 456px;
}
 
.myFontFlash {
	position: absolute;
	font-family: Verdana, Geneva, sans-serif;
	font-weight: bold;
	font-size: 16px;
	color:#066;
	margin-top:0px;
}
 
.myFontHTML5 {
	position: absolute;
	font-family: Verdana, Geneva, sans-serif;
	font-weight: bold;
	font-size: 16px;
	color:#066;
	margin-left:560px;
	margin-top:0px;
}
.myFlashContent {
	position: absolute;
	width:550px; 
	height:400px; 		 
	margin-top: 40px;	
}
.animCredits {
	position: absolute;
	font-family: Verdana, Geneva, sans-serif;
	margin-top:440px;
	font-size: 12px;
	color:#066;
}

Using Flash Player 10.2 in FDT4

In this post I will tell You how you can start playing with the new features of the Flash Player 10.2 Beta in FDT 4. I started using “Flash Builder Burrito” for the examples that I’ve been posting but I really missed the quick code hints and mostly the auto-import features of FDT4 that let me explore the new SDK without leaving my code to read the documentation, that said let’s move on.

Figure 1.

1.- The first thing You need to do is go to the Hero Stable Builds table and download the Flex SDK  build 18623 from there.

I usually have all my SDKs located in the same place in my disk “C:\SDKs” but You can put it on the desktop for easy location, once you have downloaded it decompress the zip in the location you chose. (Note: These builds do not contain any Hero mobile features or runtimes but it appears that the flex.swc that should be located in \frameworks\libs  is also missing you’ll need to include this from a previous build or FDT will output errors when adding the SDK to your project ).

Figure 2.

2.- Open FDT4 and go to >Window>Preferences and open the FDT tab and select Installed SDKs from that menu as shown in figure 3.

Figure 3.

Click on the Add  button and the SDK definition Panel will pop up select the directory where You have downloaded the Flex Hero SDK, if you have a previous Flex Hero SDK installed be sure to give a different name I called mine Flex Hero ( Flash Player 10.2  Beta).

Figure 4.

3.- Go to >File>New>New Flash Project select Empty AS3 project give your project a name and click the next button that will take You to the Flash Project Settings  in the SDK Configuration select your newly added SDK( see figure 5.) you will see that the Player Version changes to 10.2, click finish.

Figure 5.

4.- Right click in the project You just created select properties, go to the FDT Compiler menu and change the -target-player from “playerVersion” to “11”  this will let you test your projects without getting any version errors.

EDIT:   In this step You don’t need to change the “-target-player” argument leave it as is it will use the 10.2 version but you need to add the “-swf-version=11” argument, that way it won’t show errors when compiling.( Thanks to John Olson for pointing it out).

Figure 6.

5.- That’s it now You can test and compile the features including in the beta of  the Flash Player 10.2 and get  all the coding comfort of FDT4.

Figure 7.