<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4816566492235185757</id><updated>2011-07-08T01:45:13.918-07:00</updated><category term='Actionscript 3'/><category term='Flash'/><category term='flash bug'/><category term='JVM'/><category term='fullscreen'/><category term='Java'/><category term='OSX'/><category term='bug'/><title type='text'>This is Not the Blog You're Looking For</title><subtitle type='html'>Nerdy ramblings, with a hint of cinnamon and parsley garnish, sauteed in a rich beurre-blanc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jwoffenden.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jwoffenden.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jon</name><uri>http://www.blogger.com/profile/14681631065598127139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4816566492235185757.post-4093934986642710475</id><published>2009-08-12T13:08:00.000-07:00</published><updated>2009-08-12T13:27:52.116-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OSX'/><category scheme='http://www.blogger.com/atom/ns#' term='fullscreen'/><category scheme='http://www.blogger.com/atom/ns#' term='flash bug'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Fullscreen Flash on OSX</title><content type='html'>If you're having trouble getting true fullscreen flash in OSX, I have a solution for you.&lt;br /&gt;&lt;br /&gt;The following code:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;stage.displayState='fullScreen';&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;*should* set your flash clip to flawless fullscreen mode, and does in most OSes.  Using OSX Leopard and Flash CS3, however, your flash clip still has the title bar (with the close, minimize, and + buttons).  Not exactly behavior as documented.&lt;br /&gt;&lt;br /&gt;At first I found the suggestion here to put the above code into frame 2 - that seemed to work for some people.  That didn't work for me, but if I put a 530 millisecond or greater delay in frame 1 before moving on to frame 2 it would work (529 or less would not):&lt;div style="text-align: left;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;stop();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;function goNext(te:TimerEvent):void&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    t.stop();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    t.removeEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    gotoAndStop(2);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var t:Timer = new Timer(530, 1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;t.addEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;t.start();&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;I then tried putting fullscreen code directly in goNext just to see what would happen:&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;stop();&lt;br /&gt;function goNext(te:TimerEvent):void&lt;br /&gt;{&lt;br /&gt;  t.stop();&lt;br /&gt;  t.removeEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;stage.displayState='fullScreen';&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;var t:Timer = new Timer(530, 1);&lt;br /&gt;t.addEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;br /&gt;t.start();&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;That didn't work, which meant either Flash really liked having that code in frame 2, or it just took that little bit longer to transition to frame 2 than it did to just run stage.displayState='fullScreen' inline.  So I switched the delay to a full second:&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:courier new;"&gt;stop();&lt;br /&gt;function goNext(te:TimerEvent):void&lt;br /&gt;{&lt;br /&gt;  t.stop();&lt;br /&gt;  t.removeEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;br /&gt;  stage.displayState='fullScreen';&lt;br /&gt;}&lt;br /&gt;var t:Timer = new Timer(&lt;span style="font-weight: bold;"&gt;1000&lt;/span&gt;, 1);&lt;br /&gt;t.addEventListener(flash.events.TimerEvent.TIMER, goNext);&lt;br /&gt;t.start();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;... and it once again worked.&lt;br /&gt;&lt;br /&gt;So it looks like the problem is we're waiting for either OSX or Flash to do something in the background before it's ready to go fullscreen.  Until this bug is fixed you're going to have to take a good guess at about how long to delay before going fullscreen if you don't want to end up with a titlebar.&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4816566492235185757-4093934986642710475?l=jwoffenden.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwoffenden.blogspot.com/feeds/4093934986642710475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4816566492235185757&amp;postID=4093934986642710475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/4093934986642710475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/4093934986642710475'/><link rel='alternate' type='text/html' href='http://jwoffenden.blogspot.com/2009/08/fullscreen-flash-on-osx.html' title='Fullscreen Flash on OSX'/><author><name>Jon</name><uri>http://www.blogger.com/profile/14681631065598127139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4816566492235185757.post-1483841914565133789</id><published>2009-03-10T12:26:00.000-07:00</published><updated>2009-03-10T12:34:27.919-07:00</updated><title type='text'>Yet another great trick with apt-get</title><content type='html'>I recently bought a new virtual private server to host some web sites on.  I use debian derivatives for all my hosting, but the server derivatives usually come pretty stripped down by default.  So while I was setting my shiny new server up I got to thinking "there has to be some way to clone my installed packages off my older server".&lt;br /&gt;&lt;br /&gt;Turns out, as usual, apt delivers!&lt;br /&gt;&lt;br /&gt;1.  Back up /etc/apt/sources.list on your new server: jwoffenden@newserver# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak&lt;br /&gt;2.  Copy it over from your old one: jwoffenden@oldserver# scp /etc/apt/sources.list root@newserver:/etc/apt/sources.list&lt;br /&gt;3.  Update apt: jwoffenden@newserver# sudo apt-get update&lt;br /&gt;&lt;br /&gt;And then here's the magic:&lt;br /&gt;&lt;br /&gt;1. Store your currently installed packages list in a file: jwoffenden@oldserver# dpkg --get-selections &gt; ~/selectionfile&lt;br /&gt;2. Copy it to the new server: jwoffenden@oldserver# scp ~/selectionfile root@newserver:/root/selectionfile&lt;br /&gt;3. Tell apt to sickem!!:  root@newserver dpkg --set-selections &lt; /root/selectionfile &amp;amp;&amp;amp; apt-get dselect-upgrade&lt;br /&gt;&lt;br /&gt;4.  Go get a snack.  When you get back all your shiny packages will be installed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4816566492235185757-1483841914565133789?l=jwoffenden.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwoffenden.blogspot.com/feeds/1483841914565133789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4816566492235185757&amp;postID=1483841914565133789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/1483841914565133789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/1483841914565133789'/><link rel='alternate' type='text/html' href='http://jwoffenden.blogspot.com/2009/03/yet-another-great-trick-with-apt-get.html' title='Yet another great trick with apt-get'/><author><name>Jon</name><uri>http://www.blogger.com/profile/14681631065598127139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4816566492235185757.post-4246741194059267191</id><published>2008-08-06T16:17:00.000-07:00</published><updated>2008-08-06T18:36:30.032-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='JVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript 3'/><title type='text'>Actionscript 3 and the JVM</title><content type='html'>I've recently been ridiculed multiple times by uninformed Java developers for claiming that Actionscript3 runs on the Java Virtual Machine.  In particular, the people in ##java got quite miffed at me for suggesting there was a relationship.&lt;br /&gt;&lt;br /&gt;I'll admit I was fuzzy on the details of the relationship between Flash CS3 and Java, and searching didn't reveal anything that conclusive.  Was it a built in, stripped down, modified version? Was it licensed from Sun or grown in-house at Adobe?  I can't find it offhand, but a benchmark comparing Ationscript 1 through 3, Javascript, and Java revealed suspiciously similar numbers between AS3 and Java. Also Flex uses the ANT build system, which is a Sun/Java related animal.&lt;br /&gt;&lt;br /&gt;So there was a blurry but definite relationship between the two in my mind.  I stumbled on a lot more conclusive evidence while &lt;a href="http://jwoffenden.blogspot.com/2008/08/how-to-overcome-compiler-limitations-in.html"&gt;solving an elusive failure in Flash CS3's optimizer&lt;/a&gt;, though.&lt;br /&gt;&lt;br /&gt;At least for Actionscript 3 projects, Flash CS3 compiles your code down to Java bytecode. It uses the Java compiler, the Java optimizer, and runs on an unmodified Sun Java Virtual Machine.  The only part of the process that is any different from actual Java itself is the parser, and that's not all that different - as of AS3, Actionscript sure resembles Java a lot.&lt;br /&gt;&lt;br /&gt;Single inheiritance, multiple interface, object oriented, strongly typed (well, you can get away with more loose typing but it's discouraged), packages, etc. It's not drastically different.&lt;br /&gt;&lt;br /&gt;So this has me wondering - how many Java debugging tools, decompilers, etc could be used with Flash .swf's with very little jerry rigging...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4816566492235185757-4246741194059267191?l=jwoffenden.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwoffenden.blogspot.com/feeds/4246741194059267191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4816566492235185757&amp;postID=4246741194059267191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/4246741194059267191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/4246741194059267191'/><link rel='alternate' type='text/html' href='http://jwoffenden.blogspot.com/2008/08/actionscript-3-and-jvm.html' title='Actionscript 3 and the JVM'/><author><name>Jon</name><uri>http://www.blogger.com/profile/14681631065598127139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4816566492235185757.post-6548104207193701547</id><published>2008-08-05T18:47:00.000-07:00</published><updated>2008-11-22T14:21:29.103-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='JVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript 3'/><title type='text'>Giving Flash CS3's compiler a little breathing room</title><content type='html'>If you've ever worked on a decent sized (100,000+ line) project in Flash CS3, you may have run into situations where you can't compile with optimizations turned on: it either gives you bizarre errors or gives you a blank .swf.  Sometimes you can't compile at all with or without optimization, or have to disable traces, and even then you may not succeed to build.  It gives you cryptic feedback like "error generating bytecode" or sometimes no error at all. Frustrating.&lt;br /&gt;&lt;br /&gt;I've done contract work on a few such projects, and it's a serious pain in the butt - nobody seems to have any answers save for "make your program smaller". Great.&lt;br /&gt;&lt;br /&gt;There were plenty of rumors on how to fix it most of which involved doing magical dances with your fingers crossed (like rebooting and just hoping it works). None of them worked well or often, and finally today I set out to get to the bottom of it.&lt;br /&gt;&lt;br /&gt;Since Actionscript 3 compiles down to Java bytecode and the default max heap size for the Java runtime environment is 128MB, I figured it was likely that the JVM was running out of memory and dying during the optimization phase.  Armed with a similar hunch from a colleague (the Fu), I figured maybe giving Java a little more breathing room would fix the problem.&lt;br /&gt;&lt;br /&gt;You can change the max heap size for the JVM with the command line option -Xmx, how do we get Flash to pass arguments to the JVM?&lt;br /&gt;&lt;br /&gt;In the end,  you can't.  There's no way to get Flash to pass custom command line options to the java compiler.&lt;br /&gt;&lt;br /&gt;It was just this kind of thing that the &lt;a href="http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gbmsy.html"&gt;JAVA_TOOL_OPTIONS&lt;/a&gt; environment variable is there for. It watches over us, lovingly passing our guidance to the JVM when we can't do it directly.&lt;br /&gt;&lt;br /&gt;When a JVM is being instantiated it checks the environment variable JAVA_TOOL_OPTIONS and treats it exactly as if it was passed at the command line. So now we can pass our beloved -Xmx1024M to the compiler and increase our max heap size from 128MB to a gig, and bam - we can compile with optimizations now.&lt;br /&gt;&lt;br /&gt;To set the JAVA_TOOL_OPTIONS environment variable (in Windows), right click my computer-&gt;properties, open the "advanced" tab and click "environment variables".  Hit "new" for either system or user - it doesn't really matter which you use unless you have multiple people using the computer.  Enter JAVA_TOOL_OPTIONS for the variable name and -Xmx512M, -Xmx256M, -Xmx1024M, whatever.  Oh, and don't forget the M :-)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.digitaledgesw.com/node/31"&gt;This is how to set environment variables in OSX.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy compiling.  We're not done yet though: there are a few gotchas.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The maximum heap size you can get in Java is 2 gigs, but -Xmx2G bails with a failed allocation.  The highest value you can give without the jvm bailing is 1640M.  That's right: 1641 kills it.  Why 1640? Because Sun hates us, that's why.  No really I have no idea why. &lt;span style="font-style: italic;"&gt;*edit* &lt;/span&gt;The Fu informed me that on the Vista machine on which he tested this, it wouldn't work with anything above 1024M.  When I got 1640M to work it was on XP SP2 in a virtual machine. I'm curious what the limit is on OSX.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you enter any malformed, invalid, or otherwise "sketchy" options Java will fail to create its virtual machine, and Flash will freak out and tell you that you need to reinstall Flash.  You can make everything better again by just deleting the JAVA_TOOL_OPTIONS environment variable.&lt;/li&gt;&lt;li&gt;If the JVM keeps dying and making Flash sad, open up a command prompt, head to C:\Program Files\Adobe\Flash CS3\JVM\bin and type "java".  Hopefully you'll get some helpful feedback about exactly why Java's dying.&lt;/li&gt;&lt;li&gt;There is no number 4.&lt;/li&gt;&lt;/ol&gt;I hope this helps someone, because it sure would have saved me a lot of time if I'd known this before.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4816566492235185757-6548104207193701547?l=jwoffenden.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jwoffenden.blogspot.com/feeds/6548104207193701547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4816566492235185757&amp;postID=6548104207193701547' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/6548104207193701547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4816566492235185757/posts/default/6548104207193701547'/><link rel='alternate' type='text/html' href='http://jwoffenden.blogspot.com/2008/08/how-to-overcome-compiler-limitations-in.html' title='Giving Flash CS3&apos;s compiler a little breathing room'/><author><name>Jon</name><uri>http://www.blogger.com/profile/14681631065598127139</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
