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

Making a game with flixel and Flash Builder 4 – Splash Screen

Did you read Creation of a game with flixel and Flash Builder 4?

Now it’s time to add a splash screen to the game. The splash screen or the title screen is the first thing the player sees, so we’ll add a backround image as well as the game title.

First, we must change our main file, HelloWorld.as, this way:

As you can see, the only change I made can be found at line 9… here I am calling splash_screen class, that is the brand new class we are going to create.

Here it is:

then PlayState class does not change…

And this is the result:

Follow splash screen instructions to “play”… next time, the game itself

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 5.00 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 6 comments

  1. Dude

    on May 6, 2010 at 8:54 pm

    I’m using v2.34

    It worked after I replaced:

    public function splash_screen():void

    with

    override public function create():void

  2. Labici Danut

    on May 10, 2010 at 2:34 pm

    Ooo nice. Thanks!

  3. markanator13

    on May 11, 2010 at 7:27 am

    I get an error on line 7:
    [Embed(source=”../media/splash.png”)] public var splash_image:Class;

    unable to resolve ‘../media/splash.png’ for transcoding | splash_screen.as | /HelloWorld/src | line 7 | Flex Problem

    any help?
    :D

  4. amaca

    on October 6, 2010 at 11:51 am

    just put your png file in the right path ../media/splash.png

  5. Mynonas

    on November 16, 2011 at 5:55 am

    using flex 4.5

    had to change line 38 from:

    FlxG.state = new PlayState();

    to:

    FlxG.switchState(new PlayState());

    since FlxG.state changed to read-only.
    works like a charm!

    thanks for the tutorial Emanuele! :)

  6. Ryan

    on August 1, 2012 at 11:54 pm

    Great tut, i needed to change

    FlxG.fade.start(0xff000000, 1, on_fade_completed);
    to
    FlxG.fade(0xff000000, 1, on_fade_completed);

    thx all for the previous comments they helped.

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

×