by David LeMieux
A few weekends ago my brother needed some help with a homework assignment. He was supposed to have made a magazine of sorts with articles and advertisements focused on a certain topic for an English class. He hadn't finished it and needed some help. I volunteered to help make the ads.
The topic of his magazine was Mixed Martial Arts. He decided that he wanted at least one of the ads to promote a made up MMA supply company called "Endure." Here are the ads I came up with.
June 14th, 2009 - by Dave
I try to be a time-conscience, eco-friendly, on-time kind of a guy, but I can't seem to avoid taking longer-than-needed showers. I realize that no-one but me needs to know this, but I don't care. It is time for another segment of things you didn't need to know.
This is a conversation I have with myself almost every morning:
Me: I am going to just take a quick shower.
(turns on shower, feels how nice it is, takes too long)
Me: Oh no! I took too long again!
Somewhere between having that thought and turning the water handle (about 0.5 seconds) I get so distracted that I forget my goal. Maybe I should write it on the shower wall with a dry erase marker.
-And this concludes another segment of things you didn't need to know.
I would suggest starting here: The Problem With Local Connection
At the end of the above-linked post I said "In the mean time we are working on a solution using SharedObject and timed polling [to replace LocalConnection]." So it should be no surprise to announce that we have successfully done so.
We replaced LocalConnection with SharedObject
How is it done?
The premise is a simple one, instead of directly calling a method on another swf file as you would with LocalConnection, we have created a polling system that uses SharedObject to relay messages from one swf to another. SharedObject is like a cookie that Flash Player can use on a users machine. Taking that in to consideration we built a controller that uses SharedObject to save and retrieve data at timed intervals and in that way shares commands between different swf files.
Here is a basic rundown of what happens:
SWF One - writes an instruction to the SharedObject using the controller.
SWF Two - is set up to listen for changes of the SharedObject and then parse new values for instructions.
There are some "gotchas"
First, if you have lots of SWFs on the page you don't want them to accidentally overwrite any previously set but unread value. Because the sending isn't instantaneous it is very possible that multiple instructions could be send before the receiver had a chance to poll for more of them. To overcome this we implemented a basic multi-thread like system of mutexes and semaphores. Essentially, different actions (reading and writing, depending on the circumstance) block others and the controller knows how to queue up commands. The controller also knows how to interpret queued commands.
Second, there are people who don't allow memory for SharedObject on their machines. In this case we had to build in a LocalConnection backup. This is ironic because we build the SharedObject controller to replace LocalConnection, but it is more of a Plan B than a surefire backup.
Third, related to the first, there can be some lag between when a command is sent and when it is received. Fractions of a second (in our case) but still lag nonetheless.
Fourth, because of the way we implemented queuing sometimes there can be a high increase in CPU usage. We are working on tweaking this.
How can you do it yourself?
That is a very excellent question. We are currently stress testing our solution and are about to launch it on an even larger scale. We now have a very scalable solution for sending messages to multiple swfs on a page. We have tested hundreds of swfs on a page communicating with one another with a 100% success rate. Comparing that to the small range (5-12 or so) of LocalConnection successes and I feel like we have a real winner on our hands.
I cannot say if we will ever release the code and we wouldn't currently because of how new and untested it is (and undocumented and still needing refinement and a million other reasons). I do wish to say we have found a solution, however, and that If you familiarize yourself with SharedObject and think about it for a while you will be able to come up with your own solution. Our controller is literally around 50-100 lines of code; not very big.
If you come up with something you would like to share please do. I am also willing to answer questions if they arise.
Best of luck.
May 12th, 2009 - by Dave
I hereby decree that you should all stayed tuned for the next exciting installment of "The Problem With Local Connection." Will David ever find a way to fix the shortcomings of LocalConnection? Can Flash Player meet the challenge? Is Deborah dead? Find out all this and more, soon!
... and I am back from an unintentional blog/link hiatus. Huzzah!
Here is a blog post and video from Widgetbox that outlines what I have been working on lately: A simple Flash image cropper for use with our Blidget Pro product.
A month ago our second child, Isaac, was born. We are now in the middle of creating and sending out baby announcements. My wife wants to do this for some reason. Anyway, just as I offered my excellent and unmatched skill to my brother (check out all 10 parts), I will be helping out my wife by designing the baby announcement. Here is a first pass.
Welcome, Isaac, to this planet we call home!
To make a long story short I flipped out a while ago and decided to make my internet life a lot more private. I closed up some errant, unused accounts on different services. I increased my profile security settings on others. One account that was in the later category was my twitter account. I decided to switch to protected updates. Now, about maybe a month later, I have turned them back to public.
This is what I learned along the way:
Pros
With protected updates I didn't have to worry about divulging someone more personal information. I could talk more about my location, current goings-on, and personal life without feeling like some anonymous stalker could be reading my public feed. I also received a lot less twitter spam and bot followers. Even when I did, I was quickly and easily able to shut off those accounts that seemed suspect. That kind of extra control was nice. A pleasant side effect of more control turned out to be that as I people requested to follow me I actually found some pretty interesting people to follow back.
Cons
Protecting my updates meant they would no longer appear on the public timeline. That also shuts you off from being found in twitter search results. Suddenly I was shut off from any public conversation whatsoever. I could not participate in any fun memes or discourse based on a tag or key word. Perhaps the most powerful feature on twitter is the search. It is a real-time glimpse in to what people are talking about. Not being able to contribute was frustrating. Protecting updates also brings on more awkward situations. At one point my own mother started following me and I was given the option to allow or deny her access to my status updates. It was an odd moment.
Feature Request
I want to have my cake and eat it to. I think that a nice feature would be to allow those with protected updates to make certain ones public. Twitter already uses the "d username message" convention for sending direct messages. Why not allow something like "p mesage" to create explicitly public messages. That way people who are privacy aware such as myself can have protected updates but then consciously choose to make certain updates public.
Protecting your updates certainly does make things a lot smoother on Twitter. Unfortunately it also completely removes you from the public conversation.
... and that fulfills my Twitter blog post quota for the year. Next subject, please!
UPDATE: I've turned private mode back on. I have decided that not having weird random followers and spam is more important to me that being part of the public conversation. I'm a flip-flopper I know.
Recently, I came upon an interesting problem regarding Flash components. It wasn't the first time something like this had happened. In brief, I was moving a design created in a Flash 10 environment in to a Flash 9 coding environment. Perhaps my situation was unique (or I had some kind of bad setting) but I thought that the Flash IDE would be smart enough to know what I was trying to accomplish.
Here is what I saw:
I had a design done with Flash 10 selected as the publish type. I began copying assets from the stage and library in to another movie clip that I had set up to publish with Flash 9. I was moving all those things because the designer had comped the design with timeline animations and the like in order to illustrate how it should work. This is how we roll at work. Our process usually works well. The business team gets a good feel for how things will look and feel, then I take the animated prototype and start putting in all the wiring. This usually means retooling some of the layout (nesting clips differently, movie things in to the Library for later export, etc.).
Part of the design had a component button. Not a SimpleButton, but a button component from the component library. Everything copied just fine. In the preview it all looked great. The trouble came when I compiled. I was given no errors, but the button lost its label. In fact, when I traced the value of the label instead of "Browse," the value set in the component inspector, it came back as "Label." Somehow it was being reset and then taking on some kind of default behavior.
Here is what I tried:
I tried myriad things to solve this problem. I removed the button and all the assets from the library and tried importing a new one. I tried taking it off the stage and adding it dynamically (addChild) in the code. I even tried leaving it on the state, duplicating it with the code, removing the original and adding the duplicate. Each time the same thing.
Then, in a kind of "ah ha!" moment, I turned the publish setting to Flash 10 and all my troubles went away. Why? I have no idea. I can only assume that something in the setting or some part of the component library knew it had been originally set in Flash 10 and was therefor using resources not available to Flash 9. Eventually we made a new SimpleButton and used that instead.
Here is what I conclude:
This button issue is just one in a long list of complaints I have against Flash Components. Don't get me wrong, components are great. When they work they work well. They are very customizable. They are robust. They do the job and make development time faster... unless they don't work which is, for me, often the case.
Another downside to components is the massive amount of file size they add to your Flash files. At work we have one particular file that is served a large number of times each day. It used to have a Loader component as well as a in-house-developed component. The file size was around (when all is said in done) about 120Kb. We removed all the components and replaced them with classes (MovieClipLoader, XML, and a component-to-class conversion of the in-house one) and now the same product can do much, much more and weighs in at about 60Kb, half the original size because we removed components.
Actually, we did implement a bunch of new features, so really removing the components got the size down to about 25Kb, or about one fifth the size. We just removed two components. Over millions of downloads that saves use quite a bit of bandwidth. (example: If the file had been accessed 1,000,000 times in a day, with components that is 14GB of data transfer. Without components that is 3GB of data transfer)
I wish I could have some kind of solution for this problem. Some clever hack to make components work. I do not. I welcome any suggestions, though. I want to contribute to the Flash community, no just whine all the time.
Components should be easy to work with but aren't. When they work they are great and really help speed up development time. Unfortunately they are bulky as far as file size is concerned, and if you are dealing with any high amount of traffic their benefit is quickly outweighed by the extra expense they will bring to your bandwidth bill. Bandwidth aside, the built in Flash components are often buggy or don't seem to work they way they should. Maybe I am "doing it wrong," but with nearly ten years of Flash experience under my belt I would hope that by now I would know what I was doing.
If you are having trouble with a Flash component stop blaming yourself, it probably isn't you. It's them.
If you know me or frequent this blog often you know that from time to time I get a silly idea in my head and then bring it to life. In fact, if you are my friend you can't escape knowing this because following a project completion I do nothing but talk about the recently completed project for the next two weeks. I apologize. Anyway, it is time again for me to introduce another silly side project and talk about it like a jabbering fool. Like a child on Christmas morning I am only excited about a new toy for a brief period of time, then I start to unwrap the next. E.gg Timer is sooo two weeks ago.
Without further ado, I would like to introduce J.ot Down - a cousin of sorts to e.ggtimer. In a word, J.ot Down is a notepad. There is, as always, more to the story.
J.ot Down's idea came from an observation I made that people are spending more time in their Internet browsers. Many modern browsers allow the user to have multiple tabs of web pages open at once. People use browsers (or web pages loaded in the browser) to communicate, to research, to read, to write, edit photos, watch video; for just about everything.
It has long been my thought that the Internet is creating a shift in how we think about computing. In many ways a traditional operating system (Windows, OS X, Linux) is just the backing behind the web browser. This isn't true always, nor is it true in niche situations, but the things I did outside the browser eight years ago, write text documents, edit photos, send email, watch video, etc., were all done in the OS in different applications. Now I do all of those things in Firefox.
With a few understandable exceptions the browser is where I spend my time; however, I did notice one thing that I was not yet doing in-browser. Jotting down notes. I often use the OS default text editor (Notepad, Text Edit, Nano, Emacs, whatever) to write down quick lists of things to do or to help keep my thoughts straight as I work throughout the day. These text documents I create I hardly ever save or return to. They are disposable. Like a pad of notebook paper. Though occasionally I keep them because they contain valuable information. I realized the other day that there did not seem to be a way to do the same on the web.
Sure, I could have used something Google docs, but then my documents would be cluttered with files I no longer needed.
That is why I made J.ot Down - so there would be a simple way to write down throw-away thoughts in the browser but optionally save them and share them when needed.
J.ot Down is pretty simple. You open j.otdown.com and start typing. When you pause or hit save you are forwarded to a secret URL which serves as a permalink to your recently created note. The note then continues to auto-save as you edit. You can then keep it open in your browers as a tab and return to it as needed. Because it creates an unique URL for you, if the browser crashes or you close it accidentally you can always restore it or go back to it through your browser history. (more info here)
Simple? Yes!
Pointless? Maybe. But so are many of my other projects so this is totally on par with my other work.
Now, I will point out that there are some missing features.
1) You can't currently add a title. You just get a date-based URL.
2) No way to secure a note. While it would be hard to guess at the unique URLS, it is not impossible. Securing them is a high-priority iteration task.
3) Since "releasing" it in to the wild, I have caught my self wishing that it had some kind of collaborative editing feature. I am trying to figure out the best way to solve that issue. Do I even need to add that as a feature?
4) There isn't a way to keep track of past notes other than your browser history (or emailing yourself the links all the time). This one is hard. Not technically, mind you, but I don't want to bother users with creating an account. I really want this service to be as simple as: show up, type, and you're done! Also, the idea behind this site was to enable users to create disposable, one-time notes that would auto-save just in case something extreme happened. Any suggestions would be great.
I plan to iterate and make improvements. I do this with all my projects. The E.gg Timer of today is not the same from three months ago. I am excited to see where J.ot Down goes. It may go nowhere. I think it has some potential, but doesn't everyone that creates anything think their creating has potential? Most the time, I think.
I welcome J.ot Down to my side project family.
E.ggTimer.com Home Page - Refreshed!
I would like to tell the tale of E.ggTimer.com and how a simple (and silly) side project of mine took on a life of its own thanks to Twitter.
I made e.ggtimer.com back in December of 2008. I made it, as I make many things, because it was something that I wanted and couldn't find anywhere else. I have made many silly things for no other reason than I found myself saying "I should make that" on more than one occasion. Sometimes there are pre-existing solutions to my problems, but there is something about making things that is satisfying and fills a void. I suppose you could call it my hobby.
Anyway, up until a few days ago maybe five people had ever used, or even knew about, E.gg Timer. Then something amazing happened. Tim Ferriss, author of The 4-hour Workweek asked this question via Twitter.
Tim Ferriss asks a question.
"Can anyone suggest a good countdown timer for Mac or both Mac/PC like Compact Timer? http://ping.fm/z0f0S" 2:22 PM Feb 24th
Ben Lew, a friend of mine and web designer extraordinaire, happens to follow Mr. Ferriss on twitter. He saw the question, thought of my simple site, and responded.
Tim Ferriss gets some answers.
"@tferriss correction: http://e.ggtimer.com/ via @lemieuxster" 2:36 PM Feb 24th
Apparently Mr. Ferriss clicked the link and liked what he saw.
E.ggTimer, I choose you!
"Per 19.5K ppl, best Mac timers, descending order: 3-2-1 Timer, Minuteur, and Apimac Timer. My fave: http://e.ggtimer.com/ (via @n0s0ap)" 2:49 PM Feb 24th
After than, and surely due to the popularity of Mr. Ferriss and his position as opinion/thought leader mentions of e.ggtimer started to surge on twitter. People from all over discovered the site and decided they liked it. For whatever reason, a simple Flash countdown timer was really appealing.
The next day, no doubt due to the activity on twitter and the referral from Tim Ferriss, Lifehacker.com put up a story about E.ggTimer and the flood gates opened wide. Lifehacker suffers from the plight of most major blogs, that is copycats and page scraping. Anyway, E.ggTimer got noticed.
I am a bit of an egoist when it comes to things I make online. I like to keep track of who is using and talking about my stuff. I think all Internet developers do this. Maybe I shouldn't admit to it, but I just did. Looking at the comments reveals a fairly normal cross section of Internet users. The overall consensus seemed to be that it was a neat utility. That is more or less what I would expect to hear about a project that took my two hours to complete some random weekend. Unfortunately, some people were taking E.ggTimer was way to seriously. The Internet did not disappoint when it came to people finding ways to put down or defend the existence of the site. There were mentions of how useless the site was, how useful the site was, and one person even went so far as to create their own version and then try to get equal blog coverage.
thetinytimer.com
thetinytimer.com seems very well put together though their page design does seem somewhat familiar...
tinyask.com
I will give the benefit of the doubt on this one. The developer has probably never heard of tinyask.com. But maybe something about "tiny" being in the name makes us want to use that kind of gradient.
The flattery of imitation aside, the response was still more than expected. I received a whole lot of email about my site: People requesting features, telling me "good job", and other advice and communication. Since my contact information isn't really readily available on E.ggTimer itself that means that people were willing to search it out. That is pretty cool.
Perhaps I am reading in to this a bit much. I most likely am. But because of one question on Twitter a site that got 0-2 visitors a day is now getting 4,000+ visitors a day. When Lifehacker posted their story 12,000 people came to the site. I do not expect the traffic to stay up that high for very long. That said, I have been on the front page of Digg a handful of times, even back in the "just tech news" days, and while the traffic from Digg was large, it wasn't nearly as large or as high in quality as the traffic from a well-known blog or from those people coming from Twitter.
(For the record, I have never really actively sought any of this traffic though I can't suppose I would be telling the truth if I didn't think it was the coolest thing ever!)
E.ggTimer is just a simple web-based countdown timer with a fairly hackable URL structure. It isn't part of the next wave in Internet development or anything spectacular. What is spectacular is that Twitter has real-time capacity to drive eyeballs and traffic. People talking, asking questions, and getting answers almost instantly is powerful indeed.