# Problems with elastic samples from Kirupa website

**URL:** <https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971>\
**Category:** Uncategorized\
**Created:** [September 12, 2004, 2:07am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971 "2004-09-12T02:07:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![OM2](https://avatars.discourse-cdn.com/v4/letter/o/3ab097/32.png) [@OM2](https://forum.kirupa.com/u/OM2)\
**Post date:** [September 12, 2004, 2:07am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/1 "2004-09-12T02:07:07Z")

</div>

Hi

I’ve looked at the elastic FLA examples on this website.  
They were brilliant and I understood everything!  
But… when I tried doing it myself… it didn’t work. ☹

I cut and pasted the code straight from the examples, but it still doesn’t work.  
I’m using Flash MX 2004. I’ve tried the extra bit to add ‘this’ to make it work on MX 2004, but still no results.

I’ve got the FLA in the following location:

[http://filmcharts.com/kirupa/elasticKirupa.fla](http://filmcharts.com/kirupa/elasticKirupa.fla)

Any help would be appreciated.

Thanks.

OM

---

<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:** [September 12, 2004, 2:15am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/2 "2004-09-12T02:15:21Z")

</div>

you have to define xp and yp

```auto

MovieClip.prototype.move = function (centerx, centery, inertia, k) 
{ 
	xp = 0;
	yp = 0;
	x = -this._x+centerx;
	y = -this._y+centery;
	xp = xp*inertia+x*k;
	yp = yp*inertia+y*k;
	_x += xp;_y += yp;
}

```

---

<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:** [September 12, 2004, 2:31am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/3 "2004-09-12T02:31:46Z")

</div>

em… well when i put ‘xp = 0’ and ‘yp = 0’ in, it partially works - but i get no elastic bounce?

AND… in the original code, it doesn’t have these initialisations??

the original code is given below:

[http://filmcharts.com/kirupa/elastic.fla](http://filmcharts.com/kirupa/elastic.fla)  
[http://filmcharts.com/kirupa/elastic.MX.fla](http://filmcharts.com/kirupa/elastic.MX.fla)

still confused. ☹

---

<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:** [September 12, 2004, 2:47am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/4 "2004-09-12T02:47:38Z")

</div>

has anyone else noticed the sudden spurt of problems in the tutorials code that wasn’t noticed before?

---

<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:** [September 12, 2004, 2:51am UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/5 "2004-09-12T02:51:40Z")

</div>

> [@OM2](#):
>
> em… well when i put ‘xp = 0’ and ‘yp = 0’ in, it partially works - but i get no elastic bounce?
> 
> AND… in the original code, it doesn’t have these initialisations??
> 
> the original code is given below:
> 
> [http://filmcharts.com/kirupa/elastic.fla](http://filmcharts.com/kirupa/elastic.fla)  
> [http://filmcharts.com/kirupa/elastic.MX.fla](http://filmcharts.com/kirupa/elastic.MX.fla)
> 
> still confused. ☹

you have to define all variables before using them in Flash MX2004, i’m running out now, but when i get home if noone answer’s you, i’ll fix it.

---

<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:** [September 12, 2004, 12:49pm UTC](https://forum.kirupa.com/t/problems-with-elastic-samples-from-kirupa-website/63971/6 "2004-09-12T12:49:36Z")

</div>

well… as i said… if i initialise the variables… it kinda works… but i don’t get the elasticity.

AND the MX example from this website works without the defining:

[http://www.kirupa.com/developer/actionscript/code/physics.zip](http://www.kirupa.com/developer/actionscript/code/physics.zip)

look forward to any replies. thanks.
