<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jappit.com &#187; fisheye menu</title>
	<atom:link href="http://www.jappit.com/blog/tag/fisheye-menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jappit.com/blog</link>
	<description>Mobile blog by Alessandro La Rosa</description>
	<lastBuildDate>Wed, 23 Nov 2011 10:38:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Building a dynamic fisheye menu in Flash Lite</title>
		<link>http://www.jappit.com/blog/2009/02/19/building-a-dynamic-fisheye-menu-in-flash-lite/</link>
		<comments>http://www.jappit.com/blog/2009/02/19/building-a-dynamic-fisheye-menu-in-flash-lite/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 12:43:13 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[flash lite]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[fisheye menu]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=304</guid>
		<description><![CDATA[Some time ago, we&#8217;ve seen how to build a fisheye menu with J2ME. Now, it&#8217;s time to see how to create the same component with Flash Lite. The FisheyeMenu source code Step 1. The menu MovieClip and external class Let&#8217;s create the FisheyeMenu ActionScript class, that will extend MovieClip, that will be used to implement [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, we&#8217;ve seen <a title="J2ME Fisheye menu" href="http://www.jappit.com/blog/2008/04/24/building-a-fisheye-menu-in-j2me-with-jsr-226/" target="_blank">how to build a <strong>fisheye menu</strong> with J2ME</a>. Now, it&#8217;s time to see how to create the same component with <a title="Flash Lite website" href="http://www.adobe.com/products/flashlite/" target="_blank">Flash Lite</a>.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=3268318&#038;server=vimeo.com&#038;show_title=1&#038;show_byline=1&#038;show_portrait=0&#038;color=&#038;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=3268318&#038;server=vimeo.com&#038;show_title=1&#038;show_byline=1&#038;show_portrait=0&#038;color=&#038;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>The FisheyeMenu source code</h3>
<h4>Step 1. The menu MovieClip and external class</h4>
<p>Let&#8217;s create the <strong>FisheyeMenu ActionScript class</strong>, that will extend <strong>MovieClip</strong>, that will be used to implement the actual <strong>menu logic</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> FisheyeMenu <span style="color: #000000; font-weight: bold;">extends</span> MovieClip
<span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then, create an <strong>empty movie clip</strong> in your library, <strong>export</strong> it, and <strong>associate it with the FisheyeMenu class</strong>.</p>
<p><img class="alignnone" title="Flash Lite fisheye menu empty movieclip" src="http://www.jappit.com/images/blog/uploads/fl_fisheye_create_mc.gif" alt="" width="429" height="354" /></p>
<h4>Step 2. Initializing the menu</h4>
<p>First, define these <strong>4 menu properties</strong>, that will hold some useful values:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// focus index of the selected menu item</span>
var focusedIndex<span style="color: #339933;">:</span><span style="color: #003399;">Number</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// total number of menu items</span>
var itemsNum<span style="color: #339933;">:</span><span style="color: #003399;">Number</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// width of single menu items (in pixels)</span>
var itemWidth<span style="color: #339933;">:</span><span style="color: #003399;">Number</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// the MovieClip that will contain the menu items</span>
var itemsContainer<span style="color: #339933;">:</span>MovieClip<span style="color: #339933;">;</span></pre></div></div>

<p>Let&#8217;s also define an <strong>utility function</strong> that returns the <strong>currently focused item index</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> function getFocusedIndex<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">focusedIndex</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And then, implement a function that will be used to <strong>initialize the menu</strong> with the items you want.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> function initializeMenu<span style="color: #009900;">&#40;</span>itemIds<span style="color: #339933;">:</span><span style="color: #003399;">Array</span>, itemWidth<span style="color: #339933;">:</span><span style="color: #003399;">Number</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">itemsNum</span> <span style="color: #339933;">=</span> itemIds.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">focusedIndex</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">itemWidth</span> <span style="color: #339933;">=</span> itemWidth<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">initItems</span><span style="color: #009900;">&#40;</span>itemIds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">private</span> function initItems<span style="color: #009900;">&#40;</span>itemIds<span style="color: #339933;">:</span><span style="color: #003399;">Array</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">itemsContainer</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">createEmptyMovieClip</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'itemsContainer'</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getNextHighestDepth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>var i<span style="color: #339933;">:</span><span style="color: #003399;">Number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> itemIds.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		var item<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> itemsContainer.<span style="color: #006633;">attachMovie</span><span style="color: #009900;">&#40;</span>itemIds<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>, <span style="color: #0000ff;">'item_'</span> <span style="color: #339933;">+</span> i, itemsContainer.<span style="color: #006633;">getNextHighestDepth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #009900;">&#123;</span>_x<span style="color: #339933;">:</span> itemWidth <span style="color: #339933;">*</span> i, _y<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			item._xscale <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span>
			item._yscale <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The <em>initializeMenu()</em> function is the function you will call to initialize your fisheye menu with the items you want. Its arguments are:</p>
<ul>
<li>an <em>Array</em> containing the <strong>id of MovieClip symbols</strong> to be used as items</li>
<li>the <strong>width of single menu items</strong></li>
</ul>
<p>Once called, <em>initializeMenu()</em> <strong>initializes the menu properties</strong> and then calls the <em>initItems()</em> function, that will actually <strong>attach the item instances</strong>, <strong>scaling down</strong> the unselected items and <strong>translating</strong> the menu itself to its starting position.</p>
<p>The <em>getMenuLeft()</em> function returns the x position to be used for the <em>itemsContainer</em> <em>MovieClip</em>, and depends on the focused item index:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> function getMenuLeft<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #003399;">Number</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #339933;">-</span> itemWidth <span style="color: #339933;">*</span> focusedIndex<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Step 3. Implement sliding funcionality</h4>
<p>When the <strong>user presses LEFT and RIGHT keys</strong>, you want the menu to perform these steps:</p>
<ul>
<li><strong>change the focused item</strong>, scaling down the previously focused one, and scaling up the new</li>
<li><strong>translate the menu</strong> to be centered on the new focused item</li>
</ul>
<p>In <strong>ActionScript</strong>, you can do it  this way:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> function shiftItem<span style="color: #009900;">&#40;</span>itemDelta<span style="color: #339933;">:</span><span style="color: #003399;">Number</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	var nextIndex<span style="color: #339933;">:</span><span style="color: #003399;">Number</span> <span style="color: #339933;">=</span> focusedIndex <span style="color: #339933;">+</span> itemDelta<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>nextIndex <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> nextIndex <span style="color: #339933;">&lt;</span> itemsNum<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		scaleItem<span style="color: #009900;">&#40;</span>focusedIndex, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		focusedIndex <span style="color: #339933;">=</span> nextIndex<span style="color: #339933;">;</span>
&nbsp;
		scaleItem<span style="color: #009900;">&#40;</span>focusedIndex, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		moveMenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">private</span> function moveMenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #003399;">Void</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #009900;">&#40;</span>itemsContainer, <span style="color: #0000ff;">&quot;_x&quot;</span>, None.<span style="color: #006633;">easeNone</span>, itemsContainer._x, getMenuLeft<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, .50, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">private</span> function scaleItem<span style="color: #009900;">&#40;</span>itemIndex<span style="color: #339933;">:</span><span style="color: #003399;">Number</span>, scaleDown<span style="color: #339933;">:</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #003399;">Void</span>
<span style="color: #009900;">&#123;</span>
	var item<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> itemsContainer<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'item_'</span> <span style="color: #339933;">+</span> itemIndex<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	var fromScale<span style="color: #339933;">:</span><span style="color: #003399;">Number</span> <span style="color: #339933;">=</span> scaleDown <span style="color: #339933;">?</span> <span style="color: #cc66cc;">100</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span>
	var toScale<span style="color: #339933;">:</span><span style="color: #003399;">Number</span> <span style="color: #339933;">=</span> scaleDown <span style="color: #339933;">?</span> <span style="color: #cc66cc;">50</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #009900;">&#40;</span>item, <span style="color: #0000ff;">&quot;_xscale&quot;</span>, None.<span style="color: #006633;">easeNone</span>, fromScale, toScale, .50, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #009900;">&#40;</span>item, <span style="color: #0000ff;">&quot;_yscale&quot;</span>, None.<span style="color: #006633;">easeNone</span>, fromScale, toScale, .50, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In this code snippet, there are <strong>3 functions</strong>:</p>
<ul>
<li><em>shiftItem()</em> is the function <strong>called to change the focused Item</strong> index by the passed delta argument. It checks if the change is ok, and then calls the following 2 functions:</li>
<li><em>moveMenu()</em> actually <strong>translates the items container</strong>, to have the new focused item horizontally centered</li>
<li><em>scaleItem()</em> <strong>scales up or down</strong>, depending on the scaleDown argument, the item corresponding at the index passed as argument</li>
</ul>
<p>Since here we use the <em>Tween </em>class, we have to add these <strong>2 import lines</strong> at the beginning of the <em>ActionScript</em> file:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">mx.transitions.Tween</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">mx.transitions.easing.*</span><span style="color: #339933;">;</span></pre></div></div>

<h3>How to use the fisheye-menu</h3>
<h4>Step 4. Create the menu items symbols</h4>
<p>Take back your FLA, and <strong>create 3 symbols</strong> that will be used as items within the fisheye menu. Also, remember to <strong>check the &#8220;Export for ActionScript&#8221; option</strong>, to have them actually usable from <em>ActionScript </em>itself.</p>
<p><img class="alignnone" title="Flash Lite fisheye menu items" src="http://www.jappit.com/images/blog/uploads/fl_fisheye_menu_items.gif" alt="" width="413" height="224" /></p>
<h4>Step 5. Attach and initialize the menu</h4>
<p>Now, <strong>attach a FisheyeMenu istance</strong> directly to the _root, and initialize it with the ID of the symbols created in the previous step:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">var menu<span style="color: #339933;">:</span>MovieClip <span style="color: #339933;">=</span> _root.<span style="color: #006633;">attachMovie</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FisheyeMenu'</span>, <span style="color: #0000ff;">'main_menu'</span>, _root.<span style="color: #006633;">getNextHighestDepth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
var items<span style="color: #339933;">:</span><span style="color: #003399;">Array</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Item0'</span>, <span style="color: #0000ff;">'Item1'</span>, <span style="color: #0000ff;">'Item2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
menu._x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">;</span>
menu._y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">;</span>
&nbsp;
menu.<span style="color: #006633;">initializeMenu</span><span style="color: #009900;">&#40;</span>items, <span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>Step 6. Create a KeyListener to interact with the menu</h4>
<p>The <em>KeyListener </em>will be really simple, since it will simply <strong>call the shiftItem() function when the user press LEFT or RIGHT keys</strong>, and will call a custom function when the user press the ENTER key, to trace the index of the current focused item:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">var keyListener<span style="color: #339933;">:</span><span style="color: #003399;">Object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
keyListener.<span style="color: #006633;">onKeyDown</span> <span style="color: #339933;">=</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	var key<span style="color: #339933;">:</span><span style="color: #003399;">Number</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Key</span>.<span style="color: #006633;">getCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #003399;">Key</span>.<span style="color: #006633;">RIGHT</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		menu.<span style="color: #006633;">shiftItem</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #003399;">Key</span>.<span style="color: #006633;">LEFT</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		menu.<span style="color: #006633;">shiftItem</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #003399;">Key</span>.<span style="color: #006633;">ENTER</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		menuFireAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003399;">Key</span>.<span style="color: #006633;">addListener</span><span style="color: #009900;">&#40;</span>keyListener<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
function menuFireAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;MENU ITEM PRESSED: &quot;</span> <span style="color: #339933;">+</span> menu.<span style="color: #006633;">getFocusedIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>Downloads and related resources</h3>
<p>You can download full source code (FLA + ActionScript file) of this example here:</p>
<ul>
<li><a title="Flash Lite Fisheye menu source code" href="http://www.jappit.com/uploads/flashlite/FisheyeMenu.zip">Flash Lite Fisheye menu source code</a></li>
</ul>
<p>If you like this article, feel free to vote it on <a href="http://wiki.forum.nokia.com/index.php/How_to_create_a_dynamic_fisheye_menu_in_Flash_Lite" title="Flash Lite fisheye menu article on Forum Nokia Wiki">Forum Nokia Wiki</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2009/02/19/building-a-dynamic-fisheye-menu-in-flash-lite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building a fisheye menu in J2ME with JSR 226</title>
		<link>http://www.jappit.com/blog/2008/04/24/building-a-fisheye-menu-in-j2me-with-jsr-226/</link>
		<comments>http://www.jappit.com/blog/2008/04/24/building-a-fisheye-menu-in-j2me-with-jsr-226/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 12:23:25 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[j2me]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[fisheye menu]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=21</guid>
		<description><![CDATA[I&#8217;ve always loved fisheye menus but, while there are quite a lot of ready-to-use components for web applications, when it comes to mobile it&#8217;s hard to find something. What better reason to build one? Since we&#8217;ll have dynamically resizable icons, a natural choice to build one with J2ME is JSR 226, that give us full [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always loved fisheye menus but, while there are quite <a title="Ajax Fisheye Menus" href="http://www.webappers.com/2007/10/29/nice-list-of-open-source-fish-eye-menu/" target="_blank">a lot of ready-to-use</a> components for web applications, when it comes to mobile it&#8217;s hard to find something. What better reason to build one? <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Since we&#8217;ll have dynamically resizable icons, a natural choice to build one with J2ME is <a title="JSR 226 specifications" href="http://jcp.org/en/jsr/detail?id=226" target="_blank">JSR 226</a>, that give us full support of SVG Tiny. This will limit portability of code, since this JSR is not supported on all J2me phones, but support is rapidly growing with latest generation phones.</p>
<p>As you&#8217;ll see, code is quite straightforward, and great part of it is dedicated to coordinates/size calculations, to create that &#8220;slide/resize&#8221; effect that is soooooo cool <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://www.jappit.com/images/blog/uploads/J2me_fisheye_menu.png" alt="J2ME fisheye menu" width="300" height="101" /></p>
<p>You can find menu source code on my Forum Nokia Wiki article: <a title="J2ME fisheye menu code" href="http://wiki.forum.nokia.com/index.php/J2ME_Fisheye_Menu_with_JSR_226">J2ME Fisheye Menu with JSR 226</a>, or download <a title="Fisheye Menu sample midlet" href="http://www.jappit.com/midlet/FisheyeMenuMidlet.jar">sample midlet here</a> (and source code <a title="J2me fisheye menu source code" href="http://www.jappit.com/uploads/src/j2me_fisheye_menu_src.zip">here</a>).</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/04/24/building-a-fisheye-menu-in-j2me-with-jsr-226/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

