# Adjusting window with inertia?

**URL:** <https://forum.kirupa.com/t/adjusting-window-with-inertia/20218>\
**Category:** Uncategorized\
**Created:** [May 6, 2003, 3:45pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218 "2003-05-06T15:45:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zephn](https://avatars.discourse-cdn.com/v4/letter/z/5f8ce5/32.png) [@zephn](https://forum.kirupa.com/u/zephn)\
**Post date:** [May 6, 2003, 3:45pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/1 "2003-05-06T15:45:19Z")

</div>

[http://www.twinphotographie.com/](http://www.twinphotographie.com/)  
The portfolio found on this page is very attractive to me as I have mnay photogrpahs with different crops.  
I would like to be able to create a window that would shift to adjust to my pictures size. Can anyone point me to a thread or a tutorial regarding this or to explain the concept a little? I could not find it in search.  
Thanks  
Andrew

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 6, 2003, 4:31pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/2 "2003-05-06T16:31:03Z")

</div>

[www.zephn.com/slidewindow.zip](http://www.zephn.com/slidewindow.zip)

this is my attempt at trying this but there should be a more efficient way of doing it don’t you think?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 6, 2003, 4:53pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/3 "2003-05-06T16:53:40Z")

</div>

I have an example of this, I even wrote a detailed description of how this works back at were-here (back in the day)  
anywho, this is what Ive done as an example in the past:  
[http://www.umbc.edu/interactive/fla/scaler.swf](http://www.umbc.edu/interactive/fla/scaler.swf)  
[http://www.umbc.edu/interactive/fla/scaler.fla](http://www.umbc.edu/interactive/fla/scaler.fla)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 6, 2003, 4:55pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/4 "2003-05-06T16:55:30Z")

</div>

coolio thanks senocular i knew there was a more efficient way!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2003, 1:42pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/5 "2003-05-07T13:42:20Z")

</div>

hey senocular… I was trying to break down how the formula on the movie clip worked and I’m confused…

onClipEvent(load){  
easeSpeed = 5; // the higher, the slower  
target\_xscale = target\_yscale = 100;

onClipEvent(enterFrame){  
\_xscale += (target\_xscale - \_xscale)/easeSpeed;  
\_yscale += (target\_yscale - \_yscale)/easeSpeed;  
}

the part i’m confused about is the expression  
\_xscale += (target\_xscale - \_xscale)/easeSpeed;

Above you have stated that \_xscale is equal to 100  
in the below expression you open \_xscale up to be a new value but the calculation includes what x is.

xscale =( xscale - xscale ) / easespeed + xscale

thats what i see.  
to further break down what i see it is  
xscale = (100 - 100) /5 +100 or 100

OK OK i just reread what I typed and this makes sense to me after typing it out because you need to maintain the proportion of xscale every (enterframe).  
But I’m still wondering how the ease is occuring.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2003, 1:45pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/6 "2003-05-07T13:45:35Z")

</div>

also why wouldn’t you just make the  
xscale = (100 - 100) /5 +100 or 100

xscale is = to xscale

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 8, 2003, 7:04pm UTC](https://forum.kirupa.com/t/adjusting-window-with-inertia/20218/7 "2003-06-08T19:04:04Z")

</div>

Senocular,

I´ve downloaded your scaler file and took a look at the code.  
i´m trying to change the code to make it change the position instead of scale. How do I do it?

Thanks
