18
Jan 12

Flash/Flex Facebook Application HTML Wrapper

Facebook and Flash Builder
This again might seem pretty elementary for some Facebook developers, but I was having some problems with my first Facebook application’s HTML wrapper. First off I should mention, I am not a fan of the Flex generated HTML wrapper, and that is even more true now after this project. I typically write my own html files, especially the index files from scratch or start from a previously used project’s.

Here is an example of the HTML wrapper you will want to use.

Here are the contents of the head tag.




And the contents of the body tag.

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

There are a few things to take note of here:
• Make sure you are using the ‘https’ for your call to the all.js file from Facebook in the header script include. This may result in errors with SSL otherwise because a page that requires SSL would be attempting to load items that are not over SSL.
• The attributes object that gets passed into the swfobject embed has a matching id and name.
• The matching attributes of id and name mentioned above must also match the id of the div where your flash content lives.
• The first div id in your body must be “fb-root”.

The Flex generated HTML wrapper will not match the above, and even after making sure you have the correct div ids and attribute id and name, it still will not load in IE 9. I have not yet investigated why this is the case, but the Facebook application loaded in fine in ALL other browsers, except Internet Explorer 9. I then changed out the Flex generated and somewhat modified wrapper with the one above and all was well in IE9. This is even more dangerous with Flex because as we all know, many times Flex may freeze up when building and we may need to regenerate the Flex HTML wrapper in the project settings which may overwrite some of the changes you put in place to work with Facebook originally.


18
Jan 12

Facebook.init() and Facebook.Login() Handler Not Getting Called or Null

This was one of those ‘noob’ lessons of Facebook development. When setting up your Facebook application at Facebook Developers, within your ‘edit app settings’ page for your app, you will notice the canvas URL input fields. These fields point to where your application will be hosted, and eventually loaded through an iFrame once viewing within Facebook. Anyways, this location and all subdirectories of this location is the ONLY place I have been able to properly test my application, yes unfortunately that means no local testing of your application unless your application doesn’t need to make any or hasn’t yet made any calls to the Facebook API.

That might seem pretty self explanatory for some, but I for the longest time was wondering why I couldn’t get my Facebook.init(APP_ID, handleInit) to call back to the handleInit(). So as long as you are running or debugging in the directory or subdirectories of that directory that you specified in the ‘Canvas URL’ location your callback will fire. The same is true for the Facebook login: Facebook.login(handleLogin, {scope:”user_photos, publish_stream”}); In order to properly test logging in and giving your app the permissions you specify in your scope object, you need to be testing/working within the directory specified in your application settings.

The second part to this is coming in my next post Flash/Flex Facebook Application HTML Wrapper, about the limitations or expectations of the index.html or HTML wrapper you create for your app and point to within the Canvas URL settings. It may also directly impact the API calls mentioned above: Facebook.init() and Facebook.login().


18
Jan 12

Facebook Page Tab

From what I hear, creating a Facebook page tab was once fairly simple within the admin of the page. Not sure why, but Facebook apparently removed this simple functionality. A colleague of mine hooked me up with the call you can make to create a page tab on the fly.

Simply make the following call in your browser:

https://www.facebook.com/dialog/pagetab?app_id=APP_ID_HERE&display=popup&next=PAGE_TAB_URL_HERE

You obviously have to be an admin for the page you wish to add the tab to. After entering your application ID and landing page url in the above url, you will be able to select a page from a dropdown of pages you are an admin for. That’s it. Hope this helps.


18
Jan 12

Flash Builder/ Flex / Flash Facebook Application Development

Facebook Application
Recently I also completed work on my first Facebook application, and I can honestly say it was not as bad as I thought it would be. Myself and one other contrator made an application for SunnyD. The application is called ‘Drink Up & Download Cover Yourself’. The application allows users to create their own custom album artwork.

A few details about the project:
• Flex Framework (4.1A SDK)
• Flash Player 10
• ActionScript 3
• Facebook ActionScript API

Obstacles:
• Re-familiarizing with Flex Framework
• Familiarizing myself with the Open Graph API
• Facebook.init() and Facebook.login() (Check out the post)
• Limitations within Facebook API (where users can or cannot post items)
• App not initially working or visible in IE (Internet Explorer 9 specifically) – Check out the post
• Previous page tab creation removed by Facebook – Check out the post


18
Jan 12

My Very Own Name Storybook Launched

My Very Own Name
Well I am months behind on my posts, and that means that my second iPad app has gone live. My Very Own Name Storybook was an app built for I See Me. They make amazing custom children’s books and they wanted to bring their success to the digital space. Within the app, kids can search for letters in their name, learn how to write their letters, and collect and interactive with numerous animals that represent the letters in their names.

The application was built with much of the same framework that Zubopp was built with. I used Flash CS5.5 as my editor for all production and animation publishing. The application was republished with AIR 2.7 before sent to the App Store for approval. Final approval took about a week.


09
Aug 11

Zubopp


So this is coming a little late, but my first app has made it into the iOS App Store. Zubopp a whack-a-mole kids game was released on June 29th. Zubopp was built with Flash CS5 and was packaged for release with AIR 2.7. I wanted to prove many things in this application that would be used for a future application:
• Loading in external XML file
• Loading in external SWF files
• Attaching events to the externally loaded SWF files
• Shared Objects
• The restrictions to what is ‘code’ in an externally loaded file, could I use instances names, frame labels, stops, anything, etc.?

What I found out:
• No issues loading external XML files
• No issues loading in external SWF files as long as they did not have code in them (this means no timeline code or export for ActionScript, you are however allowed to use frame labels and instance names within movieclips)
• No issues attaching Mouse/Touch events to externally loaded in assets from SWF’s
• No issues setting Local Shared Objects to the device

All in all I wanted to test my architecture patterns that I have used on numerous Flash applications in the past. The app took about a week to get approved and is currently available to iPad users only as a free download. I have a universal binary ready for upload, just need to find time to do this.

Take a look: Zubopp in Apple AppStore


12
Jun 11

Back on iPhone, away with Samsung Fascinate…

So back in September or October I made the move to Android. I debated heavily over a Droid Incredible or a Samsung Fascinate. The store employees pushed heavily for the Fascinate for it was newer and nearing the release of Android 2.2 Froyo. Well I didn’t get the Froyo update for months, and as a Developer who works primarily with Flash this was hard for me to deal with.

Anyways, Android as an OS I liked, the Samsung Fascinate I did not. The battery life especially after the release of 2.2 became impossible for me to deal with. I would have to take a charger with me to work everyday, and charge before bed nightly. After doing a factory restore numerous times, I realized my choice of ‘bad apps’ was not the problem, it had to be the hardware. After doing some digging and some searching, I noticed within the Settings -> About Phone -> Battery Use section, there was a ‘Cell Standby’ listing. This was a high percent of my battery usage which I thought to be odd. Turns out my phone was searching for a signal more than half of the day, everyday. This constant on/off/searching of network towers was killing my battery while I wasn’t even using the device, worst part is this happened even when I was outside.

So what did I do, I am back on an iPhone and loving it because it is an extremely reliable phone, and that is what I need first in my cell phone.


12
Jun 11

Flash CS5 iOS Packaging with AIR 2.6 SDK

Recently I have began making a test application using Flash CS5. A year ago the flash packager wasn’t even an option because of how poor performance was on the iOS devices. However with changes Adobe has made to the compiler, AIR 2.6 makes Flash to iOS a real possibility. Last week I worked on my first application to be published to the App Store and hopefully submission will happen this week. I am eager to find out what the Apple approval process is like, especially given that I am using Flash over the native Objective-C approach.

A few things I am looking at proving with the first application:
• Having main SWF load external XML.
• Loading external SWF files that are listed in my XML.
• Assigning touch events to loaded in SWF files from the main application layer due to the inability to have external code in externally loaded files. This one is going to be key. So far I have not had any issues with this approach and I already have it working on my device. A couple things to note here. You seem to be allowed to have both instance names and frame labels in externally loaded SWF files. No export for ActionScript is allowed in your library, and no timeline code.
• Using Local Shared Objects to store user settings/preferences.


11
Jan 11

FolderWatch

Today the new Mac Apple Store approved FolderWatch. FolderWatch is an application written by Jay and Cory Roloff, two great local developers. I am never one big for plugs or promotions, but this app really is great and a must have for web developers.

In my day-to-day, I am constantly required to copy files from my local machine, up to a server for testing, reviews, etc. The task of continuously having to copy new files can start to become quite the interruption on certain projects. FolderWatch handles all this behind the scenes. Simply pick a source and destination folder, and FolderWatch will automatically keep the folders synced up, completely eliminating the need to copy anything to the server again.


25
May 10

Flash Not Recognizing Installed Fonts

Today I ran into a very strange problem in Flash. I received a FLA from a designer and attempted to open it with Flash CS3, and it said I was missing fonts. I then went to many extremes of installing the fonts in both my system library fonts folder as well as my user library fonts folder. After each attempt I tried to open Flash and received the missing fonts prompt. I then attempted these two options again, and after each I restarted my machine, only to get the same result. I then tried opening the FLA in CS4, same thing.

My patience was running thin and after talking with some co-workers they recommended I open Photoshop and see if I have the font in there. Did that, and I did have the font, which made me even more puzzled.

I then started doing some googling and came up with the solution:

  • First, I deleted all the fonts I was attempting to install (the UniversLT Std Family).
  • I then re-installed them to my system library fonts folder.
  • I installed Font Nuke (an app that removes font cache files) and ran it.
  • Open Flash and voila, the fonts are there.