View Full Version : stop movie but not actionScript?
wayneM
02-22-2003, 03:54 PM
I have worked for a week trying to figure this problem out. I just cant get the script right to stop my entire swf after looking at tutorials, help, books, etc.
I have a simple .fla. One scene and one movie clip inside called "textMovie". I made a button that stops the main movie by this script:
on (release) {
_root.gotoAndStop("begin");
}
It works fine to stop the main movie UNTIL the textMovie clip begins playing.
NOW, my problem: The reflected text (from the textMovie actionScript) keeps playing even though my regular text stops after pressing the stop button. I need it all to stop. I will include some of the code for the actionScript below:
i = 1;
alpha = 1;
max = 25;
setProperty("\"/depth0\"", _visible, 0);
while (i<=max) {
duplicateMovieClip("/depth0", "depth" add i, 500-i);
setProperty("/depth" add i, _xscale, getProperty("/depth" add(i-1),_xscale)+i*alpha);
setProperty("/depth" add i , _yscale, getProperty("/depth" add(i-1),_yscale)+i*alpha);
setProperty("/depth" add i, _alpha, 10-i*(.2));
i = i+1;
}
Could you please give me the correct code to stop the entire mc and its action script code. I hope i made myself clear. Thanks
Ricod
02-22-2003, 10:21 PM
Well, you didn't tell your duplicated mcs to stop, so I guess you'll need to include it in your 'stop'-code.
on (release) {
_root.gotoAndStop("begin");
for (i=1; i<25; i++) {
_root["depth"+i].stop();
}
}
wayneM
02-22-2003, 11:48 PM
Thanks Ricod! Works great! I added an "=" sign to i<max to read i<=max and it works great.
One last question? would you mind showing how to have the screen show a blank instead of one of the duplicate movie frames when it is stopped? I want to add a play button, but not sure how to clear the screen completely after the stop button is pressed.
You have been a great help! I am new to actionScript but trying to learn.
Thank you!
Wayne
wayneM
02-22-2003, 11:54 PM
sorry, i meant: i<=25
Ricod
02-23-2003, 12:42 AM
If you just want a blank frame : make a frame with nothing on it and tell _root.gotoAndStop("myEmptyFrame");
wayneM
02-23-2003, 01:18 AM
I did that. it works only for the main movie.
When i hit stop while viewing the movie clip (inside the main movie), the duplicate frame freezes on the screen. I think what it is showing is a part of this: _root["depth"+i].stop();
can you tell me how to remove this and get a blank screen?
thanks,
wayne
Ricod
02-23-2003, 02:12 AM
I believe this would do that (not sure though, as I haven't tried it myself ... ever):
on (release) {
_root.gotoAndStop("begin");
for (i=1; i<25; i++) {
_root["depth"+i].removeMovieClip();
}
}
wayneM
02-23-2003, 08:15 PM
well, I tried it. No success.
when i use the following code it works if i click my stop button twice. any thoughts on how to fix it?
on (release) {
_root.gotoAndStop("begin");
for (i=1; i<=25; i++) {
_root["depth"+i].removeMovieClip();
}
}
on (release) {
_root.textMovie.gotoAndStop("begin");
}
if I dont use the second "on (release)" then something in the background still plays. Your thoughts appreciated. Almost there! thanks again.
CyanBlue
02-23-2003, 08:32 PM
Hm... There's gotta be something else going on in your movie which hasn't been stated in the thread... Care to upload the sample file so that we could take a look??? :)
wayneM
02-23-2003, 08:44 PM
Hi!
I can't post the .fla publicly as it includes dated material for a company sale. However, if you want to email me your email address, I will email the fla to you, and you could post your answer on a thread here. waynematt@adelphia.net.
thanks,
wayne
CyanBlue
02-23-2003, 10:03 PM
Hm... I don't understand this...
_root.gotoAndPlay("begin");
_root.textMovie.gotoAndPlay("begin");
But I do not see any frame label that says 'begin' in the main timeline or textMovie timeline... I feel pretty dumb here... The report says there is a label called 'begin' in frame 13, and yet, the frame number varies every time... I also tried to look for one in the textMovie, but it wasn't there either...
Can you tell me where it is??? What is the effect/action you want to happen when the stop button is pressed??? I am not sure if I understand what you are trying to do here...
Let me know... :)
wayneM
02-24-2003, 01:57 AM
frame name "begin" is in the "buttonstop" layer, frame 12.
I want the screen to stop and go blank. When the play button is pushed, i want it to play from the beginning.
It all works fine EXCEPT when the stop button is pushed while the "textMovie" is playing. (part after the candle cup). It will not leave the screen blank at this point when the stop button is pushed.
wayneM
02-24-2003, 02:32 AM
I believe i got it to work!!! After much trial and error. The code i used is:
on (release) {
_root.gotoAndStop("begin");
}
on (release) {
_root.gotoAndStop("begin");
for (i=1; i<25; i++) {
_root["depth"+i].removeMovieClip();
}
}
Yeah!!! Now, is there a way to use this same code in a button on the web page (html) instead of embedded in the swf? I am using dreamweaverMX.
Thank you for your help. Much appreciated.
wayne
CyanBlue
02-24-2003, 02:39 AM
Check out your inbox... I just sent you an email... Let me know if that's what you are looking for... I've added a couple of comments in the email...
wayneM
02-24-2003, 02:42 AM
I may have spoke to soon. Seems to be something still running in the background, very faint.
also, i would think i should be able to omit the first:
on (release) {
_root.gotoAndStop("begin");
}
as it is a duplication of the second one.
wayne
CyanBlue
02-24-2003, 02:55 AM
Well... I don't see anything moving behind... If it is, it's gotta be 'depth0' whose _visible is set to false...
Let me know...
wayneM
02-24-2003, 02:58 AM
Thanks CyanBlue!
I checked my email. The file is exactly what i wanted to do.
Thanks for the tips too. I will make the changes. Here is the correct code as you and Ricod helped me with:
on (release) {
_root.gotoAndStop("begin");
for (i = 1; i <= 25; i++)
{
_root["depth" + i].removeMovieClip();
}
}
thanks you again for all of your time. I am sure glad you are on the forums.
wayne
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.