<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><title type="text">WeirdLooking.com: Michael Barton's Blog</title><rights>Copyright 2006</rights><author><name>Michael Barton</name><email>palrich@gmail.com</email></author><updated>2010-09-10T20:57:46Z</updated><generator>WeirdLooking.com</generator><logo>http://www.weirdlooking.com/images/feed.png</logo><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/" /><link rel="self" type="application/xml+atom" href="http://www.weirdlooking.com/atom/tag/javascript" /><id>http://www.weirdlooking.com/</id><entry><title type="text">i hate actionscript</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/i-hate-actionscript" /><id>http://www.weirdlooking.com/blog/i-hate-actionscript</id><published>2006-07-03T11:24:35Z</published><updated>2006-07-03T11:24:35Z</updated><content type="html">I needed to make a Flash movie containing pictures that could be dragged out onto the surrounding HTML elements.&amp;nbsp; And it almost worked, too.&lt;br /&gt;&lt;br /&gt;You can pass information from Flash to HTML by sending the browser to a javascript: URL, so the idea was to trap the mouse-down event in Flash, then pass a message to the javascript telling it that it&amp;rsquo;s currently in a dragging state.&amp;nbsp; Replicate the dragging graphic in both Flash and HTML, and you can almost imagine this method working.&lt;br /&gt;&lt;br /&gt;Except&amp;#8230; if you try to drag something outside of Flash, it refuses to give the mouse events back.&amp;nbsp; Flash continues receiving events though, so you could theoretically pass those back to the browser yourself.&amp;nbsp; But calling getURL(&amp;rsquo;javascript:&amp;#8230;&amp;rsquo;) to share the current mouse position causes IE to &amp;ldquo;click!&amp;rdquo; for every pixel the mouse moves.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;m not really a Flash guy, so this may be possible via some other chicanery.&amp;nbsp; But based on currently available data, I&amp;rsquo;m going to call it a defeat.&lt;br /&gt;&lt;br /&gt;Mike: 0, Flash: 1</content><category term="computers and internet" /><category term="actionscript" /><category term="javascript" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/61" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/61</wfw:commentRss><slash:comments>4</slash:comments></entry><entry><title type="text">javascript mud client 2</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/javascript-mud-client-2" /><id>http://www.weirdlooking.com/blog/javascript-mud-client-2</id><published>2006-03-28T17:04:14Z</published><updated>2006-03-28T17:04:14Z</updated><content type="html">&lt;div style=&quot;float: right; margin: 2px; padding: 2px; border: solid 1px #555555;&quot;&gt;&lt;a href=&quot;//www.weirdlooking.com/blog/54/mudhtml.png&quot;&gt;&lt;img src=&quot;//www.weirdlooking.com/blog/54/mudhtml.png/200:*&quot; alt=&quot;Click to enlargen&quot; /&gt;&lt;/a&gt;&lt;/div&gt;I woke up early this morning and decided to start from scratch on my javascript mud client.&amp;nbsp; After writing the single worst implementation of a web server ever (it would have gone nicely with my networking final project, which included the single worst implementation of a web client ever), I was able to get it working.&lt;br /&gt;&lt;br /&gt;Basically, I rewrote the MUD to accept HTTP requests and wrap a javascript call around the output from each pulse.&amp;nbsp; Taking &lt;a href=&quot;http://www.muujware.com/matthew/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.muujware.com%2Fmatthew%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;Matt&lt;/a&gt;&amp;#39;s advice, I decided to use &amp;lt;b&amp;gt; tags with short class names, rather than the &amp;lt;span style=&amp;rdquo;color:&amp;#8230;&amp;rdquo;&amp;gt; stuff I was doing before.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Example (mud prompt)&lt;/span&gt;: &lt;code&gt;&amp;lt;script&amp;gt;parent.push('&amp;lt;br&amp;gt;&amp;lt;b class=g&amp;gt;&amp;amp;lt;20hp 100m 100mv&amp;amp;gt; &amp;lt;b class=X&amp;gt;');&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The browser downloads this &amp;ldquo;page&amp;rdquo; inside a hidden &amp;lt;iframe&amp;gt; (using the hack I &lt;a href=&quot;http://www.weirdlooking.com/blog/53&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.weirdlooking.com%2Fblog%2F53) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;previously posted&lt;/a&gt; for Internet Explorer, just a plain iframe for FF).&amp;nbsp; The push() function in the frame&amp;rsquo;s parent creates a new &amp;lt;pre&amp;gt; tag, stuffs the argument text inside it, then appends it to the display &amp;lt;div&amp;gt;.&amp;nbsp; Then the div&amp;rsquo;s scroll is set to the bottom.&lt;br /&gt;&lt;br /&gt;Mud input uses a form submit handler, which takes the value of the &amp;lt;input&amp;gt; and sticks it into an XMLHttpRequest, which is sent to the aforementioned worst web server implementation ever.&lt;br /&gt;&lt;br /&gt;I hacked it into &lt;a href=&quot;http://www.flugh.com/quickmud/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.flugh.com%2Fquickmud%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;QuickMUD&lt;/a&gt; rather than my own code base so that, should I ever decide to clean it up, other people can use it.&lt;br /&gt;&lt;br /&gt;Okay, so it&amp;rsquo;s pretty trivial.&amp;nbsp; But it was fun.</content><category term="computers and internet" /><category term="javascript" /><category term="mud" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/54" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/54</wfw:commentRss><slash:comments>7</slash:comments></entry><entry><title type="text">web-based mud client?</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/web-based-mud-client" /><id>http://www.weirdlooking.com/blog/web-based-mud-client</id><published>2006-03-26T06:11:26Z</published><updated>2006-03-26T06:11:26Z</updated><content type="html">This blog post about Google&amp;rsquo;s web-based instant messaging is making the rounds:&lt;br /&gt;&lt;a href=&quot;http://alex.dojotoolkit.org/?p=538&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Falex.dojotoolkit.org%2F%3Fp%3D538) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;http://alex.dojotoolkit.org/?p=538&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So here&amp;rsquo;s my thinking&amp;#8230; If I can open up a second port on my &lt;a href=&quot;http://www.divineblood.org/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.divineblood.org%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;mud&lt;/a&gt; and run a simple HTTP server on it (lots of people have done this already), I can pretty easily hack write_to_descriptor to send information to a persistent HTTP connection.&amp;nbsp; In fact, it&amp;rsquo;ll practically be a regular mud connection except color codes and newlines and stuff will be parsed into their equivalent HTML (fairly straight-forward modification of the color code).&amp;nbsp; And interpret will be called from an HTTP post.&amp;nbsp; Then some work in javascript and I can have a web-based mud client.&lt;br /&gt;&lt;br /&gt;I&amp;rsquo;ll have the first &lt;a href=&quot;http://www.fuckweb2.com/&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.fuckweb2.com%2F) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;Web 2.0&lt;/a&gt; mud.</content><category term="computers and internet" /><category term="website" /><category term="javascript" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/53" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/53</wfw:commentRss><slash:comments>5</slash:comments></entry><entry><title type="text">assignment 7</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/assignment-7" /><id>http://www.weirdlooking.com/blog/assignment-7</id><published>2005-12-02T19:03:15Z</published><updated>2005-12-02T19:03:15Z</updated><content type="html">I&amp;rsquo;m unable to describe &lt;a href=&quot;http://sci.tamucc.edu/~hguo/teaching/fall2005/cosc3353/Assignment7.doc&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fsci.tamucc.edu%2F%7Ehguo%2Fteaching%2Ffall2005%2Fcosc3353%2FAssignment7.doc) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;assignment 7&lt;/a&gt;, except to say I&amp;rsquo;m glad it&amp;rsquo;s 1998 again.&amp;nbsp; True to the nature of the required scripts, I have made &lt;a href=&quot;http://www.geocities.com/red_bo&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.geocities.com%2Fred_bo) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;a Web page about my dog&lt;/a&gt; and also hosted it on geocities.&lt;br /&gt;&lt;br /&gt;Most of my effort was put into re-implementing the &amp;ldquo;dragging clock&amp;rdquo; so that it works in both Firefox and IE.&amp;nbsp; I haven&amp;rsquo;t gotten the dragging effect quite right, but I expect I will.&amp;nbsp; I wasn&amp;rsquo;t sure what he meant by &amp;ldquo;a banner with scrolling text&amp;rdquo;, but I didn&amp;rsquo;t want to just write a poor man&amp;rsquo;s version of the &lt;code&gt;marquee&lt;/code&gt; tag.&amp;nbsp; So I made some text that moves along a sine wave &amp;#8212; something I&amp;rsquo;m &lt;span style=&quot;font-style: italic;&quot;&gt;fairly&lt;/span&gt; sure marquees can&amp;rsquo;t do.&lt;br /&gt;&lt;br /&gt;On the plus side, the semester is over in a week.</content><category term="computers" /><category term="javascript" /><category term="school" /><category term="dogs" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/41" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/41</wfw:commentRss><slash:comments>5</slash:comments></entry></feed>