
Welcome Guest
|
#1
|
||||
|
||||
|
Hi,
I have two problems. 1. removeMovieClip doesn't work from another movieclips EnterFrame Eg. Code:
a.onEnterFrame = function() {
b.removeMovieClip();
}2. I have a function that makes fish (don't ask). It has one parameter that sets whether the x-position should be random or not. I call it 1000 times at the start set to true (just testing) and nothing happens. But, it works fine when set to false during the game every couple of frames. Anyway, here it is (my coding is terrible, if you have ways to make it better, please tell): Code:
function makeFish(randpos) {
var nm = "fish"+fishcnt;
var rand = Math.random();
if (rand<.5) {
rand = Math.random();
fishlayer.attachMovie("fishright", nm, fishcnt+1);
fishlayer[nm]._x = -100;
if (randpos) {fishlayer[nm]._x = rand*2000;}
fishlayer[nm].facing = 1;
fishlayer[nm].gotoAndStop(Math.floor(rand*(fishlayer[nm]._totalframes/2))*2);
} else {
rand = Math.random();
fishlayer.attachMovie("fishleft", nm, fishcnt+1);
fishlayer[nm]._x = 2100;
if (randpos) {fishlayer[nm]._x = rand*2000;}
fishlayer[nm].facing = -1;
fishlayer[nm].gotoAndStop(Math.floor(rand*(fishlayer[nm]._totalframes/2))*2+1);
}
rand = Math.random();
fishlayer[nm]._y = rand*1000;
rand = Math.random();
fishlayer[nm].vx = (rand*5+2)*fishlayer[nm].facing;
rand = Math.random();
rand += player._xscale/600;
fishlayer[nm]._xscale = rand*100;
//(level*5)+10;
fishlayer[nm]._yscale = rand*100;
//(level*5)+10;
rand = Math.random();
fishlayer[nm].onEnterFrame = fishEnterFrame;
fishcnt += 1;
} |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can not get the removeMovieClip function to work | DarkenedHeart | Flash 5 Actionscript |
4 | 04-11-2006 02:13 PM |
| Problems with removeMovieClip | bCorin | Flash MX ActionScript |
1 | 02-02-2005 03:30 PM |
| removeMovieClip problems | ouoertheo | Flash MX ActionScript |
3 | 04-22-2004 08:40 PM |
| removeMovieClip syntax? | pespesx | Flash MX ActionScript |
14 | 04-26-2003 12:34 PM |
| removeMovieClip depth | Fabio | Flash 5 Actionscript |
3 | 07-12-2001 04:24 PM |

Programming Languages




