I have a movie with two squares. Depending on which button is pressed, the demmensions of the both squares change for which I used the following function:
function scaleMoveClip(clip, breed, hoog, xpos, ypos, snelheid) {
clip.onEnterFrame = function() {
eindX = xpos-this._x;
this._x += eindX/snelheid;
eindY = ypos-this._y;
this._height += eindHoog/snelheid;
eindBreed = breed-this._width;
this._width += eindBreed/snelheid;
eindHoog = hoog-this._height;
this._height += eindHoog/snelheid;
if (Math.abs(eindBreed)<2 && Math.abs(eindHoog)<2) {
this._width = breed;
this._height = hoog;
delete this.onEnterFrame;
}
};
}
This is the code on button home:
btn_service.onPress = function() {
scaleMoveClip(mainVlak, 350, 350, 575, 325, 4);
scaleMoveClip(subVlak, 300, 350, 250, 325, 4);
};
and this is for example the code on button service:
btn_service.onPress = function() {
scaleMoveClip(mainVlak, 450, 450, 500, 325, 4);
scaleMoveClip(subVlak, 250, 450, 175, 325, 4);
};
The code for the other buttons is the same but with other arguments. Now do I also need to integrate a loadMovie in the different button actions, to load the different ext.swf’s in a container on the stage, but I only want the swf’s to load after the callback is finished (when the squares qre not moving any more) How does the loadMovie should look like?
Thanks in advance