Removing Multiple Attached Clips
Hi, can someone help me out with this problem please?
I'm creating a 5 part game, im using the slider from the button library to navigate between each part.
on part 5 I have actionscript attaching balloons in random positions on the stage and as they float across the screen the player has to burst them.
the problem that I am having is that if the player decides that they dont what to complete part 5 and uses the slider half way through to navigate to another part the balloons still stay attached to the stage in there last position.
I've tried several different ways but still cant get the balloons to be removed if the player navigates to a different part after starting part 5.
can anyone help me out with this??
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 12-21-2007, 09:39 AM
View Complete Forum Thread with Replies
Sponsored Links:
[help]removing All Attached Clips
sorry, but this is elementary, and i cant find it in the search...
when a movie changes scenes, i want it to remove all the attached clips. is there some easy way to refer to all attached clips on the stage?
(im sure there is, but im derned pleased if i can find my pants in the morning much less a specific piece of code)
View Replies !
View Related
Removing Attached Clips
I have code that attaches a number of movie clips using an array as the variable name. I would like to remove these clips when I press a button. I have attach my code to create and remove the clips. The create function works just fine but the remove when I press the button doesn't work at all. Can someone tell me where I am going wrong?
Thanks
Attach Code
var createCode:Function = function(currentWord:String){
var pos = placeholder_mc._x;
for(i=0;i<=currentWord.length-1;i++)
{
attachedClips[i] = attachMovie(currentWord.charAt(i),"letter"+i+"_mc",this.getNextHighestDepth(), {_x:pos, _y:placeholder_mc._y});
pos = pos + (attachedClips[i]._width + 10);
}
}
tryAgain_btn.onRelease = function(){
for(i=0;i<=attachedClips.length - 1;i++){
attachedClips[i].removeMovieClip();
}
}
View Replies !
View Related
Removing Attached Movie Clips
here is the code I am using to attach an exported movie clip from the library called birdMC:
PHP Code:
createEmptyMovieClip("emptyBird", 16);
_root.stamps.birdb.onPress = function() {
_root.actions.penmode = "stamp";
c = c+1;
emptyBird.attachMovie("birdMC", "newBird"+c, 5000+c, {_x:_root.emptyBird._xmouse, _y:_root.emptyBird._ymouse});
var copyBird = _root.emptyBird["newBird"+c];
startDrag(copyBird);
copyBird.onPress = function() {
if (_root.remove == true) {
copyBird.removeMovieClip(this);
_root.actions.penmode = "stamp";
c = c-1;
} else {
startDrag(copyBird);
_root.actions.penmode = "stamp";
}
copyBird.onRelease = function() {
stopDrag();
_root.actions.penmode = "draw";
_global.current = this;
};
};
};
my question is, what script would I put on a button inside of the birdMC movie clip that would cause the movie clip to be removed? I would like it to only remove that instance of the movie clip, no other instances that may be on the stage.
thanks in advance....
View Replies !
View Related
Removing Attached Movie Clips
Hey again.
I used the Attach movie clip method to create bricks in a game i'm making. The problem is, I don't know how to remove them. Any help would be appreciated.
Quote:
var ref:MovieClip = _root.attachMovie("brick", "brick"+movieNum, movieNum);
//line them up
ref._x = 58 + ref._width * row;
ref._y = 50 + ref._height * col;
View Replies !
View Related
Removing All Attached Move Clips From Stage
I've attached various flash movie clips dynamically to my stage, and I would like to know an easy way to remove them all.
I have code like the following but it is extremly inefficient; takes a full 3 second count to clear all attached movies on a high end system.
Code:
for(q=0; q<2000; q++)
{
attachMovie("BlankClip","RandomName",q);
}
I don't know how many attached movies clip may be on, so i used 2000 as a guess that would cover everything, and then i overwrote all of the clips with a blank clip to clear it before attaching the next set of movie clips.
View Replies !
View Related
Removing Multiple Clips
I am attaching movie clips to the stage according to how many items are in an XML list. Everything works fine, but when I click on the next button I want the attached clips to be removed. when using itemAdd.removeMovieClip(), it only removes the last one.
I have modified the code to:
Code:
var item_spacing = 40;
var item_count = 0;
function loadInfo(info_xml){
var info = info_xml.firstChild.childNodes;
for (var i=0; i<7; i++){
var itemAdd = attachMovie("holder_clip","holder_clip"+i, item_count);
itemAdd._y = 0;
itemAdd._x =(110)+(92*(i));
item_count++;
var TxtAdd = attachMovie("text_holders","text_holders"+i, item_count);
TxtAdd._y = 58;
TxtAdd._x = (125)+ (92*(i));
item_count++;
itemAdd.jpg_holder.loadMovie(info_xml.firstChild.childNodes[i].childNodes,1);
TxtAdd.playedTxt = info_xml.firstChild.childNodes[i].attributes.played;
TxtAdd.pointsTxt = info_xml.firstChild.childNodes[i].attributes.points;
next_but.onRelease = function(){
for(var i=0; i<7;i++){
this["holder_clip"+i].removeMovieClip();
}
for (var z=7; z<14; z++){
var itemAdd2 = attachMovie("holder_clip","holder_clip"+z,item_count);
itemAdd2._y = 0;
itemAdd2._x =(-540)+(92*(z));
item_count++;
itemAdd2.jpg_holder.loadMovie(info_xml.firstChild.childNodes[z].childNodes,1);
}
}
}
}
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if(success) loadInfo(this);
else trace("Error Loading")
}
my_xml.load("teams.xml");
stop();
using
Code:
for(var i=0; i<7;i++){
this["holder_clip"+i].removeMovieClip();
}
but it does not work. Any help would be greatly appreciated.
View Replies !
View Related
Sending Variables To Multiple Attached Clips, Help? :)
Hi, got a question for you guys and girls : )
I have a flash website im making and its set up like so:
Main.fla has a bunch of attached movie which are a series of other .fla files.
Say one of those files gets data from a database via ASP. I can manipulate the loaded variables in that file so thats all good.
Heres the issue, How do my other attached movie clips (files) get the loaded variables with out requesting the data from the database again. I have been doing it thus far by sending the number of the record i want to retrieve from the database to the other files/attached clips and then loading the data again from the server. Which is not how i want to do it.
I would like to do something like this: Go through all of the database, or some section of it.. whatever, and load each record into a unique corresponding LoadVars object or some object, and then i guess make those objects global or reachable to all movieclips attached to _root.
The simplified operation i want to do is: You click on a button that has a title thats grabed from the database. Once you click, it loads up info about that "item" or whathave you, and then loads a image to go with it. The image url is in one of the variables of the items record on the database.
Sorry if this is obvious, i just wanted to explain what i want to do. Anyone know how to do these things? Im having trouble sorting it out and figuring out what commands can do what.
Thank you so very much, anything you got : )
View Replies !
View Related
Evil Arrays (Removing Multiple Movie Clips)
[What I would like to do]
Create a button the removes multiple movieClips that are attached
[Details]
I have an array of names:
subMenu =["subA","subB","subC","subD","subE"];
and I would like to create a funtion that loops through
each of these names and use the .removeMovieClip() function.
All I really need it to do is loop through the array and remove any movieClips that correspond to an element inside the array...
For the love of T-Bone Steak please help me
View Replies !
View Related
Loading Multiple Movie Clips Using MovieClipLoader Script Attached To A Button State
I am building a site that loads both images(using moviecliploader) and text(using loadvars.load) dynamically to a stock page(mytarget is on level5) when different buttons are pressed. My problem is that when I program a function to a button state to call more than one item it does not work.
For examle
code:
Mybutton.onRelease = function(){
myMovieLoader.loadClip(“mytarget.swf”,5); //loads the swf that has the text and image targets
myMovieLoader.loadClip(“image1.jpg”,_level5.imaget arget); //loads image to target MC on level5
myLoadVars.load(“mytext.txt”); //loads the text using myLoadVars to level5.sitetext
}
So, this does not work. If I delete any two of the lines of code it will work. The image load will work independently, the load vars will work independently, and the moviecliploader works independently.
So as a temp solution I have separated out the lines of code to different mouse actions. This does work but looks like crap because the text does not come up till the user rolls off the button, which can only confuse them.
Example
code:
Mybutton.onPress = function()[
myMovieLoader.loadClip(“mytarget.swf”,5); //loads the swf that has the text and image targets
}
Mybutton.onRelease = function(){
myMovieLoader.loadClip(“image1.jpg”,_level5.imaget arget); //loads image to target MC on level5
}
Mybutton.onRollout = function(){
myLoadVars.load(“mytext.txt”); //loads the text using myLoadVars to level5.sitetext
}
SO how would I call the moviecliploader to load...say 3 movies to different levels just by pressing a button?
EDIT: Added [ as ] tags - jbum
View Replies !
View Related
Removing MCs Attached To Other MCs
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"]);
Any idea where I'm going wrong with this?
View Replies !
View Related
Removing MCs Attached To Other MCs
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"]);
Any idea where I'm going wrong with this?
View Replies !
View Related
Removing ALL Duped And Attached Mc's
Hey, im sure there is a really easy way to do this, ive tried searching the forum, but couldn't find anything with this exact problem.
Anyway, in my game, when you die, i want to remove all of the attached enemies, and other duplicated clips. Is there and easy way i can just delete ALL of these clips? rather an addressing each seperatly?
Thanks
Scott.
View Replies !
View Related
RemoveMovieClip Is Removing All My Attached Movies :-(
function away() {
for (i=0; i<numMenuItems; i++) {
_root["blob"+i].removeMovieClip();
}
}
this.attachMovie(_level0.ButTopic, "HEADSET", "AnimHolder");
Okay I have a movie that loads from the library with the attachMovie cmd. Now I have a number duplicated MCs on this page as well that are made to dissapear with the "away" function.
However for some reason
Code:
AEG.onRollOver = function() {
_root.away();
};
Makes the HEADSET (or Anim Holder) dissapear as well
What is going on? My remove Movieclip is targeting mcs with the suffix of "blob" so why is it affecting my attached HEADSET movie :-(
Any help would be much appreciated
View Replies !
View Related
[as 2.0 Class] Removing Attached Movieclip.
here is the pertinent section of code
Code:
private function attachToolTip():Void{
_linkageClip = _root.attachMovie(_linkageStr,"tmpToolTip"+_id,_root.getNextHighestDepth());
}
private function removeClip():Void{
_linkageClip.removeMovieClip()
}
when i call removeClip, i would assume the attached movie clip would be deleted, but it doesnt work. and i know removeClip is firing correctly.
i also tried: unloadMovie(_linkageClip) and removeMovieClip(_linkageClip)
View Replies !
View Related
Removing Attached Movieclip With Component In It...
Hi folks,
i am currently having problems removing a movieclip. My movieclip contains a Media Display instance and i have used attachMovie to attach it, however removeMovieclip is not working for me.
I have read in a couple of places that this could be because of the component, and that instead you could use UIObject.createClassObject() - However, it looks like the parameters for this are geared up just to create and remove a single component - my movie clip also contains a background and frame around the display which i need to attach with it.
How can i manipulate this code to get both attached and removed??
i just thought that maybe i could call the movieclip with attachMovie and then create the media object with createClassObject() and then destroy each in the same way, but not sure what parameters to put in the createClassObject() - can someone help, where do i assign the URL etc, with the media display offstage?
View Replies !
View Related
RemoveMovieClip Not Removing Attached Movie
guys,
i am attaching a movieclip from the library to a movieClip specified in a variable. this all works fine using the following code.
Code:
eval(this.navHolder).attachMovie("emptyThread", "thread" + this.threads.length, this.depthCount, this.tempInitObj);
when it comes to the time i want to remove it again none of the following code combinations work.
Code:
eval(this.navHolder)["thread" + i].removeMovieClip();
eval(this.navHolder + ".thread" + i).removeMovieClip();
this[this.navHolder + + ".thread" + i].removeMovieClip();
this.navHolder["thread" + i].removeMovieClip();
i know that i am targeting the movieClip correctly, because i can track its _x propertly. it just stubbonly refuses to be removed. I've had a look through some of the other posts about "removeMovieClip" in this forum and have tried the various suggestions posted (such as mc.swapDepth(99999)) before trying to move it. all to no avail.
I;d appreciate any thoughts on what i might be doing wrong.
Many thanks!
T
View Replies !
View Related
RemoveMovieClip Is Removing All My Attached Movies :-(
Code:
function away() {
for (i=0; i<numMenuItems; i++) {
_root["blob"+i].removeMovieClip();
}
}
this.attachMovie(_level0.ButTopic, "HEADSET", "AnimHolder");
Okay I have a movie that loads from the library with the attachMovie cmd. Now I have a number duplicated MCs on this page that are made to dissapear with the "away" function.
However for some reason
Code:
AEG.onRollOver = function() {
_root.away();
};
Makes the HEADSET (or Anim Holder) dissapear as well
What is going on? My remove Movieclip is targeting mcs with the suffix of "blob" so why is it affecting my attached HEADSET movie :-(
It's late and I want to go home, not hating flash. Thanks in advance for any advice.
View Replies !
View Related
Removing Attached Movie Clip.
Hi,
I'm having a lot of trouble removing an attached movie clip. Basically I have set up a function to attach a movie clip name it 'mainNew'+1 then delete the previous clip i.e. mainNew. I have been stuck on this for hours, the code I have is the below, would really appreciate some help on this:
ActionScript Code:
#include "lmc_tween.as"
var lev = 0;
function removeCurrentClip() {
// trace('slideMain ' + slideMain.currentClip);
removeMovieClip(slideMain.mainOld);
removeMovieClip(this.slideMain.mainOld);
this.slideMain.removeMovieClip(mainOld);
trace('mainOld from remove = ' + slideMain.mainOld);
}
function mainClip (newClip) {
lev++;
slideMain.mainOld = mainNew;
slideMain.mainNew = 'mainNew'+lev;
trace('mainOld = ' + slideMain.mainOld);
trace('mainNew = ' + slideMain.mainNew);
slideMain.attachMovie([newClip] ,'mainNew'+lev,lev,{_alpha:0}).alphaTo(100,1.5,'linear',.2, removeCurrentClip);
}
slide1.onRelease = function() {
mainClip('one');
}
slide2.onRelease = function() {
mainClip('two');
trace('slideMain.currentClip = slideMain.newClip ' + slideMain.currentClip);
}
mainClip ('one');
View Replies !
View Related
[MX04] Removing Attached Movieclips On Hittest
Hello
I'm pretty new to flash so it's possible that I made some dumb stuff here, but anyway, here's my problem.
I'm making a top down shooter there the player controlls a ship that shoots bullets when pressing the mousebutton. When you press the button the script creates 2 bullets that flies towards the mousepointer. So far it works, but I want the bullets to be removed when they hit the enemies, which I can't get to work.
This is the code that creates the bullets, it's on the player ship which is a movieclip on the scene. (The "shoot" and "rate" just determens how often the ship fires when the button is hold and the "_root.player.gun.gotoAndPlay(2);" is just the flame animation for the gun barrels.)
code: if (_root.moused) {
if (shoot == rate) {
_root.player.gun.gotoAndPlay(2);
if (i>=100) {
i = 1;
}
_root.attachMovie("shot", "shot"+i, i);
setProperty("_root.shot"+i, _x, _x-5);
setProperty("_root.shot"+i, _y, _y);
i++;
_root.attachMovie("shot", "shot"+i, i);
setProperty("_root.shot"+i, _x, _x+5);
setProperty("_root.shot"+i, _y, _y);
i++;
shoot = 0;
}
shoot++;
}
Now I checked a tutorial on this site which used the same type to shoot and hittest and I just took the code from there and placed it on my enemies (which are movieclips and preplaced on the scene).
code: onClipEvent (enterFrame) {
if (this.hitTest(_root["shot"+i]._x, _root["shot"+i]._y, true )) {
_root["shot"+i].removeMovieClip();
}
}}
But that didn't work (they don't hittest) and I have no clue why...
Basicaly, I want the bullet to play an animation and then be removed when it hits an enemy so if I could get any help on this, it would be great.
Thank you.
View Replies !
View Related
[MX04] Removing Attached Movieclip With Component In It...
Hi folks,
i am currently having problems removing a movieclip. My movieclip contains a Media Display instance and i have used attachMovie to attach it, however removeMovieclip is not working for me.
I have read in a couple of places that this could be because of the component, and that instead you could use UIObject.createClassObject() - However, it looks like the parameters for this are geared up just to create and remove a single component - my movie clip also contains a background and frame around the display which i need to attach with it.
How can i manipulate this code to get both attached and removed??
i just thought that maybe i could call the movieclip with attachMovie and then create the media object with createClassObject() and then destroy each in the same way, but not sure what parameters to put in the createClassObject() - can someone help, where do i assign the URL etc, with the media display offstage?
View Replies !
View Related
Removing Attached (linkage) Movie Clip
hi, need a help
i have attached my work file
actully 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,
how can i remove all the attached movie by the reset button from newgrid2?
-----------------------------------------------------------------------
This is the method i used to attach movie from library
var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------
################################################## ##
this is the method i used to remove the clip
_root.reset.onRelease = function () {
_root.newgrid1.clear();
_root.newgrid2.clear();
removeMovieClip(newgrid1);
removeMovieClip(newgrid2);
for (n in _root)
{
removeMovieClip (_root[n]);
}
}
################################################
View Replies !
View Related
Removing A Attached Clip & Re-attaching Problem
I have a problem when I attach a movieclip from the library to the stage. It works perfect with all of it's variables and functions. But when I remove the movieclip and then re-attach it, the functions do not work properly.
This is the function that im using to make the roll over bar grow to the right:
Code:
function subSectionRollOverLoop(movieClip, speed, distance, callBack):Void {
if (speed > 0 && movieClip._width <= distance) {
movieClip._width += speed;
} else if (speed < 0 && movieClip._width >= distance) {
movieClip._width += speed;
} else {
//trace(getTimer() + " function subSectionRollOverLoop clearing interval in " + movieClip + ": " + movieClip.__interval);
clearInterval(movieClip.__interval);
if (callBack) {
callBack(movieClip, speed, distance);
}
}
}
function subSectionRollOverStart(movieClip, speed, distance, callBack):Void {
//trace(getTimer() + " function subSectionRollOverStart clearing interval in " + movieClip + ": " + movieClip.__interval);
clearInterval(movieClip.__interval);
movieClip.__interval = setInterval(subSectionRollOverLoop, 10, movieClip, speed, distance, callBack);
}
This is the button function to make the above code fire:
Code:
dog_btn.onRollOver = dog_btn.onDragOver = function ():Void {
dogRoll_mc._x = this._x;
dogRoll_mc._y = this._y - .5;
subSectionRollOverStart(dogRoll_mc, 30, 140, function ():Void {rollOverWhiteTip(146, dogRoll_mc._y);});
};
dog_btn.onRollOut = dog_btn.onDragOut = function ():Void {
subSectionRollOverStart(dogRoll_mc, -10, 0);
removeMovieClip(whitetip_mc);
};
Any help would be greatly appreciated. Thanks.
View Replies !
View Related
Removing Attached (linkage) Movie Clip
hi, need a help
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,
how can i remove all the attached movie by the reset button from newgrid2?
-----------------------------------------------------------------------
This is the method i used to attach movie from library
var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------
################################################## ##
this is the method i used to remove the clip
_root.reset.onRelease = function () {
_root.newgrid1.clear();
_root.newgrid2.clear();
removeMovieClip(newgrid1);
removeMovieClip(newgrid2);
for (n in _root)
{
removeMovieClip (_root[n]);
}
}
################################################
View Replies !
View Related
HELP Sub-clips Of Attached MC Not Recognized
I'm attaching a MC (modulecontainer) to my root timeline that has a prototype of a custom data object, as well as a new MC prototype for good measure.
The MC that's being attached has 2 empty mc's on it's timeline, iconClip and tbClip.
A loadmovie is executed on iconClip to bring in an external SWF. iconClip does NOT show up in the debugger, unless the loadmovie is executed.
tbClip is supposed to have several other MC's attached to it, but does not show up in the debugger at all.
Why would tbClip not show up as a subclip of modulecontainer in the debugger, like iconClip does?
Here is how I'm attaching modulecontainer:
code:
_global.openModuleTOC = function(targetmodule){
if("_level"+contentlevel.modulecontainer) { "_level"+contentlevel.modulecontainer.removeMovieC lip(); }
eval("_level"+contentlevel).attachMovie("modulecon tainer","modulecontainer",99,theCourse.course_modu les[targetmodule]);
}
View Replies !
View Related
Actions On Attached Clips
I have attached movie clip to _root and made prototype to use with it. Here is code:
on (release) {
MovieClip.prototype.xy = function() {
with (this) {
_x = 100;
_y = 100;
}
};
_root.attachMovie("clip1", "clip2", 0);
_root.clip2.xy();
}
My question is: How to assign action (on roll over,on roll out, on release...) to this movie clip?
(Using flash MX)
View Replies !
View Related
[F8] Help With Attached Movie Clips?
I'm trying to control an attached movie clip (button2_mc) which has been attached by a previously attached clip (button1_mc). Is this possible? What am I missing here? Here's my code below (on frame 1 of timeline):
PHP Code:
attachMovie("button1","button1_mc",1,{_x:50,_y:100})
button1_mc.onRelease = function () {
attachMovie("button2","button2_mc",2,{_x:100,_y:150})
}
button2_mc.onRelease = function () {
attachMovie("button3","button3_mc",3,{_x:150,_y:200})
}
View Replies !
View Related
[CS3] Attached Movie Clips Always On Top
I have a movie clip that is made up of several buttons. Which attach a movie clip to the root-think of this as the bottom. I have a movie clip that covers the bottom that goes on top after a user clicks-think of this as the top
My problem is that the attached movie clips from the bottom still go on the top. Is there anyway around this?
View Replies !
View Related
Duplicating An Mc With Attached Clips?
Well I haved combed the net and couldn't find a flat answer to my dilemma. Is it possible to duplicate a movieclip that contains dynamically attached clips?
Here's the code:
ActionScript Code:
// make an empty nested clip
this.createEmptyMovieClip("circHolder", 1);
circHolder.createEmptyMovieClip("circles", 1);
// attach the movies from library
circHolder.circles.attachMovie("circle","c1",1);
circHolder.circles.attachMovie("circle","c2",2);
// offset the clips
circHolder.circles.c1._x = circHolder.circles.c1._y = 100;
Now I want to duplicate the whole thing, reataining the dynamic content and keeping the attached movies intact?
ActionScript Code:
circHolder.circles.duplicateMovieClip("circleDup",10);
circHolder.circleDup._x += 100;
I have tried many variations of this but to no avail, can anyone shed some light on this?
thanks
-charlie
View Replies !
View Related
Moving Attached Clips
I've used this in two programs, and neither one works.
I attach a movie clip with attachMovie(); and in it I set the name to "char_mc" or something else.
Then I try to say char_mc._x = blah; and it does not move.
The code I use is on the main storyline. It does not work for _x, _y, _xscale, _yscale, and probably everthing else. When I trace for one of these values it says undefined.
Attach Code
_root.attachMovie("Picture1", "pict_mc", 1);
pict_mc._x = 20;
pict_mc._y = 20;
View Replies !
View Related
Accessing Clips I Attached?
Ok, I'm guessing there is an easy answer here but I can't figure it out.
I'm attaching a bunch of clips like this; (mainBut is the name of the class)
for (var i = 0; i<buttons.length; i++) {
var mc = "b"+i;
mc = new mainBut;
mc.tex.text = buttons[i];
mc.x = pos;
mc.y = -30;
addChild(mc);
}
So now how do I control the clips I've made? Say, for example, a button is supposed to tween one of the clips alpha's to zero, how would I adress the clip. I tried b0 and it didn't work. I hard partial success by pointing my button at 'mc' but that obviously only allows me to control the last button.
View Replies !
View Related
Removing All Movie Clips
Hi,
Can anyone suggest me a method by which i can remove all the movie clips that i had created using duplicatemovieclip command.i am currently maintaining an array of all the movie clips and removing all using the removeMovieClip command.but can i do it using a single command and avoid using the array of Movie Clips
Thanks
Jayant Chaudhuri
View Replies !
View Related
Removing Movie Clips
Hi all!
I am attempting to remove a series of movie clips created from a library item "Card".
The mc's are on root level, and the button to remove the clips is on level 1.
I have tried something like
for (i=0;i<25;i++) {
_root["Card"+i].removeMovieClip;
}
but with no luck!
Any help would be appreciated
Thanks
View Replies !
View Related
Removing Movie Clips
I was looking at the code in the Tile Based World Part 1 tutorial (http://www.flashkit.com/tutorials/Games/Tile_Bas-Steven_R-730/index.php).The main scene attatches a movie clip called "man", and a movie clip called "mapcontainer". Within "mapcontainer", it attatches several movies "wall" and "floor". Now from the "man" movie clip, I want to remove one of the "wall" or "floor" clips from the "mapcontainer" How do I do this???
(Did that make any sense?)
View Replies !
View Related
Removing Movie Clips
i'm duplicating a movie clip for a game. each new movie clip that is generated by the code gives a new name to each instance. for example:
original mc name: bomb
instance 1: bomb0
instance 2: bomb1
instance 3: bomb2
etc...
my question is, i want to remove the original movie clip that is being used to create all the new instances. so in the above example i want to get rid of the original mc named "bomb".
is this possible? i tried using removeMovieClip(), but it only works on the newly created instances. it won't work on the original one.
please help!!!
View Replies !
View Related
Removing Movie Clips...again...
I have a movie clip playing on level 22, a checkmark showing a question answered correctly...
when I prees the "next question" button to go to the next frame and next question, the checkmark is still there, on every frame I go to...
I have tried every remove code I could find on the searches here, and none work......
here is what i have....
on(release){
_root.gotoAndPlay("q2"); //my next frame
this.removeMovieClip(); //unloads current mc _level22.unloadMovie("check1");// does not work
}
View Replies !
View Related
Removing Clips - Newbie Here
Hi,
I have created a MC in which 3 MCs are placed. Each individual MCs has a button which makes it play. When I place these 3MCs in the first MC (I'll call it MAIN), and preview it, my 3 buttons react fine. Except, if I press button 1-MC1, it plays - then press button 2-MC2, plays fine also but MC1 is still on the stage and I don't want that.
I have tried on the button 2-MC2
on (release) {
MC1.removeMovieClip();
gotoAndPlay("boite blanche");
}
It does not work.... Please help Newbie here.
Thanks,
Luke
View Replies !
View Related
Removing Movie Clips ?
hi there...
im loading an external swf file in to an blank movie clip in my flash site...
the swf im loading in plays 100 frames then i want to rmove it...
on the last frame of the swf i put this code :
stop();
this.removeMovieClip();
but nothing happens it just stops and stays there
any suggestions
View Replies !
View Related
Removing Movie Clips
Code:
//Remove block
function removeClip(x, y) {
//Depending on the number, remove correct block
switch (_root.grid[x][y]) {
case 1 :
removeMovieClip("_root.block"+x+""+y.red);
break;
case 2 :
removeMovieClip("_root.block"+x+""+y.red);
break;
case 3 :
removeMovieClip("_root.block"+x+""+y.yellow);
break;
case 4 :
removeMovieClip("_root.block"+x+""+y.yellow);
break;
case 5 :
removeMovieClip("_root.block"+x+""+y.blue);
break;
case 6 :
removeMovieClip("_root.block"+x+""+y.blue);
break;
case 7 :
removeMovieClip("_root.block"+x+""+y.green);
break;
case 8 :
removeMovieClip("_root.block"+x+""+y.green);
break;
case 9 :
removeMovieClip("_root.block"+x+""+y.Rbreaker);
break;
case 10 :
removeMovieClip("_root.block"+x+""+y.Ybreaker);
break;
case 11 :
removeMovieClip("_root.block"+x+""+y.Bbreaker);
break;
case 12 :
removeMovieClip("_root.block"+x+""+y.Gbreaker);
break;
}
}
I have this code to remove an attach movie clip in a movie clip. I want it so that it will go into the movie clip depending on the x and y position on an array. I have tested that if I put _root.block120.red for example, it will work but I need it to pick depending on the array position.If you can tell me how fix this please help or if you have any ideas to do this please post. Thank you.
View Replies !
View Related
RemoveMovieClip Only Removing Some Of The Clips
hey, im having a little problem in my game on the first frame of the game i have this code
code:
for (i=2; i<=numEnemy; i++){
enemy1.duplicateMovieClip( "enemy"+i, i+100 );
}
for (a=1; a<=numEnemy1; a++){
enemy2.duplicateMovieClip( "enemy1"+a, a+100 );
}
for (b=2; b<=numEnemy; b++){
enemy3.duplicateMovieClip( "enemy3"+b, b+100 );
}
for (j=2; j<=numRock; j++){
rock1.duplicateMovieClip( "rock"+j, j+100 );
}
and using this code i get the following instance names on objects
enemy0
enemy1
enemy2
enemy10
enemy11
enemy12
enemy30
enemy31
enemy32
rock0
rock1
rock2
(dont ask me why theres no enemy2... cause im not sure)
now when i use that code i then want to remove all these MC's on frame 3 of my game (game over screen)
so i have this code
code:
removeMovieClip("enemy0");
removeMovieClip("enemy1");
removeMovieClip("enemy2");
removeMovieClip("enemy10");
removeMovieClip("enemy11");
removeMovieClip("enemy12");
removeMovieClip("enemy30");
removeMovieClip("enemy31");
removeMovieClip("enemy32");
removeMovieClip("rock0");
removeMovieClip("rock1");
removeMovieClip("rock2");
so i thought this would all work but then when it gets to frame 3 only
enemy0
enemy1
enemy2
enemy10
enemy11
enemy12
are removed and
enemy30
enemy31
enemy32
rock0
rock1
rock2
are still there, any ideas on how to fix?
View Replies !
View Related
Removing Move Clips
I have a movie clip by the name of coin. On hit test with char, I want the movie clip, coin to be removed forever. Even if you returned to that frame, i still want the mc coin to be gone. I tried using removeMovieClip(); but it didn't do anything. Help would be appreciated
View Replies !
View Related
As3 Removing Parent Clips
hi all, i am new to this as3 thing, so a little bit of a newbie question, which is pretty fundamental i think!
so in (the good old days of!!) as2, i was able to do something like this
Code:
//create a new mc
var m = createEmptyMovieClip("m",1)
//attach 2 mcs
var mc2 = m.attachMovie("main_movieclip","_mc2",2)
var mc3 = m.attachMovie("main_movieclip","_mc3",3)
so if i wanted to remove mc2 for instance i could just remove it, if i wanted to remove both mc's i could remove the parent movie 'm' and both the attached movie clips would be removed!!
so how do i replicate that, i have this in as3
Code:
var m:MovieClip = new MovieClip();
m = new headUp();
addChild(m);
m.name="b1"
m.x=100;
m = new h();
m.name="b2"
addChild(m);
m.x=200;
if i want to remove ' m.name="b1" ' easy, but if i want to try and remove both and try and remove the parent 'm' movie clip, only the last attached child would remove, in this case ' m.name="b2" '
so how do i remove both children in one go? surely removing the parent is the obvious method? do i have to attach the children at different levels?
I guess i am been stupid, but some advice would go down well here:-)
Thanks in advance Sam
(serial poster!!!)
View Replies !
View Related
Removing Movie Clips
I'm a begginer in flash and action script. I've created a movie in which some on stage animation happens until a frame with a stop() function on it.
on This frame I have a function that creates a bunch of child movie clips on a mouse event.
what would be the best way to remove them on another mouse event and how would I go about tweening them before removal.
so far my structure is as follows:
var stateQ:Boolean;
ActionScript Code:
button.addEventListener(MouseEvent.MOUSE_UP, createState);
function createState(e:MouseEvent):void
{
var mc:clip = new clip;
addChild(mc);
stateQ = true;
}
button2.addEventListener(MouseEvent.MOUSE_UP, createState2);
{
if(stateQ)
{
removal();
}
}
function removal();
{
removeChild(mc);
}
this doesnt work for obvious reasons being that if the mouse event hasnt been triggered the mc clip doesnt yet exist.
If someone can point me in the right direction it would help alot.
View Replies !
View Related
Removing Movie Clips
I am having trouble removing a movie clip from the stage, here's the code:
ActionScript Code:
onClipEvent (enterFrame)
{
if (this, hitTest(_root.car))
{
_root.createEmptyMovieClip("box", 1)
_root.box.loadMovie("option box.swf")
_root.box._x = 50;
_root.box._y = 100;
_root.warning.text = "You hit the person !";
this.removeMovieClip ();
}
}
Any suggestions how to fix this?
Thanks
View Replies !
View Related
|