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 -:
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
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…
*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!
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