Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Create a WordPress MochiAds Leaderboards Widget

Some time ago I blogged about Showing MochiAds leaderboards in any Flash movie or web page with a script made by myself that displayed MochiAds leaderboards on your site.

Yesterday MochiAds guys released a widget that accepts a game slug and partner ID and will display all the available leaderboards for the given game. The partner ID will constrain the widget to showing only scores from your site if you choose to do so. The widget is a Flash .SWF that can be embedded on any HTML page on your site.

In the official docs page there is an example using swfobject library but there is a much simpler way to embed scores… here it is:

Just replace ballbalance with the game slug you want to display highscores.

Width and height have minimum values of 230 and 200 pixels, and the score table will adjust according to size.

Here it is an example of a leaderboard with 400×400

And this is the tiniest one…

… that looks perfect to be embedded in a blog

Let’s create the WP widget!

Before continuing, I suggest you to read How to create a WordPress Widget if you don’t have experience with WP widgets.

The new widget is made this way (don’t worry, I’ll explain how to do it during one of next tutorials)

and creates customizable widget allowing you to specify name and slug of your game this way:

Download the widget and give me feedback

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 4.83 out of 5)
Loading ... Loading ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 9 comments

  1. antonio3407

    on October 17, 2008 at 2:39 pm

    What about the plugin to add games to wordpress when you gonna release?

  2. dix huit

    on October 17, 2008 at 2:41 pm

    +1 – When’s the WordPress Arcade plugin gonna see the light of day?

  3. Emanuele Feronato

    on October 17, 2008 at 3:30 pm

    As soon as it’s bug free…

  4. Nathan

    on October 17, 2008 at 6:31 pm

    Oh my gosh…. stop bugging him about the WP Arcade! He will tell you when its ready!

  5. dix huit

    on October 17, 2008 at 10:49 pm

    @Nathan: I’m not bugging him, just checking in. The man said it would be ready on October 1st. I’m just really looking forward to this plugin.

    I’d give him a hand if my PHP was better.

  6. Bob Ippolito

    on October 18, 2008 at 4:47 am

    Please don’t use the “dev.mochiads.com” URL, that was a mistake on our part.

    We’ve just released significant updates to the leaderboard widgets, check it out:
    http://www.mochiads.com/support/pub_docs#widg

  7. Bob

    on October 29, 2008 at 4:37 pm

    Dear Emanuele,
    Please publish that plugin for importing games.

  8. cam mozaik

    on May 22, 2010 at 7:48 pm

    Thanks a lot! I am just learning Information.
    And php and this was very easy to follow and helped a lot.
    You really took time to explain every little bit.
    Thanks again…

  9. Flash Game Development Inter-web mash up: October 17, 2008 « 8bitrocket.com

    on May 13, 2013 at 3:49 am

    [...] is on FIRE! This guy doesn't quit. He is always offering up a wealth of new tutorials for all. – Create a WordPress MochiAds Leaderboards Widget – New tile based platform engine – AS3 version updated to step 10 PLUS scrolling – Create a Flash [...]

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×