View Full Version : loading/unloading movie problem (MX)
catseyes4U
October 25th, 2003, 07:13 PM
hello,
i have a little problem (not so little for me) with laoding movies:
on the main movie, i have a button which loads a movie with
the following script:
horta.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("03_horta.swf", "container");
container._x = 0 ;
container._y = 210 ;
}
and another button which loads:
olot.onPress = function () {
_root.createEmptyMovieClip("container", 2);
loadMovie("03_montsacopa.swf", "container");
container._x = 0 ;
container._y = 210 ;
}
it loads the first one perfectly, the second one too, but then, i
can't see the first one again...
i guess the problem is about levels. i tried several thing but it's not working...
can someone help please?
kode
October 25th, 2003, 07:32 PM
this.createEmptyMovieClip("container", 1);
container._y = 210;
horta.onPress = function() {
container.loadMovie("03_horta.swf");
};
olot.onPress = function() {
container.loadMovie("03_montsacopa.swf");
};
?? :P
catseyes4U
October 25th, 2003, 07:58 PM
thanks, i tried with the code you gave me (but instead of "this", i had to put "_root" otherwise it was not working at all...) but the problem is still the same: i can't see again the first movie... any suggestion else, please?
(i'm really very new at as...)
kode
October 25th, 2003, 08:20 PM
Uhmm... attach your FLA. :stunned:
catseyes4U
October 26th, 2003, 08:24 AM
hi, here is the fla (with swf and font). the code is the one i manipulate from the kirupa tutorial. actually, when i did the tutorial, no problem, but i think it's because i was working with only one scene; but my project have more then one...
thank you in advance for helping
Voetsjoeba
October 26th, 2003, 08:42 AM
Which buttons load your swfs ?
catseyes4U
October 26th, 2003, 10:38 AM
if you go to "estudios" and choose one project, the button which loads movie is on the inferior right side (like a squarre), below the scolling text, called "ver imágenes"
Voetsjoeba
October 26th, 2003, 11:06 AM
1) Delete all the keyframes in the "movieclip" layer.
2) Create a new movieclip (CTRL+F8), give it any name, press ok.
3) Open the library (F11), and drag the movieclip you just created to the stage in the "movieclip" layer. It should be present over the entire timeline.
4) With the movieclip selected, open the Info Panel (CTRL+I), and set the x and y positions to 0 and 210.
5) Give the movieclip the instance name "container".
6) Use this for each button code:
button.onPress = function () {
container.loadMovie("yourswf.swf");
}
:)
catseyes4U
October 26th, 2003, 11:46 AM
if i assign the code you gave me to the button, i get synthax error message and if i set it to the "acciones load" layer, it loads the first movie i check but not the other two...
Voetsjoeba
October 26th, 2003, 11:56 AM
Hmn, I must've forgotten to tell you something. Anyways, here's my version: http://www.voetsjoeba.com/stash/main-menu.fla
catseyes4U
October 26th, 2003, 12:09 PM
i tried with the fla you linked and it's still not working: i can load one movie, a second one, but not the thrid and i can't watch the first one again...
thank you for the help anyway and if you get inspired to do it in another way, i'll be very thanksfull to know it...
Voetsjoeba
October 26th, 2003, 12:35 PM
I see it now. You have a bad structure in your file. You don't go to the frames where the onPress handler is set. After you've pressed a first button, you always go to olot2, pfc2, but on those frames the handlers aren't defined.
I've fixed it, so download again from the previous link, I'll update the file.
catseyes4U
October 27th, 2003, 06:24 AM
thank you SOOOOOO much! i works great!
Voetsjoeba
October 27th, 2003, 06:40 AM
No problem :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.