I'm loading in separate external swf's with the script
on (release) {
loadMovieNum ("moviename.swf", 2)
}
so, loading a movie into level 2, if for example i load another swf into the same level 2 what is the script so i can make a smooth transition from the previous swf already loaded in level 2 to the new swf going to load in!
I understand that there would be a animation to fade out in the already loaded swf, but once the anim is loaded out how do I than call in the next swf!
for an example of what I mean, cos even I'm getting a little confused, please check this link out an see how the different movies load in
You can't just load something on top of something else and expect Flash to do the fading.
In Flash you have a bunch of very simple tools, it's up to you to put them together and make your ideas come true.
In this case I would rather use:
PHP Code:
movieClip.loadMovie('myMovie.swf');
Because by loading a movie onto a MovieClip you gain a much better controll over everything.
To do any sort of blending or, like in the link you gave, a preloading of the movie, you nead to work with different things at the same time.
For the fading you will need:
1) an empty movieclip as container #1;
2) an empty movieclip as container #2;
3) a script (with a series of handlers) that manages preloading and fading, which will be assigned to a third movieclip;
Building this sort of functionalities from scratch is pretty complex for a newbye, you should look around in the FlashKit sample Fla's section to see if you can find something suitable to start from.
Hope this helps!
Altruism does not exist. Sustainability must be made profitable.
I think I might of made it more complicated than need be, does this make any sense
I'm loading in and out external swf's a button action
what I'm trying to do is:
once one movie(movie1.swf) has loaded into level 2, I want to load(on a different button press) another movie into the same level, but some how when the movie2 button is pressed, make the outro anim in movie1.swf playout. does this make any sense?? going slightly mad : (
example of what I'm trying to do: http://www.thecreativepulse.com/home05.htm
click on some of the drop down links and you will how they work! its like there is a scipt on each button telling it to play out the timeline anim in the movie already loaded before loading in new movie selection??
so I think I would need:
1.script on button all buttons, some how sayin go to a specific frame in the already loaded movie once played out the outro, load in the selected movie!
2.then some script at the end of the outro anim to load selected movie!
does this make sense, for the end frame of outro anim
onEnterFrame = function(){
level0._root.loadMovieNum("moviename2.swf", 2)
}
this would just load in movie2.swf everytime??
but what if, lets say movie8 button was pressed, would this have to be on the actual button not the frame
Anyway, yes you could achieve a nice effect by using a single loading container.
I would anyway advise you to use loadMovie() instead of loadMovieNum().
Anyway, you would need to do something like this:
The main movie has the buttons and the function that loads a new movie.
The movies to be loaded contain the exit animation and at their last frame have a call to the function that loads a new movie from the main movie.
In other words, the last frame of the exit animation of a loaded movie will have the following code, given that it's in the FRAME ACTIONS of the main timeline:
Code:
_parent.loadNewMovie();
At this point each button will have the following code:
Code:
on(release) {
initMovieLoad('path_to_new_movie.swf'); // you must put your paths to movies to be loaded
}
The two functions would be as follows:
Code:
function initMovieLoad(path) {
movieToBeLoaded = path;
if(!initializedExternalMovies) {
initializedExternalMovies = true;
loadNewMovie();
} else {
pathToContainer.gotoAndPlay('exit'); // the loaded movies need to have a frame labeled "exit", which will be the first frame of the out animation
}
}
function loadNewMovie() {
pathToContainer.unloadMovie(); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
pathToContainer.loadMovie(movieToBeLoaded); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
}
Hope this helps!
Altruism does not exist. Sustainability must be made profitable.
on(release) {
initMovieLoad('path_to_new_movie2.swf');
}
etc!!
so all the movies are put in here^^^^example, is this correct
ok if what I just type above is correct, I'm down wi that, But : )
whats this two function thing, where does this go....Oh! I see, I think...does this go in the main movie in the first frame???
function initMovieLoad(path) {
movieToBeLoaded = path;
if(!initializedExternalMovies) {
initializedExternalMovies = true;
loadNewMovie();
} else {
pathToContainer.gotoAndPlay('exit'); // the loaded movies need to have a frame labeled "exit", which will be the first frame of the out animation
}
}
function loadNewMovie() {
pathToContainer.unloadMovie(); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
pathToContainer.loadMovie(movieToBeLoaded); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
}
Movieclip used as a container??
this is throwing me abit dude, what is this??
Well what we are trying to do here is load external movieclips into MovieClip instances.
In that case, the movieclip we load an external movie onto, can be referred to as the "container movieclip".
When you load a movie onto a movieclip, what is the main timeline in the loaded movie, takes the place of the timeline in the movieclip you loaded the movie onto.
So if you load movie 2 into _root.myClip of movie 1, what you refer to as _root inside movie 2 (if you launch the movie by itself), will be _root.myClip when you load it in.
This is to say that actionscript paths have to be though of before! When you use absolute paths (paths that are relative to the _root), you must be very carefull, because when that movie is loaded into another one, the _root will be that of the main movie now, making the absolute paths in the loaded movie fail!!
In these cases you use relative paths (which start from the point where the code is executed).
I know it's confusing, but you really have to play around and discover things. It will take some time and effort, but you need to gather some control over these basic concepts. They are all simple, the messy part is fixing them together
You can either create a little box, select it, press F8, give it a symbol name and create a MovieClip symbol, select it again, give in an INSTANCE NAME from the properties inspector, then double click on it (entering it), selecting the box and deleting it, then clicking twice anywhere to get out of it, back onto the main timeline.
(All this to create an EMPTY movieclip).
Or you can use the following code:
Code:
var mc:MovieClip = this.createEmptyMovieClip('instanceName', this.getNextHighestDepth());
mc._x = 100; // an example of how you can easily set attributes for the new movieclip using the reference variable "mc"
Anyway what you said looks all correct.
Altruism does not exist. Sustainability must be made profitable.
ok I'm with that, seems a little strange, so having an empty movieclip in the main movie on the scene we than load the external swf into this empty movie clip! is this correct???
one other thing;
where you say change pathToContainer to the INSTANCE NAME of the empty movieclip used as container, I called my empty movie clip 'tech' so would the script go like this then VVV
function initMovieLoad(path) {
movieToBeLoaded = path;
if(!initializedExternalMovies) {
initializedExternalMovies = true;
loadNewMovie();
} else {
pathToContainer.gotoAndPlay('exit'); // << N.B do I need to change PathToContainer here also??
}
}
function loadNewMovie() {
tech.unloadMovie(); //<<<<is this correct ????change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
tech.loadMovie(movieToBeLoaded); // <<<<is this correct ????change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
}
I seem to have got so much working but what happens is this!
the first button loads in the first movie, when i click the second but to load in the second movie, it plays out the outro from the first movie but then just keeps playing the first movie not the second, I put a Stop() also at the end of the outro anim but, it just stop : )
I've attached demo files!
one major question! how do I know what level the external.swf's are loading into??
attached fla files:
1.tester(main movie)
2. technology
3. how
I named the container 'monkey'
I used the 'about section' - buttons 'technology' and 'how it works'(with the script on)
You should take a tour of the Flash developer centre (from the http://www.adobe.com/ website.
It will shed light on a few very important things you need to know about flash.
Flash has been packed with limitations and restrictions, that vary in relation to the execution environment, to mantain a good level of security (the idea is to prevent lame programmers to develop malware based on the Flash technology).
Altruism does not exist. Sustainability must be made profitable.
I've just tried thats and now nothing seems to happen?? is this correct
on frame:
function initMovieLoad(path) {
movieToBeLoaded = path;
if(!initializedExternalMovies) {
initializedExternalMovies = true;
loadNewMovie();
} else {
monkey.gotoAndPlay('exit'); // the loaded movies need to have a frame labeled "exit", which will be the first frame of the out animation
}
}
_global.loadNewMovie() {
monkey.unloadMovie(); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
monkey.loadMovie(movieToBeLoaded); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
}
function initMovieLoad(path) {
movieToBeLoaded = path;
if(!initializedExternalMovies) {
initializedExternalMovies = true;
loadNewMovie();
} else {
monkey.gotoAndPlay('exit'); // the loaded movies need to have a frame labeled "exit", which will be the first frame of the out animation
}
}
_global.loadNewMovie = function() {
monkey.unloadMovie(); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
monkey.loadMovie(movieToBeLoaded); // change pathToContainer to the INSTANCE NAME of the empty movieclip used as container;
}
Altruism does not exist. Sustainability must be made profitable.
You didn't tell me that the links to external movies were from your server...
Anyway, you didn't do all the changes.
Here is a working set of files. Remember to change the links, from the BUTTONS actions, to what you want them to be (as they are, they will work as long as the swf files are all in the same directory).
Ciao!
p.s. the file is a .rar, but the lame restrictions of this open source forum framework don't let me send it as a Rar file!
Altruism does not exist. Sustainability must be made profitable.
yeah I uploaded two files to the server and put the absolute path, doh!
cheers for the files will have a look this morning, just gotta pop out for a couple of hours so will be back on late morning will let you know how it goes
I have two how to question about the same main fla. now that we've got the loading of the movies working how do I then;
1.on the main movie go to the 'exit' anim so it does the same thing as it does with the external files.
2.how can I specify what level for the externals to load into?
attached is the main fla, you will see first layer I have created an outro anim at frame 62 and labeled it 'exit' would this work different as we would still want the navigation to be there and not disappear when the other movies load in??