In part one of this series, you created the Actionscript 3 library, Objective C static library and wrapped it all together in a beauteous Adobe Native Extension (ANE) for use in your Flash mobile app. By now, you’re able to connect to Apple’s Game Center, but you don’t know it yet. This post will will show you how to make use of your ANE to invoke the loginUser, showLeader, and showAchievements methods in your native library.
At this point, you should have created the BazingaANE.ane (or whatever you named yours) and you’re ready to use it in your app.
With the advent of Adobe Native Extensions (ANE’s) Flash platform developers have been fully unleashed upon the mobile OS scene. Your Flash apps now have full access to all native features through ANEs. This two part series will get you ready to integrate your own Flash games with Apple’s Game Center so you can start concentrating on making your fortune.
For brevity, this post is only going to show you how to do three things with Game Center, authenticate the user, show leaderboards and show achievements. I noticed during my Google sessions, there are many other people looking for the same integration with Game Center ANEs for Flash mobile games, so this will show you the bridge to achieve that goal, and the rest of the implementation is up to you. By the end of this post, you’ll understand how to submit achievements or scores, etc, all the things we’re not doing in this post.
Because I can’t say this enough, I’ll post it in bold: IMPORTANT - You need a decent understanding of ANE creation in general and setting up apps with iOS Developer Portal and iTunes Connect for Game Center. Without those prerequisites, you won’t get much from this post.
Whatever, just show me the code!
I was working on a component for a client that uses search.twitter.com to find all relevant tweets based on a query string recently and I noticed there’s a lot of other samples out there that use some hefty XML parsing code to sift the data rather than make life easy with e4x. The Twitter search API uses XML namespaces in its results, and it seemed that many other posts out on the intertoobs (can I coin this term?) were implying that it caused problems within AS3. Not true. Since I didn’t find a lot on the Twitter search topic specifically, a new blog post was born. The following is a quick and easy sample of how to use e4x in your XML results by using the given XML namespaces.
For this client’s component, I didn’t need to authenticate users, but rather, search for all public streams via a query string. If you take a look at the Twitter search API docs you can see the process pretty straightforward, it’s just using URL query strings to retrieve data . Generally, you can search for tweets:
- containing a word
- from a user
- to a user
- referencing a user
- containing a hashtag
- or combining any of these options together
For whatever reason, my personal blog has much more traffic than PXL Blog. Maybe it’s the crazy YouTube videos? Or the shameless ramblings during the wee hours fixing bugs? Whatever the case may be, I figured I’d blog twice about Attest 3 being released today. If there’s anything I like more than writing a blog post about something cool, it’s writing two blog posts about said cool thing
You can read the full stats on Attest at the PXL Blog. Go and download Attest 3, get certified, make fun of your iPhone dev buddies when you’re pumping out AIR for Android apps 10 times faster, collect your million dollar yearly salary (alright maybe that’s a stretch?), rinse and repeat for Flex 5 we’ll leave the light on for you.
Enjoy! P.S. More fun to come later in the week I have to say, it was kind of cool that Attest leaked out a little earlier than planned – ha! I’ll show you why soon.
If you haven’t seen already, Adobe released Flash Builder 4 and Flex 4 SDK today. If you’re a student or you’re unemployed, or possibly an unemployed student even, you can get yourself a free copy of Flash Builder. Along with the release are endless heaps of new material to get you up-to-speed with the latest and greatest of Flex. Below is a list of some of the best new resources to get you up and running with Flex 4 in no time.
I came across a situation while doing a Flex 4 upgrade for an Adobe Developer Center sample app where I wanted to use some the Spark animate properties classes.
This is SO cool because it gives you truly granular control over every aspect of a component you want to animate. In the sample I’m upgrading, there is an extended TileGroup component that has three columns and two rows of charts for an enterprise dashboard application. When a user clicks a button to zoom in on any given chart, I wanted to make use of some of the new Spark effects to really create a 3D look and feel quickly (without delving too much into custom layouts). Actually, the layout I made is a custom TileGroup, but I wanted to point out some ways you can use the Animate class to make sweet transitions on any property of a component in your own apps for simple animation, without having to create custom layouts.
Ok so it takes me a while to catch up on the blogging. MAX is over and the secrets are out. One thing I was particularly happy about was the new Shibuya Beta program, where Flex developers could incorporate Adobe’s licensing framework and start selling AIR apps.
My colleague Holly Schinsky and I were invited to be part of the super early beta program before MAX, which was extremely cool. This is huge for AIR developers because we now have a fully supported means of monetizing our applications. In the early days of Apollo (AIR’s beta name) I had come up with the idea for Attest (mock exam software for Adobe’s Flex certification) while studying myself. There was nothing on the market and I had compiled heaps of data while studying, so I thought it would make for a nice side project.
Where have I been again? I don’t remember sometimes…oh wait, working constantly! Inundated with work and slacking off on the blogging again. I was at CF United, and that was very cool. Learned heaps, caught up with old friends, drank beer, learned more, played golf, drank more beer, and so on.
Besides that, I’ve just been insanely busy (what’s new) pitching gigs, winning some, losing some, running away fast from others, and working secretly on Attest in the wee hours on top of everything else. Check out the PXL Blog for more (much much more soon), even if you’re not looking to get Flex certified or not interested in Attest, you’ll be very interested in some of the Adobe MAX goodness next week – mwahahha! Shhh, say no more…say no more, wink wink, nudge nudge, does she go aye?
On top of that, I’ve been updating MezzyShredder.com with new content, many a late night. He joined a new band, formerly called LOCKJAW, currently called War Horse. I defy even Yngwie Malmsteen to play faster or better than this man
To say I’ve been busy is an understatement. Where to start? They tell me there’s an economic meltdown going on. My question is, where? If you’re an RIA developer, especially a Flex developer, I can’t imagine you’re having a tough time finding gigs. Unless there’s just so many of us now that there’s actually competition?
My thorough lack of writing on my FUN blog parallels my thorough lack of sleep. It’s tough running a company on your own, especially when it’s a teeny tiny RIA firm and you’re completely lost when keeping records in QuickBooks. So what have I been up to? For starters, I updated a bunch of stuff on MezzyShredder.com. Added tons of videos of him playing with his band Wicked Society ( signed on a B & G Music label ) and YouTube. So if you’re into Black Label Society-style music, go check out Mezzy shredding like none other!
Ok that’s an excuse, but a good one! I finally bought myself a Fender FSR Highway One Stratocaster HSS
made in the USA of course Needless to say, I got NO work done the rest of the day…well no RIA work anyway. Man this is one sexy guitar!
Sorry, I had to share my euphoria though. With this thing in the office, I’ll have a hard time getting any work done. Anyway, I’ve been working my rump off on a bunch of different things but mostly I’ve been cranking on Attest 1.5. It’s built in Adobe AIR (see PXL blog for the full scoop). This is current being tweaked and tested, and will be available shortly. The coolest news is that it’s free for non-commerical use. If you want to get certified in Flex 3/AIR, you’ll want to download this AIR app when it’s finally released. I’ve taken a way longer time getting it out than I had originally planned on, but with my work load, and being a one man show so far, it’s been tough.