Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Flash preloader keeps playing but wont start movie.

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.
0
apriigem
Asked:
apriigem
  • 5
  • 4
  • 3
1 Solution
 
blue-genieCommented:
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
0
 
Dushan De SilvaTechnology ArchitectCommented:
Another way...

ifFrameLoaded ("scene 2", 150) {
  gotoAndPlay("scene 1", 32);
} else {
  gotoAndPlay(1);
}
0
 
Dushan De SilvaTechnology ArchitectCommented:
Hi  apriigem,
The way you have implemented logic will keeps in the first frame , until wole frames loaded. But playing preloading...

BR Dushan
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
apriigemAuthor 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!
0
 
Dushan De SilvaTechnology ArchitectCommented:
sorry about the mistake. Please try following code.

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

BR Dushan
0
 
apriigemAuthor 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.
0
 
blue-genieCommented:
have u tried my suggestion?
0
 
apriigemAuthor 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.
0
 
blue-genieCommented:
i stand by my theory, it's the gotoand play scene thing - scenes are dodgy.
0
 
apriigemAuthor 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.
0
 
blue-genieCommented:
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.
0
 
apriigemAuthor Commented:
Thanks! :-)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now