Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Advertisements:










ActionScript 3.0 :: Way Of Removing Enemy Character Permanently


I am trying to remove an enemy after I kill them and I just started working with code in .as files. The enemy has it's own logic in a .as file and when I use removeChild, the movieclip is removed, but the logic continues to attack the main character (invisible).Is there a better way of removing the enemy character permanently. It kind of scares me that the method I use could just be leaving invisible movieclips on the screen as well.I've tried everything that I have used in previous games: removeChild(EnemyArray[i]);And this, which causes other problems with my code but removes the logic: EnemyArray[i] = null;But these still cause the problem.


View 4 Replies (Posted: July 9th, 2011)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 2.0 :: Enemy Attack - Make The Enemy Pause When It Reaches The Character, Then Choose An Attack To Use?
I am currently making a game, similar to StreetFighter,where enemies will come on from the side and you fight them. Now i have the character movement and attacks fully scripted, and have made an enemy, and i make it move towards the character using:

onClipEvent(load){
movethy = 7;
scale = _xscale;[code].....

Now this works quite well and the enemy stops when it hits the character, but the problem is, it wont complete a full attack, instead it plays a few frames of the attack MC. Now i have every attack in a different MC (Frames 2-5) inside the Enemy MC. How can i make the enemy pause when it reaches the character, then choose an attack to use? From there i'll be on my way and can script the hittest and so forth.

Posted: March 18th, 2006

View 2 Replies!   View Related
ActionScript 3.0 :: Removing/hiding A MC Permanently?
I'm wanting to remove/hide a mc permanently. I though visible = false would hid it but when you go forward a frame and then back a frame the mc is back.

Code:

function pickupKey(evt:MouseEvent):void
{
gotKey = true;

[code]....

Posted: 03-04-2011, 11:28 AM

View 3 Replies!   View Related
ActionScript 2.0 :: Can't Get Character To Die When He Touches The Enemy
I added attack to my character in the game and he attacks and the enemy dissapears, the problem if I can't get my character to die when he touches the enemy. I got it to work once but what happened was that even if I hit the enemy, as soon as I hit it I got to the game over screen and got stuck on a loop between the gameover screen and the moment I defeat the monster.

Posted: October 25th, 2009

View 2 Replies!   View Related
Make An Enemy Bullet Go Towards The Main Character?
How would i make an enemy bullet go towards the main character?

Posted: 10-12-2008, 12:07 PM

View 7 Replies!   View Related
ActionScript 3.0 :: Enemy Character To Fire A Bullet Every Second?
I am trying to program a game and I want the enemy character to fire a bullet every second, but instead he is firing an infinite amount of bullets right after the other. Here's the code with the timer:

if (k == 0){
var shootRight1 = new Timer(1000,1);
shootRight1.addEventListener(TimerEvent.TIMER_COMPLETE, enemy1shoot);
shootRight1.start();

[code]....

Posted: Jul 21, 2010 6:56 AM

View 5 Replies!   View Related
ActionScript 3.0 :: Removing Enemy From An Array, Instance Still Is On Stage?
Alright, so really I am having 2 difficulties here.

1) When a bullet hits an enemy, if 2 zombies are beside eachother, the bullet hits them both -- How can I make it so the bullet can only hit one?

2) When an enemy has health of 0, it dies, I am trying to get the enemy to be removed from the array that the bullet searches through so it will no longer be affected by the enemy, but it doesnt seem to work, the bullet still hits where the enemy was, as if the enemy is invisible.

[Code]...

Posted: May 8th, 2010

View 3 Replies!   View Related
ActionScript 2.0 :: Movieclip - When It Hits The Enemy, It Goes To The Enemy's Second Frame?
i have one movieclip and i have another movieclip>enemy...okay so when the first movieclip goes over the enemy, nothing happens until i roll out! all i want to do is the movieclip, when it hits the enemy, it goes to the enemy's second frame and that's it ! there are no syntax error in this script, just something i want to do that apparently doesn't work right.here is my code:

Code:
onClipEvent (load) {
speed = 2;[code]...

Posted: May 31st, 2004

View 14 Replies!   View Related
ActionScript 1/2 :: Removing Extra Character?
I have a textbox and a button in flash. I send data to java server by entering data into the textbox. Firsttime the number of characters i am receiving are correct, from the second time onwards there is an extra character. i.e if i type 1 character it is showing 2.below is the code,

function msgGO() { if (inputMsg.htmlText != "") { mySocket.send(inputMsg.htmlText+"
"); inputMsg.htmlText = ""; }}

[code]....

Posted: May 13, 2010 8:27 PM

View 2 Replies!   View Related
ActionScript 2.0 :: Removing Extra Character?
I have a textbox and a button in flash. I send data to java server by entering data into the textbox. Firsttime the number of characters i am receiving are correct, from the second time onwards there is an extra character. i.e if i type 1 character it is showing 2. Can someone tell me how do i remove it.below is the code,

function msgGO() {
if (inputMsg.htmlText != "") {
mySocket.send(inputMsg.htmlText+"

[code]....

Posted: May 14th, 2010

View 2 Replies!   View Related
ActionScript 3.0 :: Focus Events - Removing Text One Character At A Time
I'm trying to put the text back into a text field on FOCUS_OUT one character at a time. On FOCUS_IN, I want to remove the text one character at a time.

Here's the basic code:
major.text = "ActionScript 3.0";
major.addEventListener(FocusEvent.FOCUS_IN, inFocus);
major.addEventListener(FocusEvent.FOCUS_OUT, outFocus);
function inFocus(event:FocusEvent):void {
major.text="";// want to clear the text one character at a time
} function outFocus(event:FocusEvent):void {
major.text="ActionScript 3.0"; // want to put the text back in one character at a time
}

I attached a fla. that does this in ActionScript 2.0, but I'm trying to do this in ActionScript 3.0.

Posted: 10-26-2009, 12:44 AM

View 6 Replies!   View Related
ActionScript 2.0 :: If Hit The Enemy Ball (instance Name Is "enemy") It'll Disappear?
I have a ball (instance name is "ball") and if I hit the enemy ball (instance name is "enemy") it'll dissappear, and add 100 points. At the same time, I want them to multiply and get faster.The enemy has a follower code:

onClipEvent (enterFrame) {
if (_root.ball._x>_x) {
_x += 2;[code]....

And the ball has a code that is secret because if I give it to you it'll spoil the game idea.The dynamic text box has an instance of "points".I have my mute sound control done and the ball you control done.

Posted: March 28th, 2008

View 2 Replies!   View Related
Stop All Sounds Permanently
im using stopAllSounds();command to mute all sounds, and it works fine with sounds that are already loaded (background music), but if there is button which triggers some new sound (after activating mute button ) or any other function to import new sound object you still can hear it despite stopAllSounds();.which command to use to permanently block all sounds already loaded and those which can be triggered by future actions.Now i have stupid situation> background music is muted but you can still hear sounds when cliclking buttons (which is ok but NOT in muted stage).

Posted: 03-21-2012, 06:59 AM

View 5 Replies!   View Related
Flash :: Stop All Sounds Permanently In AS3?
I have a main swf which has sound on/off buttons. It has many SWF's which are loaded into different placeholders at different time. All of them have different sounds in them. In addition to that there is a music loop going on in the background.Now, this perticular swf lets call it Father will be placed in some swf later on. What I'm trying to do right now is when the sound off button is pressed turn off all the sounds permanently so the child swf's and their sounds stop too.I have found a way in AS2 :

global = new Sound( ) //no movie clip target path.

and add the following code to your off button.

on(release){
global.setVolume(0); //mutes all sound
}[code]....

which ofcourse does not work for AS3. So how can I stop all sounds permanently in AS3? Secondly what if I have one sound (my background loop) which I want to keep going on.

Posted: Mar 30 10 at 11:26

View 2 Replies!   View Related
ActionScript 3.0 :: Can't Permanently Hide Object
I'm working on a project that has multiple 'scenes' located on each frame. In one scene, if you click on an object it disappears. I did this using the visible = false method. However, anytime you return the scene after, the object is visible again. How would I write the code so that it stays invisible permanently when you click it, regardless of whether or not you leave and later return to the scene?

[Code].....

Posted: 01-13-2012, 12:03 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Create An Object / Button That Permanently Changes?
I'm trying to make a game, but I'm stuck on a few conceptual parts that I'm not sure how to handle.

I want to create an object that changes its picture when I click on it. My idea was to have a creature that once you click on, changes to a different state. For example, you have a picture of a balloon and when you click on it, it plays the animation of it popping.

I have no idea how to do that, I've looked at buttons but it doesn't seem to persist in the state once you click on it. (or maybe it does and I'm just not doing it correctly?)

Posted: 01-20-2009, 11:39 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Load Files (via Download) Permanently
if you can do with the files that were loaded through the Loader class (or another class) remain permanently on the computer of who uploaded the application. That is, even if the person closes the browser or shut down the computer, the files remain on your computer. So when the person is running the same application will not need to wait until the files have been loaded (via download).

The person will enter in the browser page where the application is already included and you can use this application, without waiting any time since the necessary files are not on the computer. If any new files later arose in the application, this would be the only file to be loaded (downloadable) for the computer, which already found the other files that have already been loaded at another time. I can do this in actionscript 3.0? Note: Do not bother with my English because I'm using the google translator.

Posted: May 27, 2011 4:32 PM

View 6 Replies!   View Related
ActionScript 3.0 :: How To Get Objects To Disappear Permanently OnClick
I have a 'room' movieclip with 4 frames each representing a different view (N,S,W,E). I have a different shape object in each frame. The shape objects all subclass a generic shape class and consequently disappear onClick. The problem is that they reappear when the frame is revisited. I've used event.target.visible = false in the generic shape class. I'm wondering if there is a way to 'permanently' remove them through the generic shape/parent class? I'm trying to avoid a rank of if functions and use a catch-all if possible.

Posted: 11-01-2009, 01:31 PM

View 6 Replies!   View Related
ActionScript 2.0 :: Permanently Duplicate Dynamic Image?
i've created one flash banner with xml driven to pull the image from the folder. the xml file included with the list of the images name and path,then i'm created the banner using the .loadMovie() function. now,the problem is, i need the banner hold the image from the folder even when the source image was removed, so,the banner just need one time to read the image information, without need to read again the xml and doing the loadMovie again while its run for the 2nd time

Posted: June 18th, 2007

View 1 Replies!   View Related
ActionScript 2.0 :: Getnexthighestdepth - Make The Pause Menu Permanently On Top?
I'm creating a game with movie clips that are generated using getnexthighestdepth, and have a pause menu too. However, as the movie clips are generated after the pause menu, they appear above it, partially obscuring it. Is there a way to make the pause menu permanently on top?

Posted: 01-30-2012, 12:54 PM

View 2 Replies!   View Related
ActionScript 3.0 :: Edit Action Script Permanently From Outside Of Flash?
More specifically is it possible to permanently add strings, for instance, to an array using an input text field and having that text field push the text into the array?

Posted: Apr 13, 2010 10:10 AM

View 1 Replies!   View Related
Flex :: Force DataTips To Display On Graph Permanently
I assume I need to override the mouse over and mouse off event so that they don't do anything and then trigger the mouse over event for each column on the graph.

Posted: Nov 1 11 at 13:01

View 2 Replies!   View Related
ActionScript 3.0 :: Making Layers Display Permanently After Each-other On The Timeline?
Right now I have the typical timeline where I have several layers but the problem is all the content doesnot display permanently after its run through the timeline.For example layer 1 will play then disappear and then layer 2 will play through and disappear.

Is there an ActionScript that I can have for example layer 1 play through and display permanently then layer 2 plays and does the same thing, layer 3... so on and so forth one after the other until all the images are shown?I've searched all over but every ActionScript code pauses the entire timeline.

Posted: 12-12-2010, 01:33 PM

View 4 Replies!   View Related
ActionScript 3.0 :: Changing Base Class Permanently In Flash
For some reason Adobe doesn't allow us to change the size of the handle in the default slider component. This handle is small and hard to click on quickly. If you try to increase the size of it graphically it just gets resized back down to 13x13 pixels. I've looked into the Slider.as code found in:

Program Files(x86)/Adobe/Adobe Flash CS4/Common/Configuration/Component Source/ActionScript3.0/User Interface/fl/controls/Slider.as

And found that on line 803 there is the code thumb.setSize(13,13). I tried changing that to 60,60 but it doesn't change the size of the handle. I don't know much about classes and I didn't think you had to compile these. I thought that in Flash when you clicked on the Components button that it loaded these classes in at that point but I must be wrong.

ActionScript Code:
override protected function configUI():void {
super.configUI();
thumb = new BaseButton();
thumb.setSize(60, 60);
[Code] .....

Posted: 12-28-2010, 03:10 PM

View 5 Replies!   View Related
ActionScript 2.0 :: Permanently Highlighting Items Inside A Listbox?
Came across yet another obstacle today and was wondering. How would i permanently highlight specific items stored within a list box (flash component) if, say an error occured. Moreover, how would i highlight them red instead of green?

Posted: February 22nd, 2007

View 1 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved