-
Senior Member
Seperate parts of movie
I got a main movie that shows a basic text.
But I got a menu that consist of three parts, home, links and form.
I made home, links and form on the same scene as the main movie and identified them with frame labels.
Now what I want is that when U go to home, the movie preloads the part home, if u go to links, it has to preload links etc.
How can I achieve this?
And I was thinking that maybe I should make for each part a seperate MC and let it be preloaded when u go to it. Isn't that a better way then using frame labels? But I don't know for sure how I should define in actionscript then how I could let the preloader begin after u hitted the button.
Can anybody help me with that?
-
Senior Member
I dont get it.
Do you load external swf files? If so put a preloader on those.
If not why, a preloader on something that is loaded anyway.
-
Senior Member
Yeah, I want to load external SWF
Is that a good idea ?
And how do I do it ?
-
Firstly, it depends on how big your SWF file is ... if all three sections are 200Kb, then I would just use one preloader at the start and forget about loading them all individually.
If each section is quite large, you might think about making a navigation SWF, and a separate SWF file for each section. The navigation SWF would be the main movie (loaded by default in LEVEL 0), and within this SWF you would have buttons with these actions:
Code:
// for the HOME section button:
loadMovieNum("home.swf",1);
// for the LINKS section button:
loadMovieNum("links.swf",1);
// for the FORM section button:
loadMovieNum("form.swf",1);
When you click a button, the relevant movie is loaded into LEVEL 1. When you click another button, the new movie replaces the movie in LEVEL 1.
The only other thing you need to do to make it all run smoothly is to add this line of code in frame 1 of the navigation movie:
Code:
loadMovieNum("home.swf",1);
That will start the home SWF loading as soon as you go to the site, rather than waiting until someone click the button for it to happen.
I understand all this can be very confusing, so if you need to ask more questions feel free - I'll keep answering as many as I can.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
Ok, but where is the swf then placed?
Will it just be centered or what?
-
Senior Member
PS can u do this for me ?
Can U check wether the preloader works cus my connection is too fast so the preloader is skipped
Cus I know I have to put a stop(); action somewhere but I forgot where.
Maybe in the second frame where the whole
totalFrames = _root.totalframes bull**** is
or where the
(if framesloaded == totalframes) crap is
http://users.pandora.be/Incubusattax/Main_movie.html
-
Yes - if the new SWF is the same size as the old one it will be placed centrally. What I suggest you do is make the navigation SWF with its content where you want it (presumably on the left side), then make the content SWFs so that when they are placed directly on to of the navigation SWF they don't overlap it.
As for checking your preloaders, sorry - I have the same problem (if you could call it that!) here. Fast connection ...
When you test your movie in Flash using the CTRL+RETURN keys, press CTRL+ENTER again when the SWF starts to play - that will emulate a 56k modem speed, and you should be able to tell if it's working or not.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
Ok, I'm going to try that and work it out, and if i have another question, I'll just post it here.
And thank you very much man !!
P.S. : I'll give u a sneak preview later on
-
Senior Member
Great, now the preloader doesn't work dammit.
This is how I've done it.
Code:
Frame 1 = blank
Frame 2 :
framesLoaded = _level0.framesloaded;
totalFrames = _level0.totalframes;
percentLoaded = Math.round ((framesLoaded/totalFrames)*100);
bar._xscale = percentloaded;
Frame 3 :
if (framesLoaded == totalFrames) {
gotoAndPlay ("start");
} else {
gotoandPlay("preloaderloop")
}
Maybe u see whats wrong ...
-
Code:
Frame 1 = blank
Frame 2 :
framesLoaded = _level0._framesloaded;
totalFrames = _level0._totalframes;
percentLoaded = Math.round ((framesLoaded/totalFrames)*100);
bar._xscale = percentloaded;
Frame 3 :
if (framesLoaded == totalFrames) {
gotoAndPlay ("start");
} else {
gotoandPlay("preloaderloop")
}
Just missing a couple of underscores ... code above should work.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
Thx, small mistakes make a huge impact
But the problem of the preloader is still present.
I get first a white screen and then after a certain time I get the site.
Is it maybe that my preloader contains an image ?
Last edited by Camme; 07-10-2003 at 08:21 AM.
Penguins in the dessert
-
Senior Member
this is the file maybe u can take a look at it ...
http://users.pandora.be/Incubusattax/Main_movie.zip
-
I don't have Flash on this machine ... sorry!
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
DARN !!
Well I'll try to explain what I did then :
I made a bar and the filling I gave instancename bar.
I putted the bar on x:0,y:0
I left the first frame blank.
The second frame has the bar and a small message loading.
The code from the second frame is the one you have above here
The third frame has the bar too and the loading message and the code from above. Plus the framelabel start.
Oh yeah the second frame has label preloaderloop.
The start is a fade out of the bar and then a goptoaction to the next scene
-
Senior Member
Try it again :
http://users.pandora.be/Incubusattax/Main_movie.html
I added a 1.2 Mb bmp (trust me, it's a really nice pic )
-
I looked at the FLA when I got home. I think your main problem arises from the fact that you are using framesLoaded, instead of bytesLoaded (this gives a much smoother and constant feedback). Also, because you had everything lumped in on top of each other, some of the bits weren't working.
Look at the attached fixed file and see what you think.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
thx man , it works, but what did I do wrong ?
-
Like I said, you used framesLoaded instead of bytesLoaded (this gives a much smoother and constant feedback). Look at the code in the version I sent you, then look at the code in your original version - you will be able to see the differences.
Also, I reset the xscale of the preloader bar physically as it sits on the stage (it's now set to 1% of its original size). This just means that you don't get a flicker at the start, when the bar is 100% of its size but BEFORE lash has had a chance to work out what size it should be.
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
-
Senior Member
ok, THANK YOU VERY MUCH MAN !!!
Now I'm going to try some page transition effects for the site, maybe if u know a good one
-
Not a problem - make sure you send me a link to the finished site!
----------
"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|