Hey my fellow Actionscripters,
I had someone who was helping me with this but apparently is now too busy to help me at all
It is regarding the function described in the first section of this: [color=#333333]http://www.actionscript.org/actionsc…ieclip_Object/[/color] called “Smooth motion”.
What it’s supposed to do is in a full screen flash site when the browser or window is resized the targeted movieclip will automatically move to a position / or center itself in the screen with a smooth easing motion to it.
I’m wanting to the center the MC and only on the X axis (horizontally, don’t need the mc to move up or down) but i’m having troubles getting this function to work at all
i’ve got this saved in an external AS file:
<script>function rubberBandMeX(myTarget, XPos, threshold, centerMe){
if (centerMe == true){
XPos = XPos - (myTarget._width / 2);
YPos = YPos - (myTarget._height / 2);
} else {}
if (myTarget._x > XPos){
XSpeed = (myTarget._x - XPos) / threshold;
myTarget._x -= XSpeed;
}
if (myTarget._x < XPos){
XSpeed = (XPos - myTarget._x) / threshold;
myTarget._x += XSpeed;
}
}
</script>
and I have an #include in the root file i need to use this function in
how do I correctly call the function from the external AS? I had this working at one point but even then i had a problem aswell with the speed of the motion and stuff but hopefully we’ll get to that after i get this thing working ![]()
So anyone can offer some help or post a working example that I can use i would appreciate it immensely.
Thanks!!