View Full Version : ? Find centre of movie
The_Vulcan
September 26th, 2003, 10:12 AM
How do you find the center of a movie that has has been loaded by loadMovie();
This is the method I was using, but now that it is in a .swf that has been loaded it's stoped working
xcenter = box._x + ( box._width /2);
ratbaggy
September 26th, 2003, 08:54 PM
it's not just a matter of changing 'box' to 'this' and placing that on the MC is it?
claudio
September 26th, 2003, 09:20 PM
this.createEmptyMovieClip("temp", 1000);
temp.onEnterFrame = function() {
if (container_mc._url != this._parent._url) {
trace("center coordinates: x="+container_mc._width/2+" y="+container_mc._height/2);
this.removeMovieClip();
}
};
my_button.onPress = function() {
container_mc.loadMovie("yourmovie.swf");
};
The_Vulcan
September 26th, 2003, 10:08 PM
Thanks again as always claudio.....
I will give it ago....
I have never used trace b4 not even sure what it is used for but I will try find out.....
thanks again..
claudio
September 26th, 2003, 10:27 PM
welcome :beam:
and trace(expression) displays the value of expression in the Output window.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.