Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[Flash] Custom Splash Screen - Single SWF

Discussion in 'Flash' started by catburton, Jul 27, 2012.

  1. catburton

    catburton

    Joined:
    Mar 29, 2011
    Posts:
    43
    A few people have asked if it's possible to have a custom splash screen for your Unity published Flash games, whilst keeping the output as a single SWF file. This is useful for games portals etc, where you're often only able to upload a single SWF file.

    A workaround for building a single SWF was previously posted in another thread by ParaLogic. I've taken that workaround and used it with our earlier Preloader example to show how you can have a custom splash screen for your Unity content in a single SWF file.

    Attached to this post is a zip file containing 2 folders:
    • BuiltExample - Contains the SWF and HTML file to run the built example
    • CustomSplashScreen - The source for the wrapper to make the custom splash screen. This folder is an FDT project, so if you're using FDT it should hopefully work straight away. If you're using another IDE, the contents of the libs/src folders are all you need to build the example.

    The AS3 code in this example is very similar to previous examples so hopefully it should be easy to follow. This is a quick/simple workaround and by no means represents best practices. As with the other examples/demos, since the publish to Flash feature is still in developer preview, this example is subject to change in future releases.

    View attachment $CustomSplashScreen-SingleSWF.zip
     
  2. manuelv

    manuelv

    Joined:
    Feb 24, 2012
    Posts:
    14
    Thank a lot !

    Great example

    Perfect.
     
  3. manuelv

    manuelv

    Joined:
    Feb 24, 2012
    Posts:
    14
    fine.

    Thanks for your share
     
  4. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Thanks for this help!
    However I am new to FDT and I can t get it to publich an HTML file along with the swf. What is the way for doing this?

    Thanks

    Stephane
     
  5. Hi There

    Hi There

    Joined:
    Oct 4, 2012
    Posts:
    2
    Works fine! thank you!
    Could it be possible to keep the loading progress bar with the custom splash screen?
    that would be perfect!
    anyway... thank you again!
     
  6. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Would be nice to see this workaround being replaced with a more solid solution. Is this to be expected in the next update?
     
  7. TirythDM

    TirythDM

    Joined:
    Dec 17, 2012
    Posts:
    3
    Hello, sorry catburton, nut I can't make it work u.u

    I'm using flashDevelope to make a single swf, but I can't figure out how splashscreen works, i tried to put libs/src, but the black screen after preloader still...

    can you give me more information? a tutorial maybe...
     
  8. ice99

    ice99

    Joined:
    Feb 8, 2013
    Posts:
    9
    Thanks for the example.
    Is it possible keep the loading progress bar with the custom splash screen?
    Can somebody supply an example or tutorial of workaround?
     
  9. mtoivo

    mtoivo

    Joined:
    Jul 30, 2012
    Posts:
    274
    I've done custom loaders only with Flash Builder, but it shouldn't be too hard to apply elsewhere; it's basically a single .as file. I've constructed the visual elements (including progress bar) in Flash, and and load those elements as an external SWF and control the visibility via AS code. if you decide to use custom splash screen, then you have to also create the progress bar, but it's no that hard.
     
  10. ice99

    ice99

    Joined:
    Feb 8, 2013
    Posts:
    9
    Thank you for reply. I understand algorithm, but i can't catch bindings of these steps.
    Can you post some of your sample project? I mean "custom preloader"+"unity project" where we can see connection between the preloader and project. I've downloaded few examples, and my notes are following
    - if i use 2 different files (UnityProject.swf and CustomPreloader.swf), and my "UnityProject.swf " has (working) fullscreen option (via actionscript), then after custom preloader i try "Fullscreen button" then project opens in fullscreen, but not scaled to fullscreen. It shows regular size (500x500px) in a top left corner on a solid fullscreen fill. I think there is some problem with scaling.
    - if i use 1 file, i can't test this options, because i have no example source code to figure this out. In file "CustomSplashScreen-SingleSWF.zip" there is no UnityProject. It's only compiled swf and few actionscripts. So, i can't figure with Unity source code.
     
  11. zeusrami

    zeusrami

    Joined:
    Dec 12, 2012
    Posts:
    17
    Hi maybe you can help me :) When I compile to flash, unity generates an html file. The problem is that the swf doesn't work without this html.
    I saw in your example that the file CustomSplashScreenExample.swf works perfectly well witout the html.
    But In my case the only way to make my swf work is with the generated html and all the portal games accepts only 1 file (the swf)
    Maybe I forget to configure something? Any Idea?

    Thanks a lot!
    Ramiro

    Any suggestions?

    Regards,
    Ramiro
     
  12. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    The html has little to do with this. If the portal allows for content that needs a wmode=direct in the flash embed, then you should be ok. There is nothing special about the html that unity provides next to the swf file.
     
  13. HaHa_7758

    HaHa_7758

    Joined:
    Mar 22, 2014
    Posts:
    2
    FDT software using open, error: 'The workspace cannot be built until the necessary SDKs are configured.', How to configure the SDK it?