We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Flash preloader keeps playing but wont start movie.

apriigem
apriigem asked
on
Medium Priority
284 Views
Last Modified: 2012-06-27
I have a preloader that I made and I thought I did all the script right but the preloader animation just keeps repeating and it never plays the movie. When i tried to fix it, I got the problem of the preloader animation would play out and the movie would start, but the whole movie wasnt actually loaded so the movie would stop at parts and I would have to click play to make it start again. Any idea what Im doing wrong? This is the script that I have for my preloader:

ifFrameLoaded ("scene 2", 150) {
      gotoAndPlay("scene 1", 32);
      if (_framesloaded<_framestotal) {
            gotoAndPlay(1);
      }
}

I have it so the preloader fades out (at frame 32) and then on the last frame of the preloader (which is in scene 1) there is script telling it to go to and play the next scene (scene 2 which is where the main movie is). I don't know if I've made this hard for myself, but if anyone has a solution to my problem, help would be appreciated. Please let me know if I'm not explaining this clearly.
Comment
Watch Question

Top Expert 2009

Commented:
Hi
first of all, what version of flash are you using?
ifFrameLoaded is from way back prehistoric days, you shouldn't be using it

rather do this

if (_framesloaded >= _totalframes) {
  gotoAndPlay ("scene 1", 32);
} else {
  gotoAndPlay(1);
}

blu
Dushan De SilvaTechnology Architect

Commented:
Another way...

ifFrameLoaded ("scene 2", 150) {
  gotoAndPlay("scene 1", 32);
} else {
  gotoAndPlay(1);
}
Dushan De SilvaTechnology Architect

Commented:
Hi  apriigem,
The way you have implemented logic will keeps in the first frame , until wole frames loaded. But playing preloading...

BR Dushan

Author

Commented:
I am using Flash 8 and I tried both of the solutions suggested above but neither one of them solved my problem. The 1st solution caused the preloader to play through fully once and then nothing else happened. the 2nd solution  caused the preloader to stop right before it ended, and I also got a script error **Error** Scene=Scene 1, layer=PreLoader, frame=30:Line 3: 'else' encountered without matching 'if'
     } else {

For both solution I just replaced the current code I have with what you provided, let me know if I was supposed to do anything else. Thanks!
Dushan De SilvaTechnology Architect

Commented:
sorry about the mistake. Please try following code.

ifFrameLoaded ("scene 2", 150) {
  gotoAndPlay("scene 1", 32);
}
gotoAndPlay(1);

BR Dushan

Author

Commented:
k, I tried the new code, but the same thing happened as the original code I used. The preloader keepes playing and the movie never opens.
Top Expert 2009

Commented:
have u tried my suggestion?

Author

Commented:
yes blue, I tried yours first and that's the one that cause the preloader to play all the way through and then nothing happened, I don't know if the movie ever loaded but nothing showed up on the screen.
Top Expert 2009

Commented:
i stand by my theory, it's the gotoand play scene thing - scenes are dodgy.

Author

Commented:
Ok, I totally agree about the scene thing being dodgy. Do you have any suggestions on another way I might go about doing this, or maybe a tutorial? Thanks for the help.
Top Expert 2009
Commented:
my age old suggestion, remove everything from the scenes, place them on separate swf files and loadMove() to load them into levels.
works much better, makes for smaller file size, better overall runtime performance as well.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks! :-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.