ActionScript 2.0 :: Removing MCs Attached To Other MCs?
Oct 2, 2004
In the code I am working on I am attaching MCs to other MCs. However, when I remove the second MC the first one gets removed too. HexStore contains a load of game hex MCs.LastLocation is the last hex MC clicked. myBrigade is the extra MC that needs to be removed from the LastLocation MC. Here is the code:
_root.HexStore[_root.LastLocation].removeMovieClip(_root.HexStore[_root.LastLocation]["myBrigade"]);
View 4 Replies
Similar Posts:
Jan 6, 2012
I'm creating a highscore list like this:
code: function loaderCompleteHandler(e:Event):void {
var scoreXML:XML=new XML(e.target.data);
var playerResult:MovieClip;
[code]....
I have a MovieClip with the linkage name of "playerResult" in the library. For every loop it takes the scores+names from the xml and displays them by creating a new instance of "playerResult" and attaches them one by one under each other.I need to be able to remove this highscore when it's not longer needed, thus (the most important part) freeing up memory. So I can then use the same code to show the scores again without doubling the memory it uses every time.
code: function loaderCompleteHandler(e:Event):void {
var scoreXML:XML=new XML(e.target.data);
var playerResult:MovieClip;
[code]....
... so I now have a name for each instance (playerResult0, playerResult1...) but still can't come up with a way to remove them.
The scores are displayed like this:
1 name score
2 name score
etc...
View 4 Replies
Jan 6, 2012
I'm creating a highscore list like this:
[AS]function loaderCompleteHandler(e:Event):void {
var scoreXML:XML=new XML(e.target.data);
var playerResult:MovieClip;
[code]....
View 4 Replies
Mar 7, 2010
I am using AS2. The character, a robot, has machine guns that fire off bullets. I am trying to get the bullets to disappear when they hit an enemy. They do dmage, but for some reason they are still there. Here is the code I use to attach and delete them.
Actionscript Code:
if (bulletReady == true && dead == false && Key.isDown(1) == true) { for(x = 0; x<machGuns.length;x++){ bulletReady = false;
[code].....
View 2 Replies
Jul 19, 2007
i am trying to draw continues line one point to another by mouse click , and each points there will be a round shape(using linkage library method) with the mouse click .the lines all are removed by this (_root.newgrid1.clear()) method.the problem is that i was only able to remove one round shape from the stage using remove movie clip method,ow can i remove all the attached movie by the reset button from newgrid2?
################################################## ##
this is the method i used to remove the clip
_root.reset.onRelease = function ()
[code].....
View 8 Replies
Feb 16, 2009
i'm trying to remove a function from a movieclip, is there a way of doing this, so I keep the movieclip on stage but removes the onPress etc? I'd also want to be able to reapply that function the movieclip later.
View 2 Replies
Dec 7, 2009
I have a flash template which came with a preloader with AS's like this:
__________________________________________________ _________
MovieLoaded = _root.StoredActions.Movies.movieAnime.Holder["CMovie"+n].getBytesLoaded();
loadTotal = _root.StoredActions.Movies.movieAnime.Holder["CMovie"+n].getBytesTotal();
[code].....
View 1 Replies
Nov 29, 2011
I am using these settings for media server but there's too much noise when a mic is attached to stream. Code is as following, can you suggest changes to remove the noise for more crystal clear voice?
[Code]...
View 2 Replies
Aug 18, 2009
How to find out whether camera is attached or not in AS3.0. It can be installed or not.
View 2 Replies
May 25, 2011
I'm trying to set up a proof-of-concept of loading one SWF into another SWF for skinning. The set-up is this: app.fla, which has an attached ActionScript class, AppMain.as skin.fla, which contains UI components AppMain.as will obviously contain all of the application's logic; I then want to be able to affect the UI components contained within the loaded skin file based on instance names defined in that particular skin.
So for example, if I have a TextField with an instance name of myTextField I'd like to be able to set the text property of that text field programmatically in AppMain.as. The exported app.swf to load a skin file based on a flashvar parameter would be loaded into an HTML document that looked like this:
[Code]...
View 1 Replies
Jul 4, 2009
I just moved to AS3 and I learnt how to attach a movieclip.
ActionScript Code:
var attachedMC = new (getDefinitionByName(PageName) as Class)();
holder.addChild(attachedMC);
Where PageName is the string containing the Class of the movieclip in the library and holder is the instance name of the MC to be attached to.
But what instance name do I use to refer to the movieclip that got attached?
In AS2, the code would have gone like this
ActionScript Code:
holder.attachMovie(PageName, "instanceName", 1);
The instance name part of the code seems to be missing in AS3. SO how do I refer the the attached MC or "child"?
View 5 Replies
Mar 28, 2004
I'm in a hurry to finish off this movie and I'm having trouble loading the attached swf into another swf! It loads but then I can't move the man! This is the script in the swf
_root.createEmptyMovieClip("container", 1);
loadMovie("isoRooms.swf", "container");
container._x = 150;
container._y = 20;
View 4 Replies
Aug 31, 2004
How do you address a mc attached to another mc?I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.[code]How do I now manipulate the "ExtraMC" movie clips? I know I can use parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?
View 2 Replies
Oct 2, 2004
In the code I am working on I am attaching MCs to other MCs. However, when I remove the second MC the first one gets removed too. HexStore contains a load of game hex MCs. LastLocation is the last hex MC clicked. myBrigade is the extra MC that needs to be removed from the LastLocation MC.[code]...
View 4 Replies
May 11, 2006
I have a mc in the library, with an ID = dada.I use this code to attach it to a mc, and I want to run an animation inside the attached MC. It does not work, and I don't understand what I am doing wrong.
Code:
this.createEmptyMovieClip("holder", 2);
holder.attachMovie("dada", "dada_mc", 3);
[code]....
View 1 Replies
Jul 6, 2007
I have stage elements in my site showing up where they are supposed to with a FLUID Layout using the following code. Though there seems to be this strange gap all the way around my site in the html page. I want the horizontal bar to be attached to the top likeps. the shinny black band in the attached pic is called "topstretch" in the code below.
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
[code]....
View 6 Replies
Jul 22, 2003
Is it possible to control a MC that is attached to another MC?
Example:
-------------------------------------------------
on (release) {
_root.loader.play();
}
*loader* is the blank MC.... and I want to control the MC that is attached to it called *movie1*.
View 6 Replies
Aug 31, 2004
How do you address a mc attached to another mc?
I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.
ie.
for (i=0;i<BasicMCArray.length;i++) {
_root.BasicMCArray[i].attachMovie("myExtraMc","ExtraMC" + i,depth++);
}
How do I now manipulate the "ExtraMC" movie clips? I know I can use _parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?
View 2 Replies
Sep 28, 2004
is there a way to keep the content of a mc (attached content) when I duplicate it? I know that duplicate remembers size, position, rotation etc. But I want to get the attached content too.
[Code]...
// Now I want to duplicate the Container to get a copy of it (Container2_mc) Countainer1_mc.duplicateMovieClip("Container2_mc", 10)
View 3 Replies
Jun 11, 2009
I need to put a mask on an action script 2 attached movie clip, is it possible? and if it is, how can I do it?
View 2 Replies
Aug 17, 2009
I wasn't sure if I were to put this in the Actionscript forum or in here, so I put it in here. I'm making a small test for a game so I made two attached movieclips to the stage. I got them to move at each other, but when they hit, it doesn't detect it. Is there anyway i can make them hit eachother? Heres the code
[Code]...
View 3 Replies
May 5, 2009
am trying to find a way to replicate the following mask in as3:Basically i need to create a mask that follows the mouse movement.
View 1 Replies
May 5, 2009
This is just an example.. however i am trying to attach a M.C to attachHere. This is fine. However the following code is thn meant to remove 2 of the attached M.C's but i dont know how to reference it so that it removes the clips that are attached to attachHere...it works fine if i just attach the M.c's to the stage...
[Code]...
View 2 Replies
Mar 11, 2010
I am attaching a combo box called "BinaryCombo" to a datagrid component(dg) using the attachMovie method
lika so.... dg.attachMovie("BinaryCombo", "hover", 9999, {_x:10, _y:20}); it works fine except that I would like to initialize the combo's selectedIndex when attaching. I am intializing the x, y of the box but not sure of the syntax (nor if it is even possible) to initalize the index.
View 7 Replies
Mar 15, 2012
Project: Flash Professional CS5.5 | AS3Platform: Mac OSX LionI have a projector that calls on an attached movieclip with the following function:
function fbtnclicka(e:MouseEvent):void{
var mc:moduleexit_mc=new moduleexit_mc();
}
[code]......
View 19 Replies
Jul 8, 2010
Is there any advance TextArea that can attached image(image is alligned with the text) and the image can be movable inside the text area.I know that text area can support html text and can insert image tag but it is very limited, I can't move the picture inside textArea by dragging it or even add events on it.
View 3 Replies
Jun 6, 2011
The following is the chunk of my code that is attaching a movieclip (from timeline), tracing thisDot works so it is not the variable which is a problem but there is no rollover applied to the attached movieclip.
var dot_name:String = new String(Graphs[s]._name+"_dot"+i);
var dotObj:Object = new Object();
if (prevX != undefined) {
dotObj._x = newX;
[code].....
View 1 Replies
Nov 10, 2007
I have a button with a sound attached to it. The button should play the sound when the mouse is in its down state. When I play the sound in the .swf file the sound plays but it's cut off at the end (maybe the last 3 seconds). I'm using mp3 files for the sound. This is happening with many of the buttons in the program. It's a simple operation within the program. The user clicks a button and voice-over is supposed to play.
View 0 Replies
Dec 3, 2009
can anyone see why i'm getting an "undefined" at the the end of this xml list using this code:
PHP Code:
var vetXML:XML;
var vetLoader:URLLoader = new URLLoader();
[code]......
View 2 Replies
Feb 22, 2010
I was wondering if there was any way to put code on an attached movieclip?
View 4 Replies