<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- generator="wordpress/2.2.1" --><rss 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/" version="2.0">

<channel>
	<title>Phil Wallach</title>
	<link>http://philwallach.com</link>
	<description>I follow where my mind leads ...</description>
	<pubDate>Thu, 20 Dec 2007 05:23:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<image><link>http://www.philwallach.com/</link><url>http://www.philwallach.com/wp-content/minime.jpg</url><title>Phil Wallach</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/PhilWallach" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">493183</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>Virtual Worlds News » Former Outback Online Head Announces Imperial Galaxy for Facebook</title>
		<link>http://philwallach.com/2007/12/20/virtual-worlds-news-%c2%bb-former-outback-online-head-announces-imperial-galaxy-for-facebook/</link>
		<comments>http://philwallach.com/2007/12/20/virtual-worlds-news-%c2%bb-former-outback-online-head-announces-imperial-galaxy-for-facebook/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 05:23:57 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[Imperial Galaxy]]></category>

		<guid isPermaLink="false">http://philwallach.com/2007/12/20/virtual-worlds-news-%c2%bb-former-outback-online-head-announces-imperial-galaxy-for-facebook/</guid>
		<description><![CDATA[Former Outback Online Head Announces Imperial Galaxy for Facebook
]]></description>
			<content:encoded><![CDATA[<h3 class="entry-header"><a href="http://www.virtualworldsnews.com/2007/12/former-outback.html">Former Outback Online Head Announces Imperial Galaxy for Facebook</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/12/20/virtual-worlds-news-%c2%bb-former-outback-online-head-announces-imperial-galaxy-for-facebook/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Australians launch MMOG on Facebook : The Metaverse Journal - Australia’s Virtual World News Service</title>
		<link>http://philwallach.com/2007/12/18/australians-launch-mmog-on-facebook-the-metaverse-journal-australia%e2%80%99s-virtual-world-news-service/</link>
		<comments>http://philwallach.com/2007/12/18/australians-launch-mmog-on-facebook-the-metaverse-journal-australia%e2%80%99s-virtual-world-news-service/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 23:39:31 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[Imperial Galaxy]]></category>

		<guid isPermaLink="false">http://philwallach.com/2007/12/18/australians-launch-mmog-on-facebook-the-metaverse-journal-australia%e2%80%99s-virtual-world-news-service/</guid>
		<description><![CDATA[Australians launch MMOG on Facebook : The Metaverse Journal - Australia’s Virtual World News Service
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.metaversejournal.com/2007/12/18/australians-launch-mmog-on-facebook/">Australians launch MMOG on Facebook : The Metaverse Journal - Australia’s Virtual World News Service</a></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/12/18/australians-launch-mmog-on-facebook-the-metaverse-journal-australia%e2%80%99s-virtual-world-news-service/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Talking Squid » Imperial Galaxy, the first MMORG for Facebook</title>
		<link>http://philwallach.com/2007/12/18/imperial-galaxy-the-first-mmorg-for-facebook/</link>
		<comments>http://philwallach.com/2007/12/18/imperial-galaxy-the-first-mmorg-for-facebook/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 23:27:57 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[Imperial Galaxy]]></category>

		<guid isPermaLink="false">http://philwallach.com/2007/12/18/imperial-galaxy-the-first-mmorg-for-facebook/</guid>
		<description><![CDATA[On Talking Squid:
Imperial Galaxy, the first MMORG for Facebook
]]></description>
			<content:encoded><![CDATA[<p>On Talking Squid:</p>
<p><a href="http://www.talkingsquid.net/archives/294" class="post_title" rel="bookmark" title="Permanent Link to Imperial Galaxy, the first MMORG for Facebook">Imperial Galaxy, the first MMORG for Facebook</a></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/12/18/imperial-galaxy-the-first-mmorg-for-facebook/feed/</wfw:commentRss>
		</item>
		<item>
		<title>metarand » Creative Enclave announces Imperial Galaxy: the social networking MMOG</title>
		<link>http://philwallach.com/2007/12/18/metarand-%c2%bb-creative-enclave-announces-imperial-galaxy-the-social-networking-mmog/</link>
		<comments>http://philwallach.com/2007/12/18/metarand-%c2%bb-creative-enclave-announces-imperial-galaxy-the-social-networking-mmog/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 23:21:16 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[Imperial Galaxy]]></category>

		<guid isPermaLink="false">http://philwallach.com/2007/12/18/metarand-%c2%bb-creative-enclave-announces-imperial-galaxy-the-social-networking-mmog/</guid>
		<description><![CDATA[Rand blogs the launch of Imperial Galaxy.
metarand » Creative Enclave announces Imperial Galaxy: the social networking MMOG
]]></description>
			<content:encoded><![CDATA[<p>Rand blogs the launch of Imperial Galaxy.</p>
<p><a href="http://metarand.com/2007/12/17/creative-enclave-announces-imperial-galaxy-the-social-networking-mmog/">metarand » Creative Enclave announces Imperial Galaxy: the social networking MMOG</a></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/12/18/metarand-%c2%bb-creative-enclave-announces-imperial-galaxy-the-social-networking-mmog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IMPERIAL GALAXY</title>
		<link>http://philwallach.com/2007/12/10/imperial-galaxy/</link>
		<comments>http://philwallach.com/2007/12/10/imperial-galaxy/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 07:03:59 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[Imperial Galaxy]]></category>

		<guid isPermaLink="false">http://philwallach.com/2007/12/10/imperial-galaxy/</guid>
		<description><![CDATA[We&#8217;ll be launching the open beta test of IMPERIAL GALAXY, the science fiction massively multiplayer online game on Facebook, on Monday 17 December at 12:01am US Eastern time, which is 4:01pm AEDT. The www.imperialgalaxy.com website will also be live at that time.
I&#8217;ll be sending invitations to all my friends as soon as the Beta goes [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ll be launching the open beta test of IMPERIAL GALAXY, the science fiction massively multiplayer online game on Facebook, on Monday 17 December at 12:01am US Eastern time, which is 4:01pm AEDT. The www.imperialgalaxy.com website will also be live at that time.</p>
<p>I&#8217;ll be sending invitations to all my friends as soon as the Beta goes live, and it will be in the Applications directory and so on.</p>
<p>We&#8217;re very excited about IMPERIAL GALAXY. The background of the game is based on Garth Nix&#8217;s forthcoming novel A CONFUSION OF PRINCES (due out in 2009) and we&#8217;ve been playtesting it for the last three months. The game itself has been under development in its pre-Facebook incarnation for more than three years.</p>
<p>So a week from now, you can join the Imperial Navy and with your friends go forth to reclaim the lost Rozaxra Domain from Sad-Eye and Deader aliens, Mrouzh Rebels, Naknuk Secessionists, pirates, rebels and other star-scum. To your ships, my friends!</p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/12/10/imperial-galaxy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenLaszlo: how you get there is more important than where you are going</title>
		<link>http://philwallach.com/2007/08/29/openlaszlo-how-you-get-there-is-more-important-than-where-you-are-going/</link>
		<comments>http://philwallach.com/2007/08/29/openlaszlo-how-you-get-there-is-more-important-than-where-you-are-going/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 11:10:41 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[OpenLaszlo]]></category>

		<guid isPermaLink="false">http://philwallach.com/?p=87</guid>
		<description><![CDATA[WHAT BROKE
This is the old version of the method.  It finds some specific views and scans their datapaths, to see if any entries match.  This version mostly worked fine, but occassionally it would fail, and finding the cause of the failure was proving difficult.

    &#60;method name="check_ok" args="from, to"&#62;
        &#60;![CDATA[
        for (var i = 1; true; [...]]]></description>
			<content:encoded><![CDATA[<h3>WHAT BROKE</h3>
<p>This is the old version of the method.  It finds some specific views and scans their datapaths, to see if any entries match.  This version mostly worked fine, but occassionally it would fail, and finding the cause of the failure was proving difficult.<br />
<code><br />
    &lt;method name="check_ok" args="from, to"&gt;<br />
        &lt;![CDATA[<br />
        for (var i = 1; true; i++)<br />
        {<br />
            var match = to.classroot.datapath.xpathQuery(<br />
                'matches/match[' + i + ']/text()');<br />
            if (match == null) break;<br />
</code><code>            for (var j = 1; true; j++)<br />
            {<br />
                var type = from.datapath.xpathQuery(<br />
                    'types/type[' + j + ']/text()');<br />
                if (type == null) break;<br />
</code><code></code><code>                if (match == type)<br />
                    return true;<br />
            }<br />
        }<br />
        return false;<br />
        ]]&gt;<br />
    &lt;/method&gt;</code></p>
<h3>WHAT WORKED</h3>
<p>I finally tracked down the problem; it occured whenever &#8220;to&#8221; was not replicated (i.e. there was only one).  So I assume that the replication manager was confusing my view navigation, as the number and type of views to navigate changed.</p>
<p>The solution is shown in the code below.  Basically I navigate the dataset directly, and avoid any view navigation.  Nothing can go wrong, right?<br />
<code><br />
    &lt;method name="check_ok" args="from, to"&gt;<br />
        &lt;![CDATA[<br />
        var e  = to.datapath.dupePointer();<br />
        e.selectParent(2);<br />
        e.setXPath('matches');<br />
        if (e.selectChild())<br />
        {<br />
            do<br />
            {<br />
                if (e.getNodeName() == 'match')<br />
                {<br />
                    var c  = from.datapath.dupePointer();<br />
                    c.setXpath('types');<br />
                    if (c.selectChild())<br />
                    {<br />
                        do<br />
                        {<br />
                            if (c.getNodeName() == 'type')<br />
                            if (e.getNodeText() == c.getNodeText())<br />
                                return true;<br />
                        }<br />
                            while (c.selectNext());<br />
                    }<br />
                }<br />
            }<br />
                while (e.selectNext());<br />
        }<br />
        return false;<br />
        ]]&gt;<br />
    &lt;/method&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/08/29/openlaszlo-how-you-get-there-is-more-important-than-where-you-are-going/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenLaszlo: saving LzLoader</title>
		<link>http://philwallach.com/2007/08/22/openlaszlo-saving-lzloader/</link>
		<comments>http://philwallach.com/2007/08/22/openlaszlo-saving-lzloader/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 10:31:49 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[OpenLaszlo]]></category>

		<guid isPermaLink="false">http://philwallach.com/?p=86</guid>
		<description><![CDATA[One thing that tripped me up early on is a know bug in the OpenLaszlo loader.  Basically, if a view is destroyed before the resource completes loading, then the loader chokes and nothing more is heard from it. 
Unsurprisingly, this is very very bad.
The bug is documented here:
    bug: destroy before resource is loaded leads to [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that tripped me up early on is a know bug in the OpenLaszlo loader.  Basically, if a view is destroyed before the resource completes loading, then the loader chokes and nothing more is heard from it. </p>
<p>Unsurprisingly, this is very very bad.</p>
<p>The bug is documented here:<br />
    <a href="http://www.openlaszlo.org/jira/browse/LPP-1952">bug: destroy before resource is loaded leads to full load queue and hang</a></p>
<p>The fix is noted in the bug report.  Basically the following code is added to the application.</p>
<p><code>    &lt;script&gt;<br />
        LzMakeLoad.unload = function ()<br />
        {<br />
            this.loader.unload( this.loader.mc );<br />
        }<br />
        LzMakeLoad.destroy = function (recur)<br />
        {<br />
            this.loader.unload( this.loader.mc );<br />
            super.destroy( recur );<br />
        }<br />
    &lt;/script&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/08/22/openlaszlo-saving-lzloader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenLaszlo: who’s watching the loader?</title>
		<link>http://philwallach.com/2007/08/21/openlaszlo-whos-watching-the-loader/</link>
		<comments>http://philwallach.com/2007/08/21/openlaszlo-whos-watching-the-loader/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 01:02:02 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[OpenLaszlo]]></category>

		<guid isPermaLink="false">http://philwallach.com/?p=88</guid>
		<description><![CDATA[Being able to see when LzLoader is active is very useful when an application is under development.  The following code displays &#8220;Loading&#8221; whenever the loader is active.
The display is text.  The text has an &#8216;id&#8217; of &#8216;loading&#8217; and &#8216;visibility&#8217; set to false.
&#60;text id="loading" x="10" y="10" visible="false"
&#160;&#160;&#160;&#160;fontsize="12" fgcolor="white" fontstyle="bold"&#62;
&#160;&#160;Loading
&#60;/text&#62;
The display is controlled in an [...]]]></description>
			<content:encoded><![CDATA[<p>Being able to see when LzLoader is active is very useful when an application is under development.  The following code displays &#8220;Loading&#8221; whenever the loader is active.</p>
<p>The display is text.  The text has an &#8216;id&#8217; of &#8216;loading&#8217; and &#8216;visibility&#8217; set to false.</p>
<p><code>&lt;text id="loading" x="10" y="10" visible="false"<br />
&nbsp;&nbsp;&nbsp;&nbsp;fontsize="12" fgcolor="white" fontstyle="bold"&gt;<br />
&nbsp;&nbsp;Loading<br />
&lt;/text&gt;</code></p>
<p>The display is controlled in an idle handler.  The visible property of the display is set depending on the number of open connections in the loader.</p>
<p><code>&lt;handler name="onidle" reference="LzIdle"&gt;<br />
&nbsp;&nbsp;&lt;![CDATA[<br />
&nbsp;&nbsp;loading.setVisible(LzLoadQueue.openConx &gt; 0);<br />
&nbsp;&nbsp;]]&gt;<br />
&lt;/handler&gt;</code></p>
<p>The display shows you when the loader, and therefore the application, is busy.  You can see how well load-spreading strategies like <a href="http://philwallach.com/?p=82">OpenLaszlo: background loading of images</a> are working.  It is a window into a part of your application that is normally hidden.</p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/08/21/openlaszlo-whos-watching-the-loader/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenLaszlo: source code examples</title>
		<link>http://philwallach.com/2007/08/15/openlaszlo-source-code-examples/</link>
		<comments>http://philwallach.com/2007/08/15/openlaszlo-source-code-examples/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 12:39:54 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[OpenLaszlo]]></category>

		<guid isPermaLink="false">http://philwallach.com/?p=83</guid>
		<description><![CDATA[This is a short by-no-means-exhaustive list of freely available OpenLaszlo source code, for all those out there who like to steal learn from other people&#8217;s work.
OpenLaszlo &#8220;official&#8221; demos
Here you will find a range of interactive demos showing some of what OpenLaszlo makes possible.
www
OpenLaszlo Incubator Project
The Incubator directory contains components and other code that have been [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short by-no-means-exhaustive list of freely available OpenLaszlo source code, for all those out there who like to <strike>steal</strike> learn from other people&#8217;s work.</p>
<h3>OpenLaszlo &#8220;official&#8221; demos</h3>
<p>Here you will find a range of interactive demos showing some of what OpenLaszlo makes possible.<br />
<a href="http://www.openlaszlo.org/demos">www</a></p>
<h3>OpenLaszlo Incubator Project</h3>
<p>The Incubator directory contains components and other code that have been contributed to the OpenLaszlo project, but have not yet been fully integrated into the product.<br />
<a href="http://svn.openlaszlo.org/openlaszlo/trunk/lps/components/incubator/">src</a></p>
<h3>Applejuice</h3>
<p>Applejuice is a free web-based photo gallery. Its user interface is simple and uncluttered, to give your photos center stage.<br />
<a href="http://www.antisleep.com/applejuice/">www</a></p>
<h3>Our First iPhone App</h3>
<p><a href="http://weblog.openlaszlo.org/archives/2007/07/our-first-iphone-app/">www</a> - <a href="http://svn.openlaszlo.org/sandbox/ben/smush/">src</a></p>
<h3>OpenLaszlo YouTube Player Demo and Source Code</h3>
<p><a href="http://www.donhopkins.com/drupal/node/126">www</a></p>
<h3>Open Source SimFaux OpenLaszlo Code Now Available via Subversion</h3>
<p>SimFaux is an interactive TV station simulator written in OpenLaszlo, by Don Hopkins, for the HuffingtonPost Contagious Festival.<br />
<a href="http://www.donhopkins.com/drupal/node/123">www</a></p>
<h3>Source code for Zoom Maps project (Openlaszlo)</h3>
<p><a href="http://www.saumande.net/index.php/2007/03/13/source-code-for-zoom-maps-project-openlaszlo/">www</a> - <a href="http://www.saumande.net/echange/tiler.rar">src</a></p>
<h3>Laszlo: An Open Source Framework for Rich Internet Applications</h3>
<p><a href="http://today.java.net/pub/a/today/2005/03/22/laszlo.html">www</a></p>
<h3>blogbox</h3>
<p>Blogboxes provide exciting, instantly deployed functionality for your blog or Web site.<br />
<a href="http://www.blogbox.com/">www</a></p>
<h3>Glancer: Friend finder and Scheduler application</h3>
<p><a href="http://www.glancer.net/">www</a> - <a href="http://www.glancer.net/source/glancer_0.1b.tgz">src</a></p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/08/15/openlaszlo-source-code-examples/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OpenLaszlo: building context menus</title>
		<link>http://philwallach.com/2007/08/10/openlaszlo-building-context-menus/</link>
		<comments>http://philwallach.com/2007/08/10/openlaszlo-building-context-menus/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 11:43:14 +0000</pubDate>
		<dc:creator>phil</dc:creator>
		
		<category><![CDATA[OpenLaszlo]]></category>

		<guid isPermaLink="false">http://philwallach.com/?p=85</guid>
		<description><![CDATA[This is a brief overview of how I initialise context menus in my OpenLaszlo application.  There is nothing magic here, it is all in the documentation, but I hope this will save someone the time it took me to pull it all together.
CREATING THE CONTEXT MENU
This handler creates an empty context menu for the current [...]]]></description>
			<content:encoded><![CDATA[<p>This is a brief overview of how I initialise context menus in my <a href="http://www.openlaszlo.org/">OpenLaszlo</a> application.  There is nothing magic here, it is all in the documentation, but I hope this will save someone the time it took me to pull it all together.</p>
<h3>CREATING THE CONTEXT MENU</h3>
<p>This handler creates an empty context menu for the current object.  A delegate is declared.  The delegate will be called when the context menu is invoked, and is responsible for initialising the context menu.  I use a delegate because the context menu depends on the application state.<br />
<code><br />
    &lt;handler name="oninit"&gt;<br />
        var cm = new LzContextMenu();<br />
        cm.setDelegate(new LzDelegate(this, 'init_cm'));<br />
        this.setContextMenu(cm);<br />
    &lt;/handler&gt;<br />
</code></p>
<h3>INITIALISING THE CONTEXT MENU</h3>
<p>This is the method that will be invoked to initialise the context menu. </p>
<p>The wrinkle in my application is that there is a &#8216;global&#8217; context menu that is accessed by right-clicking anywhere, as well as a more object-specific context menu when a visual object is clicked.  The specific context menu includes the global menu items as well.  So this method first calls the method that initialises the global context menu (to make sure the global context menu is in the right state), then at the end of the method the menu items from the global context menu are copied into this context menu.</p>
<p>Otherwise this method is fairly straightforward.  hideBuiltInItems() removes Flash-installed default menu items (but not all of them BTW).  clearItems() removes all custom items from the context menu.</p>
<p><code>    &lt;method name="init_cm"&gt;<br />
        &lt;![CDATA[<br />
</code><code>        </code><code>cm_util.init_cm();  // init global menu<br />
</code><code><br />
</code><code>        var cm = this.getContextMenu();<br />
        cm.hideBuiltInItems();<br />
        cm.clearItems();</p>
<p></code><code></code><code>        var item;</p>
<p></code><code>        item = cm.makeMenuItem('label1',<br />
            new LzDelegate(xxx, 'yyy'));<br />
        item.value = parent;<br />
        cm.addItem(item);</code><code>        if (...)<br />
        {<br />
            if (...)<br />
            {<br />
                item = cm.makeMenuItem('label2',<br />
                    new LzDelegate(zzz, 'aaa'));<br />
            }<br />
            else<br />
            {<br />
                item = cm.makeMenuItem('label3', null);<br />
                item.setEnabled(false);<br />
            }<br />
            cm.addItem(item);<br />
        }</p>
<p>        if (...)<br />
        {<br />
            if (...)<br />
            {<br />
                item = cm.makeMenuItem('label4',<br />
                    new LzDelegate(bbb, 'ccc'));<br />
                item.value = this;<br />
                item.setSeparatorBefore(true);<br />
                cm.addItem(item);<br />
            }<br />
            else<br />
            {<br />
                if (...)<br />
                {<br />
                    item = cm.makeMenuItem('label5',<br />
                        new LzDelegate(ddd, 'eee'));<br />
                    item.value = this;<br />
                }<br />
                else<br />
                {<br />
                    item = cm.makeMenuItem('label6', null);<br />
                    item.setEnabled(false);<br />
                }<br />
                item.setSeparatorBefore(true);</p>
<p>                cm.addItem(item);<br />
            }<br />
        }</p>
<p>        // load global menu<br />
        var gcm = canvas.getContextMenu();<br />
        var gitems = gcm.getItems();<br />
        var glen = gitems.length;<br />
        for (var i = 0; i &lt; glen; i++)<br />
        {<br />
            if (i == 0)<br />
                gitems[i].setSeparatorBefore(true);<br />
            cm.addItem(gitems[i]);<br />
        }</p>
<p>        ]]&gt;<br />
    &lt;/method&gt;</p>
<p></code></p>
<h3>THE METHOD</h3>
<p>This is an example of the methods invoked by clicking an item in the context menu.  This example uses the &#8216;value&#8217; parameter which can be set when creating the menu item, as is done is some of the menu items above.</p>
<p><code>    &lt;method name="eee" args="item"&gt;<br />
        return fff(item.value);<br />
    &lt;/method&gt;</code></p>
<h3>BUGS</h3>
<p>From the documentation:</p>
<blockquote><p>There is an unresolved bug with nesting of context menus in views that were not direct children of the canvas which seems to happen in Flash 7, but is not present when you compile for Flash 8 target (lzr=swf8). That is, in the Flash 7 runtime, you cannot put a menu on a view unless its immediate parent is the canvas.</p></blockquote>
<h3>RESOURCES</h3>
<p><a href="http://www.openlaszlo.org/lps/docs/guide/input-devices.html#d0e16555">&#8220;View Source&#8221; right click menu item<br />
</a><a href="http://philwallach.com/?p=76">OpenLaszlo: a way to propagate context menus</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://philwallach.com/2007/08/10/openlaszlo-building-context-menus/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
