ActionScript 3.0 :: Deleting What Variable Creates On Stage

Jun 11, 2011

I'm having problems with deleting what a variable creates on stage!I have a random image loader as seen below.This creates a random image from the list I give it (only 4 in this example) and puts that picture on the stage.[code]Depending on the image the right or left door is the correct door (tr is the left doors name).The code below works fine, it even inserts the _whatPicture randomly again but the problem is the new picture overlaps the old picture, I can't figure out what to type so it will delete / remove the first _image, so that the new image is the only one there.[code]

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Creates An Instance Of A Class (and Stores It As A Variable)

Sep 15, 2010

If an object, or say... a document class, creates an instance of a class (and stores it as a variable), and it doesn't pass any arguments to the constructor of the class, can that class object, by simply having a function of it called by the parent, tell who sent it that command/request?

In other words, can a class object know who called it (such as it's parent) via a (seemingly) anonymous call?

View 1 Replies

ActionScript 3.0 :: Time Deleting Items From The Stage

Jul 16, 2010

I've been trying and trying to delete some basic cards from the stage whenever I reset a game, but thus far absolutely zero luck.

[Code]...

View 7 Replies

ActionScript 3.0 :: KeepCreating Function Creates A Random Shape On The Stage?

Jul 30, 2009

How would I make it if I wanted a function (that happens to run on event MouseEvent. MOUSE_DOWN)to run while mouse is down, not just once. For example, I have this code:

ActionScript Code:
stage.addEventListener(MouseEvent.MOUSE_DOWN, keepCreating);

My keepCreating function creates a random shape on the stage. But since it runs once during mouse_down, only one shape is created until you activate mouse_down again (by lifting the mouse button and pressing down again).

What I want it to do is keep creating shapes over and over again, instead of creating one shape per mouse_down.

View 6 Replies

Actionscript 3.0 :: Event Listeners - Creates A Bunch Of Movieclips And Sets Them On The Stage?

Feb 20, 2009

I have a loop which creates a bunch of movieclips and sets them on the stage.As I create each one I attatch an eventListener to it.My problem is that when the eventListener fires, the function it calls always works on the first mc added to the stage, not the one that fired the listener.How do I fix this?Here's a bit of the code:

Code: Select allfor (var i:int=0;i<numOfItems;i++) {
item = new Item();
//etc etc[code].....

View 1 Replies

ActionScript 2.0 :: Creating And Deleting Movies - Increasing The Variable This.speed Inside Interval Statements

Jun 14, 2006

I am trying to make a simple game where there are five balls that bounce around the screen and speed up at set intervals. You have to dodge them for as long as possible. Right now I have the game set up so that you dodge for 15 seconds and you win - but I can't delete the balls that are bouncing around, and I don't know how to put in a reset button. I have also tried increasing the variable this.speed inside my interval statements but it doesn't work.

View 3 Replies

ActionScript 3.0 :: Can't Access Variable On Stage From Within Movieclip Thats Placed On Stage

Aug 18, 2009

I can't access a variable on a the stage from within a movieclip thats placed on the stage.

View 4 Replies

ActionScript 2.0 :: XML Creates New Mc's?

Apr 27, 2007

i'm wanting to create mc's dynamically depending on how many images are listed in my xml file...so if were to edit the xml file and add more images to it my website would add more movieclips...

View 14 Replies

ActionScript 2.0 :: Differentiate Between The Mc's It Creates?

Jul 20, 2009

I have some code that does what I need it to do, but I need a way to differentiate between the mc's it creates.Here is the code:
_________________________________________________
TL = this;
str1 = ["strandA","strandT","strandC","strandG"];[code]....

It generates mc's randomly.So for instance, there might be 3 "strandT" mc's on the stage at the same time.How could I tell them apart? If, for example,I wanted to say, make the first "strandT" disappear, but not the second and third.

View 2 Replies

ActionScript 2.0 :: Creates Various Types Of MC

Oct 16, 2007

I want to create a function that creates various types of MC. Lets say so:

[Code]....

Explanation: Create function that creates MovieClip, make for statment to create more Mc with that function.

View 5 Replies

IDE :: Add Variable From Library To Stage

May 9, 2010

So I am trying to add a variable from my library to the stage. My variable is a chunk of text saved as a movie clip titled KatText. The issue is I can add it straight onto the stage via this code:Code: this.addChild(KatText ());However when I try to add it as a variable so I can position the text I get the error 1067: Implicit coercion of a value of type Class to an unrelated type flash.display: DisplayObject.This is the code I am trying to use to define the varible from the library:[code]

View 3 Replies

Actionscript 3.0 :: Deleting The Array Value?

Jan 3, 2011

I'm trying to figure out if this is possible?lets say I'm trying to remove the value "3"

Code: Select allvar myArray:Array = new Array("1","2","3","4","5");
myArray.pop();  // removes the last value "5"
myArray.shift(); // removes the first value "1"

How do you remove the value 3 and still have the correct lenght?

View 7 Replies

Deleting Images From Library

Jul 24, 2009

i have an image and it is a large sheet with series of poses for a character (like a sprite sheet), and wanted to take them out to be animated and make them into individual movie clips.I did successfully, but I went to delete the original image, however, the movie clips became red fills.Is there a way I can get rid of the original without affecting the movie clip?-If not-I wanted to do this because I thought it may save memory but i am not really sure if it will affect the memory since the sheet itself is not going on the stage, is there a chance that this full sprite sheet in the library won't effect the file size of .swf?And if it does, if I turn it into a graphic, or movie clip, will that compress it?I use Flash CS3!

View 3 Replies

Xml :: Deleting A Particular Node Using The E4x Syntax?

May 24, 2011

I have this XML structure:

<numb>
<variable>
<name>john</name>

[code].....

View 1 Replies

ActionScript 3.0 :: Deleting A Selected Row?

Aug 20, 2010

i was trying to delete a row on a datagrid. basically, i click on the row, then i click a button so that the chosen/clicked row is deleted. here is my code snipet :

Code:
public function deleteRow(event:MouseEvent):void{
selecto0.removeItemAt(dGrid.selectedIndex);
selecto0.refresh();

[Code].....

even though that row exist, i guess the index is not recognised. what do i do?

View 2 Replies

ActionScript 2.0 :: Deleting The Multiple Mc's?

Mar 12, 2012

I can of course use removeMovieClip but I heard there was a more simple solution - attaching all of the MC's to another MC, and then deleting this MC would also delete all attached MC's. I saw some examples (starting with createEmptyMovieClip but I guess I'm having some problems with syntax.

ActionScript Code:
createEmptyMovieClip("movie1", this.getNextHighestDepth());
movie1.attachMovie("whatever", "movie2", this.getNextHighestDepth();
movie1.attachMovie("whatever", "movie3", this.getNextHighestDepth();
...

This code does not work...What I'd like is to remove movie1 so that it would delete all the others. Can it work?

View 5 Replies

ActionScript 2.0 :: Deleting A MC From Inside Itself

Nov 26, 2004

I have a question which probably isent to difficult.. im making a game in which there are some mines which chase a ship... these mines are created with

[Code]....

View 3 Replies

ActionScript 2.0 :: Deleting From An Array?

Feb 23, 2003

Is there a way to delete a specific value in an array? For example, the array:"Banana Peel,Hippopotamus Leg,Computer Wire,Keyboard"Would there be any way to delete just "Computer Wire" from the array? I found the Array.splice thingy, but it seems that you need to know the index of the thing. Therefore i guess my question is: Is there any way to find the index of a particular value.In the thing I am making, the value could be at any index in the array (it is put in place by the user), so I could not just say Array.splice(2,1,)

View 14 Replies

ActionScript 2.0 :: Deleting A MC - Use RemoveMC?

May 25, 2005

Whats the AS for deleting a MC? I have a dragable box and I want to create a button to close it...but dont know what the action script is to delete the MC...do i need to use removeMC?

View 3 Replies

ActionScript 2.0 :: Deleting A MC From Inside Itself?

Nov 26, 2004

im making a game in which there are some mines which chase a ship... these mines are created with

Code:
dot.duplicateMovieClip("dot"+currdot, this.getNextHighestDepth(), {_x:-100, _y:-20});
currdot=currdot+1

inside the dot MC there is a video , it blinks and roatates and stuff when its just floaring around , and when it hits something

Code:
if(this.hitTest(_root.ufo)){
_root.shieldCurr=_root.shieldCurr-_root.dotDamadge;
trace("hit"+this);
this.gotoAndPlay(73);
}
gotoAndPlay(73);

refers to the 1st frame of the explode animation inside the MC frame 1 to 72 is a looping animation now after it plays the exploding animation , i want it to be deleted ive tried a few different things like...

Code:
_parent.removeMovieClip(this);

which dont seem to be working. So id like to remove the movie clip from inside itself.

View 3 Replies

Flash :: CreateEmptyMovieClip Creates It On All Frames?

Feb 15, 2011

I have a question regarding createEmptyMovieClip in AS2. I have a flash file separated out into sections with labels and menu buttons which allow you to move you to the relevant frame/section (which contains the information/contents relevant to that section). This works fine. What I can't work out is that if I manually put a movieclip on the stage in my 'about section' and then add contents to it via AS2 then it only exists within the about us section. If I do it using createEmptyMovieClip within the actions for the about frame this works fine but it then always exists on every other frame of the project. I assume this is because it isn't actually creating it within this frame but I can't work out how to make it do this, even when i use this.createEmptyMovieClip it has exactly the same effect. I can obviously remove the movieclip completely each time a user moves to another frame that doesn't contain it but I don't want to do this as it contains a youtube video and leaving it means it doesn't have to be reloaded each time they come back.

I would be massively grateful if anyone could shed any light on this for me as I know i'm not getting how to place it correctly but i'm not sure how I should be doing it?

View 1 Replies

Actionscript 3 :: Preloading Self W/ FactoryClass Creates Second SWF?

Oct 10, 2011

I'm using Flash Builder 4.5 to create what's needs to be a single SWF project, and I'm running into issues with allowing the main SWF to preload itself.I know about using the meta factoryClass to allow for this kind of preloading, but every time I publish I'm now seeing it create a new SWF for the preloader class as well as the main class.I swear I've used this approach in the past and never had the second file. Is this no longer the way to be doing things? Would you suggest an alternative, or is there a simple fix?[code]

View 1 Replies

ActionScript 2.0 :: Array That Creates The Mc's Names?

Apr 19, 2005

I have an array that creates 7 mc clips with names.I'm trying to make each one of those peices clickable.When clicked each peice will slide over to the far left "barrier_mc" and stop.Actually not true, the one closest to the "barrier_mc" will stop at the barrier and from then on each piece will stop when it hits the one beside it (kinda like a 7 car fender-bender). This isnt the problem im trying to work through right now, although i will in the near future.

What im trying to figure out is the array that creates the mc's names them like the following "" infoBar"+i+"_mc"". What im trying to do is call that in a function so that i dont have to type in each of the 7 mc names manual I.E (infoBar0_mc) you'll see my function at the bottem in the "function pieceStop"of the pasted code.

Code:
var list:Array = ["piece1", "piece2", "piece3", "piece4", "piece5", "piece6", "piece7"];
var startingX:Number = list_mc._x;
var bottom:Number = 950;[code].....

View 2 Replies

ActionScript 3.0 :: Add Child Creates Little White Box?

Apr 23, 2010

I have this code + background color set to grey. The weirdest thing is that addChild(something); seems to create a white 46x46 pixel white box on stage. If I take addChild away, white box goes away as well..

Timeline script:

Code:
var something:Main = new Main();
addChild (something);
Main.as:

[Code]....

View 1 Replies

ActionScript 1/2 :: Displaying A Variable On Stage?

Nov 9, 2009

I've got a Global variable here in my flash project, which is stated like this,_global.swfloaded = "home";This variable then changes throughout the project, depending on what buttons are pushed.One example of the change is when a button labelled Classic is clicked, taking the user to the Classic page, the variable is changed like this - swfloaded = "classic";I then have a dynamic text field with the instance name of 'output' on the stage, which I want to display the variable, the code I've used for that is - output.text = swfloaded;The problem is the 'output' field doesn't update at all, no matter what is clicked.

View 6 Replies

Flash :: Stage Resizing And Getting The Right Variable?

Jan 20, 2011

In my Flash Application (AS3), I want to get the stage size and use that so my objects (which the user controls) can't go outside of the screen. However, when I use:stage.stageWidth;stage.stageHeight;The values I get aren't actually what I want. They give me the stage size, but if I resize the window, the numbers change as well. Now, in a html page, I don't think that will matter, because the user can't resize it... however, I'd like for it to be more solid than relying on the window size.stage.width;stage.height;However, those gave me "801" and "601", one greater than my actual stage size. Those values did not change when I resized the window, but they were one greater.

View 1 Replies

ActionScript 3.0 :: Access A Variable That Is On Stage?

Apr 13, 2009

Here is an example: [URL]

I am try to get the gray number at the bottom to be loaded into the swf code:

this.jackpotName1.line2.text = promotion.slide[GRAYNUMBER].JackpotName1.text()

View 3 Replies

CS3 : Deleting Frames From Start Of Timeline?

Oct 11, 2009

I'm using Flash CS4 and I have to trim a .fla file down. I can delete the end frames no problem, but the first 600 frames that I have to remove are proving to be a nightmare. When I use the select>right-click>delete method it doesn't remove these frames, instead it removes the corresponding amount of frames from the end.

View 2 Replies

ActionScript 3.0 :: Deleting An Object Out Of An Array?

Mar 12, 2010

Actionscript Code:
var gameObjectArray:Array = new Array();var gameTimer:Timer = new Timer(25);gameTimer.addEventListener(TimerEvent.TIMER, gameLoop);gameTimer.start();

[code].....

So every 25 milliseconds, a block is being created and it pushed into an array. The for loop cycles through the array and moves the x by 1 for each object in the array. If the x reaches past 300 pixels, then I want to delete the object from the game entirely. The way I'm doing it now yields an error, so what am I doing wrong and what should it look like inside of the "if (i.x > 300)" stuff?

View 6 Replies

Deleting Variables From Debugging Menu

May 8, 2010

I found what I am looking for when I list all variables. I want to cut out the rest of the menus that create a fan of pages.I removed the SWF's from showing up. But I am still having issues with changing the nMenus = "14" which is the number of menus to show. I want to change the "14" to "9" so there are no spacing in between my 3D Pages.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved