LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-04-2007, 08:41 AM
lucasl's Avatar
lucasl lucasl is offline
Registered User
 
Join Date: Aug 2006
Posts: 36
Rep Power: 0
lucasl is on a distinguished road
Exclamation function and removeMovieClip not working

Hi,
I have two problems.
1.
removeMovieClip doesn't work from another movieclips EnterFrame
Eg.
Code:
a.onEnterFrame = function() {
     b.removeMovieClip();
}
Nothing happens.

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;
}
__________________
GO TO Freesoft!
Where we find the freeware you are looking for!

Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 07:52 AM.