Well, here's my situation. I'm relatively new to a.s., but I've managed to
begin doing what I want to do, which is make some fish swim across my screen.
You can see it somewhat work
[L=here]
http://www.21bluefish.com/media_in_progress/fishies_kinda_workin.html[/L
]. Now if you clicked the link you'll see that my fish, kinda dissappear in mid
swim. That's a problem. I was hoping someone could help me figure out what I'm
doing wrong. You can download the .fla
[L=here]
http://www.21bluefish.com/media_in_progress/fishies_kinda_workin.fla[/L]
.. Any help is appreciated, especially 'cause I'd like to see my fish swim not
die.I'd also like to specify that only a maximum amount of fish would be on the
page at one time. I'm sure that is an easy fix, I'm just very frazzled right
now, so I can't think very well. Again, Thanks for any help! I'll put my code
below as well as an explanation of how my movie is structured:
Ok. So my fish movie is 2 levels deep. The main is fishy_swim. The second is
fish with an instance name of fishy. The "fishy" clip is 4 frames long with 2
layers (one for object and one for as). In frames 1 and 2 the as is as
follows:(I commented so I'd remember, not so anyone would be offended, like I'm
talking down to them)
//determines width of the document
swimwidth=810;
//randomizes where the next fish will appear
fishy._x=0;
fishy._y=Math.random()*swimheight;
//determines the height of the document
swimheight=610;
//sets the behavior of each fish
magnify=Math.random();
fishy._xscale=(magnify*75)+25;
fishy._yscale=(magnify*75)+25;
step=(magnify * magnify * 2) +3;
//determines how far they can swim
fishy._x=swimwidth + 10;
gotoAndPlay(3)
then in frame 4 I have this as:
//sets variable for swim amount
fishyswim=fishy._x;
//determines if fish falls outside of area & respawns it
if ((fishyswim<=swimwidth)&(fishy<=swimheight+5)){
fishy._x = fishy._x + step;
gotoAndPlay(3);
} else {
gotoAndPlay(2);
}
that's all. I copied and pasted the fish a couple times and voila, it doesn't
work! Thanks for any help before hand!
-John