PDA

View Full Version : loading preloader


javone
05-07-2003, 05:10 PM
because iam new to this **** i have that is very simple but i didnt
found tutorial to do it it goes like that
example:we have a website and when you enter from an html window it goes loading then intro and comes the menu
how can i script it to load only until the menu and when you want to go to a new section its again loading for the next section its
a silly question.:)thank you for your time.

pellepiano
05-07-2003, 05:44 PM
You can not stop loading a swf. What you can do is make separate swf's of your different sections and load them only when needed ( into your main file).
You do that with the loadMovie action. Heres some alternatives.

///////LOAD MOVIE

There are two ways of loading external files into Flash. Either you can load swf files into _levels or into movieclip targets.

_levels only exist in the Flash player. They are like layers but for swf files The Flash player is like a overhead projector where the plastic films you put on top of each other are like the swf files in the player. There are 16000 available levels

//To load a external swf into a _level from a button. The number 1 being the level to load into.

on(release){
loadMovieNum("myExternalFile.swf",1);
}

Movieclip targets are what it sounds like. A empty movieclip placed on the stage just for the purpose of loading a swf file into it. The advantage is that you can place it anywhere, manually ( as opposed to swf's in _levels) and also can control what othe objects shoeld be on top or beneath.

Usually you give the movieclip an instance name of container.

//To load a external swf into a target movieclip from a button ( both being on the main timeline ).

on(release){
container.loadMovie("myExternalFile.swf");
}

javone
05-08-2003, 06:42 PM
thanks man:)
eehh and another thing do you where can i find a tutorial how to make a player to play music in the website.
thank you.

javone.....

pellepiano
05-08-2003, 09:30 PM
If you use swf's with songs in them you can load them with load movie. If they are set to stream they will play right away.
You adress the music swf by referring to the movieclip or _level you loaded it into.
Heres ssome info why things can go wrong when trying to adress things.

Most common cause of errors are path problems.
Having a button in another timeline than the target movieclip will make above code give an error as the button looks for the movieclip in the timeline where the button is. It comes rather natural to mention both city and street adress when writing a letter. If the recipient moves we are not surprised that when writing again we have to change the city adress. All objects in Flash have adresses, relative or absolute.
If you have your button in a movieclip and want to reference the main timeline where the containe movieclip is..

on(release){
_root.container.loadMovie("myExternalFile.swf");
}

or......

on(release){
_parent.container.loadMovie("myExternalFile.swf");
}

_root means the main timeline and _parent means the timeline above the current one (which in this case are the same). The first one is absolute and the other relative.

In Flash you can target anything from anywhere.

on(release){
_level45.movies.container.loadMovie("myExternalFile.swf");
}

....will load a external swf into movieclip "container" that is inside movieclip "movie" in level 45.

javone
05-09-2003, 12:05 PM
thank you for the tips but i meant a tutorial on how to make a music player in the swf how to do the buttons for player and stuff like this.
bythe way i visited your website its very nice simple and beautiful
you are a graphic designer or something
i have a problem how to put some buttons in a clip like yours when your webpage starts your buttons dont come in
and the loading bar how do you do it man you know the design
and coding....

thank you
javone

pellepiano
05-09-2003, 12:38 PM
Unfortunately I dont know any tutorial on this.
But if you have a specific question I'll be glad to answer.

linckx
05-09-2003, 12:50 PM
I don't exaclty know where to find such a tut, but be sure to check this site's tutorials section.

friendly greetings
robin

javone
05-10-2003, 04:54 AM
ok...how did you do your buttons in your website the ones which come up. the coding i mean because i want my buttons in my website to come from somewhere and stop and then put and some easing to be more realistic.
so if i understood correctly on previous tips you gave i must make separate swfs for every section of site and in the buttons put url to go to the server and download the next section and the preloader is with every section.

pellepiano
05-10-2003, 10:46 AM
The "button" are movieclips with a button inside. Thats how they can move with scripted motions
The code to make them move is.......

onClipEvent (enterFrame) {
// MOVING SCIPT PART
var speed = 8;
var viscosity = 1.5;
xpos =350;
//X Pos
difference = xpos-this._x;
xvelocity = (xvelocity+(difference)/speed)/viscosity;
this._x += xvelocity;
}

Its the xpos =350; that set the destination. The code should be put ON the movieclip.

And yes, I load each section (swf) separately and only when needed. They have teir own preloader in them.
Note that when loading into _levels preloaders usually works just fine but when loading into target movieclips things can go wrong. If your preloader references the _root it will mean the main timeline of the host swf, so changing _root to _parent would be advised. ( loaded swf's are treated as the movieclip they are loaded in to and movieclips dont have a _root).

javone
05-11-2003, 12:11 PM
ok but instead of putting this code cant you put the but in videoclip and tween it and put a stop at the end.
bytheway i visited a website www.kmx-designs.de (http://www.kmx-designs.de) i got curious how did hi\e do the buttons like that and the kmx logo. check it out you know better.

javone
05-11-2003, 12:17 PM
and something else how can you put effects in a button on rollin and rollout something like thatwhen you are above the button it slowly lights up and when the cursor leaves it slowlydarkens

pellepiano
05-11-2003, 01:00 PM
Yes you could tween it as well, but you asked for the code and thats what I use.

The KMX logo seems to be made in Swift3d ( a 3d program that can export to swf format ).The light effects on it is a mask on the letters and underneath a transparent graphic with holes in it with soft edges ( thats how I would do it anyway).

You can not get rollOut animations with a normal button. Heres a brief description.

////////RollOut Movieclip

You make a movieclip with your different animations. To control what animation ( part of movieclip timeline) should play you make a invisible button ( just histate defined) and put it inside the movieclip.
Make a framelabel called rollOverAni at the start of your mouse over animation and then a framelabel called rooOutAni at the start of you roll out animation.
Then on the invisible button

on(rollOver){
gotoAndPlay("rollOverAni");
}
on(rollOut){
gotoAndPlay("rollOutAni");
}

Also have a stop action in the first frame of the movieclip.

javone
05-12-2003, 05:30 PM
didnt knew that thanks. :) with this code i can make buttons and when you are over it somewhere in the clip will come some letters or anything else with alpha and when you are not on top of the button it faints with alpha again is that right?
do you have email so i can send you a project iam working and you wiil understand why i was asking about buttons and stuff like this.. and give me advice and thoughts...

thank you ...