<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://blogs.forum.nokia.com/styles/rss.css" type="text/css"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://my.netscape.com/rdf/simple/0.9/"
>

 <channel>
  <title>Giorgio Natili&#039;s Forum Nokia Blog</title>
  <link>http://blogs.forum.nokia.com/blog/giorgio-natilis-forum-nokia-blog</link>
  <description>A Forum Nokia Blog</description>
 </channel>
    <item>
   <title>[Flash Lite 1.1 vertical scrolling menu with dynamic content]</title>
   <description>&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;/C:%5CUsers%5Cutente%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;
&lt;link href=&quot;/C:%5CUsers%5Cutente%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_editdata.mso&quot; rel=&quot;Edit-Time-Data&quot; /&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;link href=&quot;/C:%5CUsers%5Cutente%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot; /&gt;
&lt;link href=&quot;/C:%5CUsers%5Cutente%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot; /&gt;
&lt;span&gt;Another
common task in Flash Lite applications is to handle a vertical scrolling menu
that show different external contents in each section.&lt;/span&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The main
tasks of this menu are the movement of the content and the handling of the
external content in the application avoiding the Flash Lite issue that can&amp;rsquo;t
handle multiple simultaneous HTTP requests.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;It&amp;rsquo;s a good
habit to store the data you need to load in an easy to reach place in your
application, for instance put the paths in the first frame of the main timeline&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;img_local_1
= &amp;quot;content/menu01.swf&amp;quot;;&lt;br /&gt;
img_local_2 = &amp;quot;content/menu02.swf&amp;quot;;&lt;br /&gt;
img_local_3 = &amp;quot;content/menu03.swf&amp;quot;;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;In order to
complete the first task you can work as in the previous post but thinking
vertical. First of all create a movie clip on the stage and arrange the timeline
as the following picture&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/v_01.JPG&quot; width=&quot;642&quot; height=&quot;59&quot; /&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The label
level contains all the stuff you need in order to create an animated scrolling
menu that trough ActionScript moves itself on the y axes of the player and a
group of actions that acts like a function that you need in order to move the
movie clip and set the next item to show and the content level contains three
movie clip that the application will use to show the content.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The content
level contains three instances of the movie clip mc_item that is stored in your
library with the following instance names: item_1, item_2, item_3.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/v_02.JPG&quot; width=&quot;224&quot; height=&quot;131&quot; /&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;Let&amp;rsquo;s start
to explore the code you need to handle the animation, later we&amp;rsquo;ll take a look
to the building blocks needed in order to load the external content.&lt;br /&gt;
In the &amp;ldquo;Init&amp;rdquo; frame you perform the initialization of the variables you need in
order to know the amount of items, the current item, the increment of movement
and the current position&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;item = 1;&lt;br /&gt;
item_total = 3;&lt;br /&gt;
move_value = .47;&lt;br /&gt;
move_increment = 220;&lt;br /&gt;
current_position = _y;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;Then you
set the variable needed from each item to load the external content calling the
&amp;ldquo;loadContent&amp;rdquo; &amp;ldquo;function&amp;rdquo; on the first movie clip&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;tellTarget(&amp;quot;item_1&amp;quot;){&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 35.25pt&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;current = 1;&lt;br /&gt;
call(&amp;quot;loadContent&amp;quot;);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;tellTarget(&amp;quot;item_2&amp;quot;){&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;current = 2;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;tellTarget(&amp;quot;item_3&amp;quot;){&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;current = 3;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;and the
action needed to move the timeline to the &amp;ldquo;Pause&amp;rdquo; frame&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;gotoAndStop(&amp;quot;Pause&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The &amp;ldquo;Pause&amp;rdquo;
frame is the one that set again the quality to high (in order to enhance
performance during the animation you&amp;rsquo;ll reduce this value) and that call the &amp;ldquo;loadContent&amp;rdquo;
&amp;ldquo;function&amp;rdquo; on the current shown movie clip&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;fscommand2(&amp;quot;SetQuality&amp;quot;,
&amp;quot;high&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;tellTarget(&amp;quot;item_&amp;quot;
add next_item){&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;call(&amp;quot;loadContent&amp;quot;);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;When the UP
or DOWN soft keys are pressed the application calls the gotoAndStop(&amp;ldquo;FRAME&amp;rdquo;)
method on the movie clip that contains all the content, the &amp;ldquo;up&amp;rdquo; and the &amp;ldquo;down&amp;rdquo;
frames work in a very similar way, let&amp;rsquo;s take a look to the second one.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The code in
this frame set the movement destination and the item to move, pave the path and
call the &amp;ldquo;handler&amp;rdquo; &amp;ldquo;function&amp;rdquo;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;destination
= current_position - move_increment;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;if (item ==
item_total) {&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;next_item = 1;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;} else {&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;next_item = item + 1;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;eval(&amp;quot;item_&amp;quot; add next_item)._y =
eval(&amp;quot;item_&amp;quot; add item)._y + move_increment;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;call
(&amp;quot;handler&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The code
stored in the &amp;ldquo;handler&amp;rdquo; frame acts like a function in Flash Lite 1.1 and each
time is called it set the _y property, register current state and position and
decrease the quality&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;_y =
current_position;&lt;br /&gt;
item = next_item;&lt;br /&gt;
current_position = destination;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&lt;/span&gt;fscommand2(&amp;quot;SetQuality&amp;quot;,
&amp;quot;medium&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;The frame
after the &amp;ldquo;down&amp;rdquo; one is the responsible of the movement&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;if (_y
&amp;lt;= destination + 2) {&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;_y = destination;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;gotoAndStop(&amp;quot;Pause&amp;quot;);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;} else {&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;_y += Math.round(move_value *
(destination - _y));&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The &amp;ldquo;up&amp;rdquo;
frame work in a similar way but the logic that olds is opposite to this one in
order to handle the inverse movement.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The mc_item
movie clip contains the code you need in order to handle the loading of the
external content and its timeline is arranged as in the following picture&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/v_03.JPG&quot; width=&quot;436&quot; height=&quot;277&quot; /&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The &amp;ldquo;loading
content&amp;hellip;&amp;rdquo; text is stored inside a movie clip in order to handle the time the
application needs to load the external content.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;In the first
frame of the &amp;ldquo;actions&amp;rdquo; level the initialization operations are performed &lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;contentLoaded
= 0;&lt;br /&gt;
stop();&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The code
stored in the &amp;ldquo;loadContent&amp;rdquo; frame perform the load operation only if the
variable contentLoaded is set to 0 (it means that if the content is already
loaded nothing will happen) and create a loop in which a check of the loading
status is performed&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;if(contentLoaded
== 0){&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;loadMovie(eval(&amp;quot;/:img_local_&amp;quot;
add current), &amp;quot;holder_mc&amp;quot;);&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;gotoAndPlay(&amp;quot;looper&amp;quot;);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;The code
stored in the &amp;ldquo;looper&amp;rdquo; frame check the current frame of the movie clip that
hold the external content changing the value of the contentLoaded variable and
hiding the &amp;ldquo;loading content&amp;hellip;&amp;rdquo; movie clip&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;if(holder_mc._framesloaded
&amp;gt; 0 ) {&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;contentLoaded = 1;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;setProperty(&amp;quot;loader_mc&amp;quot;,
_visible, false);&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;stop();&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;These are
the building block of a scrollable menu with Flash Lite 1.1 with dynamic
content, if you need more details please contact me, I&amp;rsquo;ll be happy to explain
in more details the content of this post.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;span&gt;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;</description>
   <link>http://blogs.forum.nokia.com/blog/giorgio-natilis-forum-nokia-blog/2008/09/07/flash-lite-1.1-vertical-scrolling-menu-with-dynamic-content</link>
      <pubDate>Sun, 07 Sep 2008 03:47:54 +0300</pubDate>   
  </item>
    <item>
   <title>[Flash Lite 1.1 scrolling menu]</title>
   <description>&lt;p&gt;
One of the most common stuff with Flash Lite is to create menus that can work also with the small screen of the mobile devices.&lt;br /&gt;
One solution is to scroll the content of the menu horizontally or vertically in order to show all the icons and / or all the text.&lt;br /&gt;
In this post we&amp;rsquo;ll try to explore the building blocks of an horizontal menu composed by a sequence of icons that react to the LEFT or to the RIGHT key pressure and that shows an enlarged version of the selected icon (fig 1).&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_mnu_01.PNG&quot; border=&quot;0&quot; width=&quot;333&quot; height=&quot;600&quot; /&gt;&amp;nbsp;&lt;br /&gt;
fig. 1&lt;br /&gt;
&lt;br /&gt;
Each menu icon is a movie clip with two key frames, in the first one is contained the normal status , in the second one is contained the enlarged status (fig. 2).&lt;br /&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_mnu_02.PNG&quot; border=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_mnu_02.PNG&quot; border=&quot;0&quot; width=&quot;313&quot; height=&quot;138&quot; /&gt;&lt;br /&gt;
fig. 2&lt;br /&gt;
&lt;br /&gt;
The main timeline is very simple, it contains a button used in order to handle the key pressure, an instance of the menu and the ActionScript you need to put the application in full screen.&lt;br /&gt;
The menu instance&amp;rsquo;s name is menuContainer_mc, in the script placed on the button we&amp;rsquo;ll refer to this name in order to control the menu
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;on(keyPress &amp;quot;&amp;lt;Left&amp;gt;&amp;quot;) {&amp;nbsp;&lt;br /&gt;
&amp;nbsp;tellTarget(&amp;quot;menuContainer_mc&amp;quot;){&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;gotoAndPlay(&amp;quot;left&amp;quot;);&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;}&amp;nbsp;&lt;br /&gt;
}&lt;br /&gt;
on(keyPress &amp;quot;&amp;lt;Right&amp;gt;&amp;quot;) {&amp;nbsp;&lt;br /&gt;
&amp;nbsp;tellTarget(&amp;quot;menuContainer_mc&amp;quot;){&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;gotoAndPlay(&amp;quot;right&amp;quot;);&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
The menu contains in its timeline four labels used in order to keep well organized and separated the code you need (fig. 3).
&lt;/p&gt;
&lt;p&gt;
&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_mnu_04.PNG&quot; border=&quot;0&quot; width=&quot;608&quot; height=&quot;87&quot; /&gt;&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_mnu_04.PNG&quot; border=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;&lt;br /&gt;
fig. 3
&lt;/p&gt;
&lt;p&gt;
The init frame initialize the menu, set to invisible the selected icon and enlarge the icon that represent the selected icon&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;item = 1;&lt;br /&gt;
item_total = 6;&lt;br /&gt;
item_skip = 3;&lt;br /&gt;
move_value = .4;&lt;br /&gt;
move_increment = 48;&lt;br /&gt;
current_position = _x;&lt;br /&gt;
// enlarge first icon&lt;br /&gt;
duplicateMovieClip(&amp;quot;item_&amp;quot; add item, &amp;quot;enlarged_&amp;quot; add item, 10);&lt;br /&gt;
setProperty(&amp;quot;item_&amp;quot; add item, _visible, false);&lt;br /&gt;
// Move the enlarged icon to the second frame&lt;br /&gt;
tellTarget (&amp;quot;enlarged_&amp;quot; add item) {&lt;br /&gt;
&amp;nbsp;gotoAndStop(2);&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Each time you call the &amp;ldquo;left&amp;rdquo; and &amp;ldquo;right&amp;rdquo; key frames after the calculation needed in order to select the right icon the menu will handle the visibility of the selected icon, the _x property of the item of the menu that has to be selected and calls the functions script &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;setProperty(&amp;quot;item_&amp;quot; add item, _visible, true);&lt;br /&gt;
// Control the _x&lt;br /&gt;
setProperty(&amp;quot;item_&amp;quot; add next_item, _x, getProperty(&amp;quot;item_&amp;quot; add item, _x) + move_increment * item_skip);&lt;br /&gt;
// perform various functions&lt;br /&gt;
call (&amp;quot;Functions&amp;quot;);&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
The frames contained after the &amp;ldquo;left&amp;rdquo; and the &amp;ldquo;right&amp;rdquo; labels perform a loop with which you handle the position of the icons container&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;if ( _x &amp;lt;= destination + 1) {&amp;nbsp;&lt;br /&gt;
&amp;nbsp;_x = destination;&lt;br /&gt;
&amp;nbsp;gotoAndStop(&amp;quot;Pause&amp;quot;);&amp;nbsp;&lt;br /&gt;
} else {&amp;nbsp;&lt;br /&gt;
&amp;nbsp; _x = _x + Math.round(move_value * (destination - _x));&lt;br /&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
When the destination is reached the Pause key frame is called, in this frame the selected icon is handled and the menu is ready to react again to the user input
&lt;/p&gt;
&lt;p&gt;
&lt;span style=&quot;font-family: courier new,courier&quot;&gt;// enlarge selected icon&lt;br /&gt;
duplicateMovieClip(&amp;quot;item_&amp;quot; add item, &amp;quot;enlarged_&amp;quot; add item, 10);&lt;br /&gt;
setProperty(&amp;quot;item_&amp;quot; add item, _visible, false);&lt;br /&gt;
tellTarget (&amp;quot;enlarged_&amp;quot; add item) {&amp;nbsp;&lt;br /&gt;
&amp;nbsp;gotoAndStop(2);&lt;br /&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
These are the building block of a scrollable menu with Flash Lite 1.1, if you need more details please contact me, I&amp;rsquo;ll be happy to explain in more details the content of this post.
&lt;/p&gt;</description>
   <link>http://blogs.forum.nokia.com/blog/giorgio-natilis-forum-nokia-blog/2008/04/21/flash-lite-1.1-scrolling-menu</link>
      <pubDate>Mon, 21 Apr 2008 12:55:32 +0300</pubDate>   
  </item>
    <item>
   <title>Flash Lite 1.1 collisions</title>
   <description>&lt;p&gt;Flash Lite 1.1 collisions&lt;br /&gt;A common task you may need when you start to develop a Flash Lite 1.1 arcade game is to check the collision between the sprites on the screen.&lt;br /&gt;If you surf the web you may find tons of way to detect the collision in Flash but in Flash Lite 1.1 you have refer to the old ActionScript 1.0 syntax.&lt;br /&gt;In this post we&amp;rsquo;ll try to explore the building blocks of detecting collision through a sample in which a character have to get some gift that are attached on the screen in a random way (fig. 1).&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/random.PNG&quot; border=&quot;0&quot; alt=&quot;fig. 1&quot; title=&quot;fig. 1&quot; width=&quot;182&quot; height=&quot;212&quot; /&gt;&amp;nbsp;&lt;br /&gt;fig. 1&lt;br /&gt;&lt;br /&gt;In order to complete this task we need to create a movie clip that contains the function that launches the gift (remember that Flash Lite 1.1 doesn&amp;rsquo;t support the functions so you store the script you need in a key frame associated to a label), a movie clip that call this function, a movie clip that store the script that moves the gift and that check the collisions and a movie clip used as a character.&lt;br /&gt;The first three movie clips are outside the stage (fig. 2).&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/movieclips.png&quot; border=&quot;0&quot; alt=&quot;fig. 2&quot; title=&quot;fig. 2&quot; width=&quot;403&quot; height=&quot;49&quot; /&gt;&amp;nbsp;&lt;br /&gt;fig. 2&lt;br /&gt;&lt;br /&gt;The aim of the &amp;ldquo;functions&amp;rdquo; and &amp;ldquo;loop&amp;rdquo; movie clips are self explanatory because the first one contains the code that duplicate the &amp;ldquo;gift&amp;rdquo; movie clip on the stage&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;// Duplicate the movieclip&lt;br /&gt;duplicateMovieClip(&amp;quot;../gift&amp;quot;, &amp;quot;gift_mc&amp;quot; add count, count);&lt;br /&gt;// Control the duplicated movie clip&lt;br /&gt;tellTarget(&amp;quot;../gift_mc&amp;quot; add count){&amp;nbsp;&lt;br /&gt;&amp;nbsp;// Set the position of the movieclip&lt;br /&gt;&amp;nbsp;_x = random(/:_width);&lt;br /&gt;&amp;nbsp;_y = 0;&amp;nbsp;&lt;br /&gt;&amp;nbsp;// Start to move&lt;br /&gt;&amp;nbsp;gotoAndPlay(&amp;quot;moving&amp;quot;);&lt;br /&gt;&amp;nbsp;// Set the max value for the y&lt;br /&gt;&amp;nbsp;set(&amp;quot;ymax&amp;quot;, /:screenHeight);&amp;nbsp;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;and the second one the call to this script at the end of its timeline.&lt;br /&gt;Let&amp;rsquo;s take a look inside the gift movie clip. &lt;br /&gt;Organize your timeline in order to have a a key frame with the label &amp;ldquo;moving&amp;rdquo; and a key frame with the label &amp;ldquo;removing&amp;rdquo; (fig. 4).&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/timeline.png&quot; border=&quot;0&quot; alt=&quot;fig. 4&quot; title=&quot;fig. 4&quot; width=&quot;425&quot; height=&quot;73&quot; /&gt;&amp;nbsp;&lt;br /&gt;fig. 4&lt;br /&gt;&lt;br /&gt;The &amp;ldquo;moving&amp;rdquo; key frame modifies the value of the _y property and launches a loop inside which you check if the movie clip has reached an _y that is outside the screen or if it is colliding with the character on the stage&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;// Check if the movie clip is get from the sprite&lt;br /&gt;if(_y + _height &amp;gt; eval(&amp;quot;../sprite_mc&amp;quot;)._y ){&lt;br /&gt;&amp;nbsp;if(_x &amp;gt; eval(&amp;quot;../sprite_mc&amp;quot;)._x &amp;amp;&amp;amp; _x &amp;lt; eval(&amp;quot;../sprite_mc&amp;quot;)._x + eval(&amp;quot;../sprite_mc&amp;quot;)._width){&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;tellTarget(&amp;quot;../sprite_mc&amp;quot;){&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;gotoAndPlay(&amp;quot;getIt&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;removeMovieClip(&amp;quot;&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;// Check if the gift is outside the screen&lt;br /&gt;if (_y + _height &amp;gt;= ymax) {&amp;nbsp;&lt;br /&gt;&amp;nbsp; isLooping = false;&amp;nbsp;&lt;br /&gt;}else{&amp;nbsp;&lt;br /&gt;&amp;nbsp;isLooping = true;&amp;nbsp;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;the &amp;ldquo;removing&amp;rdquo; key frame changes the graphic of the movie clip and at the end of its timeline removes the movie clip from the stage&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;removeMovieClip(&amp;quot;&amp;quot;);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I&amp;rsquo;m pretty sure that everybody knows how to move the main character on the stage so I&amp;rsquo;ll not explain this stuff in detail, by the way for reference and in order to be clear this is the &lt;a href=&quot;http://mobile.actionscript.it/forum_nokia_entries/collision.zip&quot; target=&quot;_blank&quot;&gt;file&lt;/a&gt; described in this post.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
   <link>http://blogs.forum.nokia.com/blog/giorgio-natilis-forum-nokia-blog/2008/02/02/flash-lite-1.1-collisions</link>
      <pubDate>Sat, 02 Feb 2008 17:56:16 +0200</pubDate>   
  </item>
    <item>
   <title>Flash Lite 1.1 scrolling background</title>
   <description>&lt;p&gt;When you start to develop a Flash Lite 1.1 arcade game is often required to have a background that &amp;ldquo;loops&amp;rdquo; under your sprite according to the direction sprite.&lt;br /&gt;This is not a very complicated stuff and now we&amp;rsquo;ll look very quickly how to implement this with the old Flash Lite 1.1 ActionScript.&lt;br /&gt;&lt;br /&gt;Import in the library of your .fla a PNG file with the same height of the screen of your target device and with the width equal to the double of the screen width.&lt;br /&gt;Create a movie clip that contain this file and then create a new symbol in which you have to place an instance of the background and to define the script that handle the scroll.&lt;br /&gt;Organize your timeline in order to have a &amp;ldquo;move&amp;rdquo; and an &amp;ldquo;init&amp;rdquo; label, a layer for the code and another one for the graphic&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://mobile.actionscript.it/forum_nokia_entries/flbg01.GIF&quot; border=&quot;0&quot; alt=&quot;fig. 1&quot; title=&quot;fig. 1&quot; width=&quot;396&quot; height=&quot;74&quot; /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In the &amp;ldquo;init&amp;rdquo; frame you define the direction of the scroll, duplicate the bg_mc movie clip and complete the stuffs needed in order to handle your scrolling background.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;direction = 1;&lt;br /&gt;duplicateMovieClip(&amp;quot;bg_mc&amp;quot;, &amp;quot;bg_mc_new&amp;quot;, 1000);&lt;br /&gt;bg_mc_new._x = bg_mc._x + bg_mc._width;&lt;br /&gt;bgStartX = _x;&lt;br /&gt;speed = 4;&lt;br /&gt;columnWidth = 320;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Now you are ready to implement the script contained in the move label (remember that the script associated with a frame label in Flash Lite 1.1 are used like functions and can be invoked with the call instruction) that handle the _x of this movie clip&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;_x -= (speed*direction);&lt;br /&gt;&lt;br /&gt;if (_x &amp;lt;= (bgStartX - _width + columnWidth)){&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;_x = bgStartX - columnWidth - speed;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(_x &amp;gt;= 0){&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;_x = - _width/2 + speed;&amp;nbsp;&amp;nbsp;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This script always increment the _x property and then check if the background is going outside the boundaries of the stage.&lt;br /&gt;In order to make the background moving you handle the left and the right arrow pressure moving the background timeline to the frame 2 in order to create a loop&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier new,courier&quot;&gt;tellTarget(&amp;quot;../mainBg_mc&amp;quot;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;set(&amp;quot;direction&amp;quot;, -1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;gotoAndPlay(2);&amp;nbsp;&lt;br /&gt;&amp;nbsp;}&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For reference and in order to be clear this is the &lt;a href=&quot;http://mobile.actionscript.it/forum_nokia_entries/scrolling_background.zip&quot; target=&quot;_blank&quot;&gt;file &lt;/a&gt;described in this post.&lt;/p&gt;</description>
   <link>http://blogs.forum.nokia.com/blog/giorgio-natilis-forum-nokia-blog/2007/12/23/flash-lite-1.1-scrolling-background</link>
      <pubDate>Sun, 23 Dec 2007 16:37:57 +0200</pubDate>   
  </item>
  </rdf:RDF>

