Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-20-2002, 05:57 PM   #1
Registered User
Join Date: Dec 2002
Posts: 1
Default limiting movieclips (lasers)

I'm quite new to action script, but i think what im doing is quite advanced, but please dont bite my heaed off if it isn't.
What i want to do is make a game with lasers, and i want to limit the number of lasers able to be fired at once, the problem is i create my lasers using a original, and using duplicateMovieClip, and so all the code goes to the original as well, and as this never seems to get deleted, the if statement is run forever...
if (this._y<0 and ) {
this is part of the code for the laser.
I put the variable in a frame code section, as it didd'nt seem to like refering to other movieclips for somereason. It works originaly, until the first laser bearm, which i assume is the original, leaves the screen, then the counter (which i set up to show me what is happening with this variable) just continuously drops into minus figures. I think one way to solve this would be to make it so the original doesnt follow the moving code, but i have no idea how to do this
If anyone could help i would greatly apreciate it, thanks
DeathTrap is offline   Reply With Quote
Old 12-23-2002, 10:11 PM   #2
:: :: :: ::
gwd's Avatar
Join Date: Feb 2002
Location: The Netherlands
Posts: 138

if (this._y<0 and ) {
This is syntax wrong!

It should be something like this:

if (this._y<0) {
_root.laserCounter -=1;

gwd is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Forum Jump

All times are GMT. The time now is 05:11 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.