Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

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 ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
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.