ActionScript 2.0 :: Remove All Movieclips When Not Equal?
Aug 1, 2008
trying to hide all submenu's when not equal to the current
Code:
function removeAllOtherMenus(mc) {
trace("remove movieclips not equals: "+mc);
for (var i = 1; i <=3; i++){
[Code]...
but it keeps tracing all subsubmenu_mc (that is subsubmenu_mc1, subsubmenu_mc2 and subsubmenu_mc3 when mc = subsubmenu_mc2)
View 1 Replies
Similar Posts:
Sep 2, 2004
Can I make a variable equal two movieclips? Like:
nav1 = _root.nav.nav1 & _root.map.map1;
And then run a function that would control both? Like:
function closeout() {
nav1.gotoAndStop(3);
}
View 6 Replies
Nov 10, 2005
how to duplicate a MovieClip 10 times using 'duplicateMovieClip'& place each instance of the new clip with equal spacing when the frame starts.. instance name of my MC on stage i.e. to b duplicated is bt_mc & it is the y position i.e is to b changed.
View 12 Replies
Sep 11, 2010
if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child?
In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.
If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.
View 29 Replies
Aug 27, 2010
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{
var id:int;
var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
View 2 Replies
Jul 12, 2010
I want to remove movieclips that have been named by a variable using a button:
this works where I actually name the movieclip (underlined bit)
removeMovieClip(_level0.canvas_mc.object1)
but if I try to remove the clip where the (object1) bit is a variable - nothing happens.[code]...
View 5 Replies
May 19, 2011
I want to remove two movieclips at once, with one function but I can not get it to work.
Code:
function createLightBox(){
var ol:overlay = new overlay();
ol.scaleX = stage.width;
[Code]....
With the above code I am only able to remove the ol movieclip, I need to remove the lb movieclip as well.
View 7 Replies
Nov 9, 2009
I've created an XML thumbnail gallery, and would dearly love to add a simple looping preloader animation to each of the thumbnails whilst they are still loading. I'm struggling to remove the preloader movieclip, once the corresponding image has been loaded.
I'm currently creating the new movieclips within the loop, so I'm having problems referencing them in the following load complete function. I gave naming the "spin_loader" instances a go (i.e. spin_loader.name = "spin" + i), and then trying to remove it in the "thumbLoaded" function ( i.e. project_mc.removeChild(getChildByName("spin" + spinNum)), where spinNum is the equivalent number to "i"), but I just can't seem to crack it.
Code:
function createThumbs()
{
for (var i:Number = 0; i<my_total_project; i++)
[code]....
View 2 Replies
Apr 8, 2010
I am making a website with complete external xml data holding text and urls to images. I have several categories. One of the category has three sub categories as menu. When I click btn1 it gets the xml and start making text field, rectangles, lines and picture frame for thumbnails. Before that I use a single movieClip container to hold all that stuff and then point it to mask and scroller too.That is working fine. Now the problem is that when I click on btn2 I want to remove previous container and make a new one.
Now what happening is that it is creating one more container of different xml and putting over the previous one. I have used removeChild command and it is still not working. It only works if I use it alone and do not create a new container. All this process is done on a movieClip. That movieClip holds container, mask and scroller. The only thing that is made dynamically is the container. Rest of the items are on the timeline of the movieClip. I need to remove container inside of the movieClip and make a new container inside the movieClip.
View 9 Replies
Jan 11, 2009
I have a slider on my stage that returns a number between 0 - 300 depending on where the user moves the slide.What I would like to do is add and remove movieclips as the user slides the slider so that the number of movieclips on the stage is proportional to the slider's value.An example: If the slider value is 300, I want 300 circles on the stage. As the slider moves down to zero, the number of circles on the stage decrease.I've been trying to think of the best way to do this. Should I use addChild and removeChild? Or just change the visibility?And what would be the best way to refer to each movieclip? Should I use an array? Or maybe an if/else statement?
View 4 Replies
Nov 19, 2009
I have a movieclip, let's call it MC1. Inside the actions timeline of MC1, I create a loader and when a button in MC1 is clicked, the loader is added to the stage with an image.
On my maintimeline, you can click a button to bring a second movieclip onto the stage, let's call it MC2. MC2 has the same set up as MC1 where you click a button within MC2 and it adds its own loader with an image to the stage.
The problem is, when I click on MC2, MC1's loader is still on the stage, and I'm having trouble getting rid of it! I tried removeChild(loaderfromMC1) within the actions panel of MC2 but it can't reference variables created in MC1? and I tried removeChild(loaderfromMC1) when the button on the maintimeline is clicked, but it seems that I still cannot reference the MC1 defined variable.
View 1 Replies
Oct 2, 2007
I have made 4 arrays and filled the with movieclips using the array.push(movieclip) method. I have then made a function that is supposed to remove everything in those arrays. This is the code for it:
[Code]...
But when I call this function it does nothing but remove p1s, p2s, p3s and p4s. Also when I type trace(s) in one of the for loops, it outputs 0 for some reason.
View 6 Replies
Jun 10, 2009
I need the correct as to remove 3 movieclips from the stage at once. I can sucessfully remove a single clip using
reels_reels_btn.onRollOver = function(){removeMovieClip("musicvideo_dd_nav_mc");}
tried
reels_reels_btn.onRollOver = function()
[code].....
View 3 Replies
Jan 16, 2009
I have a sprite
Code:
var holder:Sprite = new Sprite();
I then add lots of thumbnails into this sprite from a loop
[code].....
View 9 Replies
Apr 19, 2010
The problem is that this code is in a frame and when I leave the frame the MovieClips I have created will still be there. I think this is because I'm creating a global MovieClip right? If so then is there a way to declare the MovieClips as local? [code]...
View 4 Replies
Aug 9, 2005
I have a for-loop that creates instances / duplicates of a movie clip that works like a charm:
[Code]...
Then I position each instance- and I fill an array with the number ("pg"), because: I also have the option to switch to a different view and at that point I want / need the MoveClips to disappear. So I have a function tied to the switching that goes through a loop for all instances of the movieclip copies (using the array with the IDs from the example above) and remove them.
[Code]...
View 1 Replies
Sep 5, 2005
I want to make a function that will remove every single mc symbol I've previously attached to a "mask" movieclip. So i created this:
removeAll = function(){
for(a in _root.mask){
a.removeMovieClip();
}
}
I thought if i do that itll remove each "a" it encounters but I guess I'm missing some part of that "for..in" syntax. Not sure how that works.
View 1 Replies
May 4, 2011
So i have this flash game with couple of different scenes And im trying to remove all of the movieclips when the scene ends because i keep getting a loop of errors, for example this one TypeError: Error #1009: Cannot access a property or method of a null object reference. at BlobBobScenes_fla::MainTimeline/star() I have tried removing these
[Code]...
View 4 Replies
Mar 7, 2004
How would I go about writing a function that looks at an mc (empty mc) and deletes any attached movie clips (if there are any).
View 11 Replies
Mar 5, 2009
I have a tower defence and when you lose I have a button to go back to the main screen. Only problem is that I cannot find a way to remove the enemies from the screen as well. Here is all of the code for the game, because I figure I might as well give you everything now, than later. I also wanted to give you all my variable names that would be used...
Code:
stop();
// Params = Number, Health, Speed, Time between releases, Gold per creep);
_root.waves = [[10, 50, 2.500000E+000, 2000, 2],
[code]....
View 3 Replies
Jan 20, 2009
I have a flash movie in which I've created something that functions similarly to a calculator. When the user clicks a button, depending which button was pressed and in which order, a series of movie clips is displayed from left to right in specific positions, using addChild. I have a button on the calculator which I would like to have function similarly to a 'clear' button on a real calculator. When clicked, it would remove only the movie clips that were displayed by clicking the calculator buttons. how I can remove only the movieclips that are part of the calculator display? Here are some
code samples.
var mcSelection:MovieClip = new MovieClip();
//check to see how many times a calculator button was clicked
function checkTime()
{
[Code].....
I've tried different variations of removeChild and removeChildAt, but either parts of the calculator are getting removed, or I remove the parts of the display one clip at a time instead of all together, or I get out of range errors. How do I target a certain range of movieclips to remove? Do I need to assign a specific range of levels when the new movieclips are added and then remove that range? It will be different number of clips and combination of clips every time.
View 10 Replies
Apr 28, 2010
I met a problem Error#1009 when I want to remove some movieclips from the stage
for(var g:Number = 0; g<10; g++){ var ClassRef_RG:Class = Class(getDefinitionByName(classNames_G[Math.floor(Math.random()*class Names_G.length)]));var classInstance_RG:* = new
[code].....
View 9 Replies
Apr 7, 2010
i followed this tutorial: http:[url]....and all has work out great however, then i go onto anouther frame how do i remove all movieclips from the created game arrays?
View 3 Replies
May 16, 2010
I've managed to add a bunch of movieClips dynamically from the library. But I don't how I can remove them ALL dynamically now.
I'd like to be able to remove all the buttons, and then add a new lot in afterwards.
Here's what I have so far:
It's not a syntax or a collision error,
Code:
var myBtn:myButton;
// I have a movieClip in the library with the linkage: "myButton"
function addButtons ():void {
[Code].....
View 3 Replies
Jul 26, 2009
I need to remove some movieclips that are attached dynamically so they do not show up underneath the new movieclips that will be attached when a user clicks the next button. I've tried removeMovieClip with little success. I am able to remove one or two of them, but not all. I need all of the previously attached movies gone.
Here is the as2 for it.
PHP Code:
//Set functions
function show_movie() {
menu_mc._visible = true;
buttons_mc._visible = false;
teacherinfo_mc._visible = false;
} function displayInfo() {
[Code] .....
View 4 Replies
Jul 13, 2011
I have a movieclip, let's call it "myMC", that is very long (5,000 frames) over the course of which many dozens of nested movieclips are added/removed as children to/from "myMC".Without reference to the nested clips, is there a way I can add a listener to myMC and listen for when an object is added/removed from it (something along the lines of Event.ADDED)?
View 2 Replies
Aug 14, 2009
Basic problem here. I'm adding a bunch of movieclips using the addChild method. I simply want to remove/hide/fade them after a button click, but I am unsure of how to refer to the movieclips which I've just added.
Here is the code as it stands:
Code: Select allimport gs.TweenLite;
import gs.easing.*;
var strip:Bgstrip;
var contentBg:ContentBg = new ContentBg();
contentBg.x = 440;
contentBg.y = 166;
addChild(contentBg);
[Code] .....
View 1 Replies
Dec 25, 2011
If I have 5 frames and each contanins a MovieClip on stage that includes it's class, listeners, functions etc.If I go from one frame to another,should I clean everything up? I mean remove listeners, remove childs etc etc.Or other MovieClips except those in the current frame are ignored from flash player.
View 3 Replies
Feb 9, 2009
what does 9.2 x 100 equal to? it equals to 920. in actionscript 2 ,it shows the right result while on the other hand, actionscript 3 shows 919.9999 .
View 6 Replies
Dec 10, 2010
is it possible to make a comma (,) to equal (.) in as3?
example:
now i write
2.31 + 4 = 6.31
so it's possible to write
2,31 + 4 = 6,31
View 6 Replies