all groups > flash actionscript > march 2004 >
You're in the

flash actionscript

group:

swf won't stop playing?!!


swf won't stop playing?!! Projectionist
3/29/2004 11:19:53 PM
flash actionscript:
Hello I have an external movie that I am player in another swf.
I would like to stop the swf when its sequence finishes but it just seems to
stick around and not finish. I.e when the movie is done it dosn't dissapear in
the other movie clip. I know this should work because my other swfs work fine.
The difference with this one is that it has a control bar inside it that is
used to rewind, fast forward, ect.

I am not sure how to unload this clip inside the file itself. I cannot change
the script in the main swf though this needs be done from the external file
(the one with the control bar that is being loaded into the main movie).

Here is the script from the external swf with the control bar that is being
loaded in. Any ideas?
Frame Actions:

_parent.stop();
faderbackground._width = width;
looping = false;
playing = false;
top = knob._y;
bottom = knob._y;
left = knob._x;
faderWidth = faderbackground._width-knob._width;
segmentWidth = faderWidth/_parent._totalframes;
right = knob._x+faderWidth-segmentWidth+1;
faderbackground._width -= (segmentWidth-1);
with (backing) {
_width =
Math.abs(_x)+faderbackground._width+((_height-faderbackground._height)/2);
shadow._width = _width;
}
_parent.onEnterFrame = function() {
if (_parent._currentframe == _parent._totalframes && !looping) {
playing = false;
_parent.stop();
}
if (dragging) {
playing = false;
_parent.gotoAndStop(Math.ceil(knob._x/segmentWidth));
} else {
knob._x = (_parent._currentframe*segmentWidth)-segmentWidth;
}
//
playhilite._visible = playing;
loophilite._visible = looping;
//
};
//
// playback controls
loop.onRelease = function() {
loophilite._alpha = 100;
};
loop.onPress = function() {
looping = !looping;
loophilite._alpha = 0;
};
playButton.onPress = function() {
playhilite._alpha = 0;
};
playButton.onRelease = function() {
playhilite._alpha = 100;
playing = true;
_parent.play();
};
playButton.onDragOut = function() {
playhilite._alpha = 100;
};
playButton.onDragOver = function() {
playhilite._alpha = 0;
};
stopButton.onRelease = function() {
playing = false;
_parent.stop();
};
rewind.onRelease = function() {
playing = false;
_parent.gotoAndStop(1);
};
stepBack.onRelease = function() {
playing = false;
_parent.prevFrame();
};
stepForward.onRelease = function() {
playing = false;
_parent.nextFrame();
};
goToEnd.onRelease = function() {
playing = false;
_parent.gotoAndStop(_parent._totalframes);
};
knob.onPress = function() {
_parent.stop();
startDrag(knob, false, left, top, right, bottom);
dragging = true;
};
knob.onRelease = function() {
stopDrag();
dragging = false;
};


Re: swf won't stop playing?!! rlc5611
3/30/2004 3:04:27 AM
AddThis Social Bookmark Button