i am making a game based on starling in flash professional , i have like 5 spritesheets to load thats why i decided to put a animation as splash screen.
i create the splash by creating an object of the splash screen. The problem i am facing is that the game when loaded stucks on the frame 1 of the splash animation , then when the entire game is loaded then only the animation starts , thus defeating the purpose of having splash screen in the first place,
how can i do it so that the splash animation begins instantly and spritesheets are loaded concurrently.
here is the code i used in the document class to add splash screen
the splash class contains animation made in flash professional
splash = new Splash();
splash.width = 1136;
splash.height = 800;
splash.y = 67;
splash.width = stage.fullScreenWidth;
splash.height = (stage.fullScreenHeight / 640) *550;
this.addChild(splash);
splash.play();
Not sure about the total setup of your flash file but this is how I do it.
On Scene1 I have the splash movie clip. The actually game is on Scene2.
In the splash movie clip, last frame, check whether the game movie clip has loaded, if not, go back to frame one of the splash movie clip. If it is fully loaded, stop(); the splash movie clip and goToAndPlay("Scene2");
Related
Here is my app:
Screen record
But the animation is autorotation default. It's not looking very smooth. I want my video player rotate and expend to whole screen like what Youtube iOS app does. How to do that? Any suggestion?
Actually it seems only the video player view is rotated and expanded to full screen for Youtube App. But the whole view of UIViewController is rotated in my case.
If I wait a few seconds and close/reopen the app (or scroll the video), the video eventually comes back. I am completely lost as to why the video just disappears and my AVPlayer goes black.
Has anyone encountered this and/or know of a fix?
Edit: I set up the AVPlayer inside an AVPlayerLayer like so: https://codeshare.io/vmBHX
I need to find a way to display the view of a MPMoviePlayerController after the first frame of the video is cached.
My App shows the first frame of the video as a png and I want the video then to be shown without the screen going black for a second. How can I do that?
Display that image as a view-overlay on top of your MPMoviePlayerController by adding it as a subview of MPMoviePlayerController.view.
Once the video has started the playback (use the MPMoviePlayerPlaybackStateDidChangeNotification to react upon that), hide / remove your overlay.
Can I play a video file in the splash screen?
I use Defualt.png and sleep interval method to use static splash screen. Instead of an image, I want to play a video of about 10 sec.
How can I do that?
Just make Default.png to be the first frame of your video. When the application is loaded, start the video. This is something in between. Hope it helps.
No, the default image is shown by the system while your app is loading, so your code isn't running yet (kinda the whole point). Once it is loaded, you can create a media player and play your video.
My application flow is something like the following
A Video plays.
Once its done. Couple of icons are shown on the screen for users to tap on.
Depending on which icon was tapped, another video starts.
If no icon is tapped for like 5 seconds we automatically go to next video.
The problem is with 3. Just before the video starts a black screen appears for like 0.5 second.
Not sure what's going on because the videos in step 1 and step 4 plays fine.
It will be great if someone can give ideas to debug and fix this.
Thanks!
You can try to put a background-image onto the player with:
[[moviePlayer view] setBackgroundColor:<UIImage>image];