Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
ldebono #1
at end entire movie disappears!
I loaded an external movie clip into an empty mc. This movie is one frame and
contains actionscript which slides a mask across the screen masking the layers
beneath. I used "if" and then the x position of the mask to control the
movement. At the end of the script it moves everything back to the original
position and therfore starts again because the the _xpostion.
It works fine by itself but when loaded into the empty movie clip it plays
once through and then everything included the _root movie dissappears and I am
left with nothing but an empty stage. This occurs despite the stop (); at the
end of the _root movie.
(the external movie doesn't have a stop because it its only one frame that
repeats)
///////_root frame 17
_root.onEnterFrame = function() {
_root.createEmptyMovieClip("sliding_mc", 1);
sliding_mc._x = -450;
sliding_mc._y = 41;
sliding_mc._xscale = 100;
sliding_mc._yscale = 100;
sliding_mc.loadMovie("sliding-pics7.swf");
sliding_mc.setMask(slidingMask_mc);
setProperty(sliding_mc, _alpha, 0);
};
/////////_root frame 19
sliding_mc.setMask(slidingMask_mc);
setProperty(sliding_mc, _alpha, 100);
m = sliding_mc._x;
_root.sliding_mc.onEnterFrame = function() {
if (m<=-49) {
m += 100;
setProperty(sliding_mc, _x, m);
}
if (m>=-50 && m<24) {
trace(m);
trace(sliding_mc._x);
m += 15;
setProperty(sliding_mc, _x, m);
sliding_mc.play();
}
};
//////////_root frame 20
stop();
/////////external movie frame 1
_root.onEnterFrame = function() {
i = slide_mc._x;
j = slide_mc2._x;
k = slide_mc3._x;
l = slide_mc4._x;
kogan_mc.setMask(slide_mc.boxMask);
if (i>-882) {
slide_mc._x = i -= 2;
setProperty(buildings_mc, _visible, false);
setProperty(dome_mc, _visible, false);
setProperty(george2_mc, _visible, false);
flagDup = "no";
}
if (i<-880) {
if (flagDup != "yes") {
duplicateMovieClip(slide_mc, "slide_mc2", 0);
setProperty(slide_mc2, _x, -110);
setProperty(buildings_mc, _visible, true);
flagDup = "yes";
}
}
buildings_mc.setMask(slide_mc2.boxMask);
if (j>-881) {
slide_mc2._x = j -= 2;
flagDup2 = "no";
}
if (j<-881) {
if (flagDup2 != "yes") {
duplicateMovieClip(slide_mc2, "slide_mc3", 0);
setProperty(slide_mc3, _x, -110);
setProperty(dome_mc, _visible, true);
flagDup2 = "yes";
}
}
dome_mc.setMask(slide_mc3.boxMask);
if (k>-881) {
slide_mc3._x = k -= 2;
flagDup3 = "no";
}
if (k<-881) {
if (flagDup3 != "yes") {
duplicateMovieClip(slide_mc3, "slide_mc4", 0);
setProperty(slide_mc4, _x, -110);
setProperty(george2_mc, _visible, true);
flagDup3 = "yes";
}
}
george2_mc.setMask(slide_mc4.boxMask);
if (l>-881 && l<-6) {
slide_mc4._x = l -= 2;
setProperty(buildings_mc, _visible, false);
}
if (l<=-880) {
removeMovieClip (slide_mc2);
removeMovieClip (slide_mc3);
removeMovieClip (slide_mc4);
setProperty(dome_mc, _visible, false);
setProperty(george2_mc, _visible, false);
setProperty(slide_mc, _x, -111);
};
};
ldebono Guest
-
How to keep entire movie from looping?
Hi, I'm a newbie here but can't seem to find the answer in the material... I have a flash movie I'm using in one cell of a table. I want to... -
HowTO: re-Scale an ENTIRE flash movie ??
using flash mx; have an fla file developed at 640x480; want to rescale the entire movie down to 160x120. If I try to select all frames in... -
Need to lock entire movie while dragging MC
hello .... I'm using Flash 2004 pro, action script 2.0; While dragging a movie clip, I need to lock the main movie so that event handlers such... -
UDZ9 disappears
I've walked past the UDZ9 store today and it seems like they've closed it. Their website says they've moved to the other side of the city and... -
REGEDIT DISAPPEARS
It really does sound like a virus though, Leonard. Try renaming regedit.exe to regedit.com and see if it will open. -- Patty MacDuffie Windows... -
Jack. #2
Re: at end entire movie disappears!
replace all syntax ( _root. ) with ( this. )
"this" ties code to that timeline.
when you load a movie to a movieclip, the movie that loads thinks
that the timeline of the movie it has loaded into is now the path to _root.
Jack. Guest
-
ldebono #3
Re: at end entire movie disappears!
I tried just replacing the _root (s) on the main timeline to "this" and that
didn't work so I went back to the external moveclip and replaced the the
"_root.onEnterframe" with "this.onEnterframe" and then the movie clip didn't
appear in the main movie at all.
ldebono Guest
-
Jack. #4
Re: at end entire movie disappears!
on Frame 17, you run an onEnterFrame, this action will now be repeated at the
fps of your movie,
for the length of your movie, test this by adding - trace("oef running");
inside of the frame17 function
so you are continually creating a loading clip and loading sliding-pics7.swf
into it,
is this what you intended ?
if not, try -
///////_root frame 17
stop();
createEmptyMovieClip("sliding_mc", 1);
sliding_mc._x = -450;
sliding_mc._y = 41;
sliding_mc._xscale = 100;
sliding_mc._yscale = 100;
sliding_mc.loadMovie("sliding-pics7.swf");
sliding_mc.setMask(slidingMask_mc);
setProperty(sliding_mc, _alpha, 0);
this.onEnterFrame = function() {
if(sliding_mc._width > 0){ // swf has loaded
play(); // to _root frame 19
delete this.onEnterFrame;
};
if ( none of this works ) { outOf_Ideas.stop(); };
Jack. Guest
-
ldebono #5
Re: at end entire movie disappears!
Nope. Didn't work. But what i did figure out is that the part that is causing
the movie to disappear is at the end of the external movie clip. I took out
the part that said to remove the slide_mc 's and the movie just stopped at the
end instead of disappearing. I'm thinking that it does have something to do
with the fact that i refered to "_root" in the external movie clip but when I
change it to "this" the movie doesn't play in the main movie but it does when
the file is played by itself. I also took the the onEnterframe out of the 17th
frame because it wasn't neccessary. It played the same after that. I just
can't figure out why the movie won't play when I say "this.onEnterframe"!
ldebono Guest
-
Jack. #6
Re: at end entire movie disappears!
I can only suggest that you plaster traces throughout your movies,
you can now see in the output window if things are occuring as planned,
for example -
this.onEnterFrame = function(){
trace("main timeline frame no. is - "+this._currentframe)
}
Jack. Guest



Reply With Quote

