# Changing AS5 to MX - help please

**URL:** <https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065>\
**Category:** Uncategorized\
**Created:** [January 11, 2003, 1:12pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065 "2003-01-11T13:12:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveD](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@SteveD](https://forum.kirupa.com/u/SteveD)\
**Post date:** [January 11, 2003, 1:12pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/1 "2003-01-11T13:12:29Z")

</div>

Hi Everybody,  
I found the following code some time ago, stored it in my AS file and promptly forgot about it - until now, problem is it don’t work in MX ( originally written for 5) and I cannot work out how to adjust it.

Code on Fr.1 of main timeline is :-

fish= 20;

Object.prototype.move = function () {  
rotAdd = (random(100-(vita\*rot))-50)/100;  
rot += rotAdd;  
\_rotation += rot;  
posX = this.tempo \* Math.sin((\_rotation/180)\*Math.PI);  
posY = -this.tempo \* Math.cos((\_rotation/180)\*Math.PI);  
\_x += posX;  
\_y += posY;  
if ((((\_x \< -20) or (\_x \> 550)) or (\_y \< -20)) or (\_y \> 500)) {  
\_rotation += 180;  
}  
};  
for (i=0;i\<fish;i++) {  
attachMovie(“fish”, “fish” add i, i);  
}  
stop();

inside the library is an mc.fish with the linkage fish, code on mc.innerFish is -:

onClipEvent (load) {  
tempo = random(3)+1;  
vita = random(4)+2;  
\_x = random(500);  
\_y = random(500);  
\_rotation = random(360);  
}  
onClipEvent (enterFrame) {  
move();  
}

This code ( in 5 )produces 20 fish that glide around the stage quite gracefully and in a fishy type manner, however in MX it produces 20 fish that leap all over the place in a not so fishy manner. Any help greatly appreciated

Thanks

SteveD

---

<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:** [January 11, 2003, 1:33pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/2 "2003-01-11T13:33:17Z")

</div>

I liked the last bit about the fishy stuff, very funny! 🙂  
(not making fun of you, just the fish…)  
can you post the fla, easier to debug…?  
normally, flash 5 code should work in MX…

---

<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:** [January 11, 2003, 2:03pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/3 "2003-01-11T14:03:33Z")

</div>

> \*Originally posted by eyezberg \*  
> \*\*normally, flash 5 code should work in MX… \*\*

not the gravity physics stuff something! There should be a tutorial about gravty or something that won’t owrk in FMX if I remember correctly!  
btw …JOE 🙂 I like your footer! Very cool! Good you made it small so it’s very smooth!

---

<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:** [January 11, 2003, 2:09pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/4 "2003-01-11T14:09:34Z")

</div>

Hi,  
yep, heres the file in MX, you’ll see what I mean about non fishy movement

Cheers

SteveD

---

<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:** [January 11, 2003, 2:54pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/5 "2003-01-11T14:54:46Z")

</div>

> \*Originally posted by Syko \*  
> \*\*not the gravity physics stuff something! \*\*  
> Well, there’s a correction for Flash MX that explains why it didn’t work.

[http://www.kirupa.com/developer/actionscript/spring2.asp](http://www.kirupa.com/developer/actionscript/spring2.asp)

There’s a link to the original tutorial if you want to compare codes.

pom :crazy:

---

<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:** [January 11, 2003, 3:07pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/6 "2003-01-11T15:07:25Z")

</div>

Hi ilyaslamasse,  
Well that did the trick - or should I say **this.** did the trick.

Thanks for the pointer and thanks to eyezberg for responding

Cheers

SteveD

---

<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:** [January 11, 2003, 8:39pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/7 "2003-01-11T20:39:41Z")

</div>

Haven’t helped much here…but learned a bit!  
Thanks, pom!

---

<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:** [January 11, 2003, 10:40pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/8 "2003-01-11T22:40:27Z")

</div>

Hey eyezberg  
I’ve just seen that you live in Paris - whereabouts ?  
I lived in the 20th for about 18 months before moving to a v.small town called Gérardmer ( which is where I live now) this is in the Vosges, I’m about 2hrs from Strasbourg and Metz in the other direction.  
Probably the wrong thread for this type of chat ( well its hardly MX - is it) Just thought I’d ask.  
Also responding to any thread on any foorum is always a help, it shows when asking Q.'s that someone else is actually interested. I’ve been working in Flash for about a year now, only consider myself at (lower) intermediary level but thanks to forums like these it gets better everyday

Thanks again

SteveD

---

<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:** [January 12, 2003, 1:17pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/9 "2003-01-12T13:17:00Z")

</div>

Ahaha!! Un autre Français!

Je ne sais pas où habite Joe, mais moi je suis à 2 pas du 19ème et du 20ème.

pom :cowboy:

---

<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:** [January 12, 2003, 1:23pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/10 "2003-01-12T13:23:21Z")

</div>

Non - je suis Anglais - and if you 2 are French your English is exceptional

SteveD

---

<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:** [January 12, 2003, 1:29pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/11 "2003-01-12T13:29:08Z")

</div>

shweew… I took 5 years of french and I still needed [babel](http://world.altavista.com/) for that lol

another reason why I dont live in Paris

---

<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:** [January 12, 2003, 1:38pm UTC](https://forum.kirupa.com/t/changing-as5-to-mx-help-please/11065/12 "2003-01-12T13:38:26Z")

</div>

Gotta love Babel :trout:
