Skip to main content

Posts

Showing posts with the label Flash

The REAL reason you need Flash in a mobile device...

People keep going on about how you don't need Flash on a mobile device because most video sites like YouTube provide HTML 5 flash free versions. Therefore the limitation of no Flash on an iPhone isn't really a limitation (if you have been drinking Steve Jobs' Apple juice/kool aid). Anyways, last Saturday I found out the REAL reason you need Flash on a mobile device and it has nothing to do with video. It has to do with restaurant sites. For some reason at least 80% of restaurants out there have Flash only websites. If you need to make a reservation and you can't find the phone number in Yelp or UrbanSpoon then you have a problem. In any case, I was trying to find the number for a restaurant and Google gave me a link to their website. Unfortunately, their website is in Flash. Fortunately for me though, my phone is an Android phone and I was able to look up their phone number and address in spite of the limitation. In general though, having Flash on a restaurant website i...

Getting Search Engines to read Flash Content

Ok, so I lied. While Google supposedly now does index Flash content, what this article is really about is a quick a dirty way to get search engines to index your pages which contain Flash without having to display that content to the user in the HTML. Basically this technique relies on swfobject ( http://code.google.com/p/swfobject/ ). One thing swfobject does in dynamic mode is allows you to specify alternative content in a div for non flash users which gets switched out via JavaScript once the page loads: <script type="text/javascript"> swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0"); </script> <div id="myContent"> <p>Alternative content</p> </div> So basically you can duplicate the content which goes into the Flash app in the Alternative content section. Search engine spiders index HTML, but don't run JavaScript so are none t...

Flash for Programmers Part 2: The Display List

The Display List in ActionScript 3 is comparable to the DOM on a web page. Through the Display List you can add and remove your View components. I am not going to go into too much detail here are there are already many excellent articles about it online ( http://www.adobe.com/devnet/flash/quickstart/display_list_programming_as3/ ) ( http://developer.yahoo.com/flash/articles/display-list.html ). Suffice to say you will be calling addChild() and removeChild() quite frequently. I am going to give you a few practical tips though... Often (if you are doing truly modular MVC, which I will cover later), you will be firing off notes that may tell you to add and/or remove various components from the display list. You may fire a note which will ask to remove a child which doesn't exist though and this will cause your app to throw a nasty error. Just like in real life, I find it handy to name my children i.e. var dialog:Dialog = new Dialog(); dialog.name = "dialog"; this.addChild(...

Programmer's Guide to Flash: Part 1 - The Document Class

While Adobe came out with Flex specifically to create an IDE for programmers to create ActionScript/SWF applications, it is actually possible for programmers to use Flash CS3 (normally seen as a design tool) to create Rich Internet Apps. Most Flash programmers tend to regard Flex programmers in the same way that Web Developers regard .NET programmers. Flex (and .NET) programmers tend to be generalists who don't really know that much about interface programming and are afraid to get into the guts of a system. Flex itself is a 300k beast which may speed up your development, but it will slow down your application. However you are in luck. With Flash CS3 Development, the only really hard part is knowing where to start. Once you are over the initial hurdle, you will find yourself in code most of the time. Step 1: First of all, open Flash CS3 and create a new project (File -> New... -> Flash File (ActionScript 3.0). If you open the Properties Window you will see a box labelled Docu...

Unit/Functional Testing RubyAMF

One of my current projects is using RubyAMF to communicate with Flash (http://rubyforge.org/projects/rubyamf/). On the whole this is really nice because it allows you to transfer Ruby objects directly to ActionScript ones (as opposed to translating the object into XML, sending the XML and then recreating the object in ActionScript). However, Rails does not provide a built in transport mechanism for AMF, so we cannot run functional testing directly on the data call (as we could for an XML or HTML transport layer). This is a show stopper for a lot of people (Rails w/o Unit testing = a big mess of trouble when something goes wrong). We can though serve both the HTML and the AMF formats depending on the request format. This means that we can test the object instantiation logic and make sure there are no errors in the controllers (though we cannot check the actual format of the data being served). In the controller, instead of rendering AMF alone, do the following respond_to do |format| ...