ActionScript 3.0 :: Finding A MC And Removing It
Jan 8, 2009
At some point I will have created a MC on the stage. Later on, I want to put a different on in its place. The original MC may, or may not, be there.So I need to first check and see if it is there, whack it if it is, then add my new one.I know the name of the variable I used to create the MC, but I think the problem is I did this from INSIDE another clip. When I am trying to find it and remove it, I am outside that clip, so I don't think the main timeline knows of that variable. So when I try:if(ribbonEGM) removeChild(ribbonEGM);[code]How can I test and remove the ribbonEGM clip from the main timeline?
View 9 Replies
Similar Posts:
Feb 8, 2008
finding a good swf to fla converter. I would love a trial version that lets me actually see the action script.
View 1 Replies
Mar 7, 2011
I need to find an instance of a movieclip that is on my flash file. It is really big and uses a lot of memory. It says on the number of times used that there is one instance of the object on the flash file, but I can't find it. I thought I deleted them all but there must be one left. How do I go about finding it? It's a really large flash file with many layers, and I don't want to just delete the library file. Is there any way I can find where the object is placed in my file?
View 2 Replies
Apr 18, 2011
I'd like to use the x and y mouse coordinates as variables in a program. I'm very new to Flash and ActionScript and I'm not even sure which classes I need to import or which listeners or handlers I need to use.
View 1 Replies
Oct 24, 2011
I am interested in finding a good swf to fla converter. I would love a trial version that lets me actually see the action script.
View 2 Replies
Oct 16, 2009
We have a client server architecture where a C++ server talks to Flash clients. I'm developing the server and would like to send through tcp an xy coord to simulate a button press where the receiving flash client would find the topmost visible object at that coord and send a mouse event to it such that we could simulate play without a human present. I'm told this is incredibly difficult, but it seems to me that there must be a way to do this. Am I off the mark? Or is there a mechanism in flash to iterate through all objects regardless of parent child relationships to find a visible button at an x, y coord and signal a press event?
View 2 Replies
Feb 11, 2011
I am studying CS5 but I can't find help files or tutorials... is everything online now? Where should I go for help?
View 3 Replies
Dec 13, 2011
This should be a simple one. I am running an IF statement that needs to check the 5th value in a pre-populated array. I'm finding it hard to find the right method of searching the array.
[Code]....
indexOf seems to just return where the value is...but I already know where it is! I just want to know WHAT it is! There will also be values that are exactly the same in other positions in the array. I have to focus in specifically on the 5th value.
View 3 Replies
Sep 2, 2010
I have a flash app hosted at The contents of that crossdomain.xml file are as follows:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
[code].....
View 2 Replies
Mar 18, 2011
I need to break a number down to be represented by a randomly ordered sequence of 2s and 3s.[code]I'm currently doing this with a loop in ActionScript 3 but have been looking into the possibility of using some kind of mathematical formula to save me a few lines of code. I'm a bit of a sop when it comes to Math and I've not yet found anything suitable.
View 4 Replies
Jun 25, 2009
Does anybody know if there is a command to say: x= biggest value out of a,b,c,d,e ( without using an if )
View 2 Replies
Jun 30, 2009
I have to find a node value in my xml, and where is this childnode there to reading the block.
[Code]...
View 0 Replies
Oct 6, 2011
I have made a few posts now, and I'd like to especially Prid for not only answering them, but for giving me guidance on how to learn AS2. I am progressing very nicely, and have made a couple of simple games without any tutorials, but theres one thing I couldn't find. I have this character which can move, up and down, left and right. I also have an enemy trying to shoot at him. However, this enemy needs to know where the character is. I already have the shooting code (Prid), but it was for shooting in the direction of the mouse. What I need now is to replace the bit of code that finds the mouse coordinates with code that finds the coordinates of the player.
The shooting code is on the frame (doubt that is important to say, but still) and the instance AND name of the Character is, well, Character. So basically, I need a code to calculate coordinates of a movie clip that does not have a fixed position. Oh and one more thing, should I post simple stuff like this in the beginner section, because I've seen waaay more complicated stuff there than in the AS2 section.
View 9 Replies
Feb 4, 2012
My main loads an external swf. Then it creates a bunch of ball movie clips on the stage. I need to reference the content from labeled frames in the external swf. In AS2 all you had to do was use _level.
View 6 Replies
Nov 24, 2004
I am having trouble in finding target in a drag drop scenario. I have a movie placeholder named onepic1 and i load a movie using
Code:
onepic1.loadMovie(this.img1lnk);
[Code].....
View 1 Replies
Aug 26, 2005
I am wondering if Flash has a built in way of finding if a value in an array exists. IndexOf only works with string values, but I couldn't find any function that tries to find a value of any data type in an array.
If there isn't one, I will just end up using this:
Code:
contains = function (array, input) {
for (i=0; i<array.length; i++) {
if (array[i] == input) {
return 1;
}
}
};
I am trying not to use my own functions for things that Flash already has built-in, so I just want to double check with you all in case I missed something
View 14 Replies
Apr 17, 2007
Is there a way in AS 2, to figure out where a swf is embedded, without the use of FlashVars? I have a widget that is being embedded on different sites, and some sites disallow the use of flashvars.I'm trying to figure out all of the sites that my swf is embedded on.
View 1 Replies
Aug 15, 2007
When I drag a movieclip from the library and create an instance on stage I can select it and look in the properties to see what it's an instance of. If I create the instance dynamically using attachMovie, how can I find out what it's an instance of?
View 5 Replies
Aug 13, 2008
I have a shape and I want to find out what the highest y value is for an x value.Example: I have an oval, and with width 200 px. I input an x value like 78 px from the left and I want to know what the highest y value is that matches the x value (the top of the oval at point x)
View 3 Replies
Apr 18, 2010
I'd calling out
trace(this.parent.numChildren);
which returns me "2". Now, when I call out
trace(this.parent.getChildAt(1));
it returns me "null".
What is the problem as there are two movieclips in the parent called "sb" and "content".
View 1 Replies
Jun 21, 2010
I have to resolve a problem I encounter to find the equivalence between menu links and displayed pictures. (in order to highligh the good menu name) how I can find and trace which MC is on top of a defined layer. All these MC were created dynamically from an Array.
View 2 Replies
Sep 12, 2011
how to find the Num of Children in a particular case, as below. I am trying to figure out how many birds are there at a particular time, so that I may control their growth.
Code:
var timer: Timer = new Timer(500, 45);
timer.addEventListener(TimerEvent.TIMER, timerFunc);
timer.start();
[Code]....
where to use "parent", "this", and "root" etc. it can help me for the future as well.
View 5 Replies
Nov 24, 2004
I am having trouble in finding target in a drag drop scenario. I have a movie placeholder named onepic1 and i load a movie using
Code:onepic1.loadMovie(this.img1lnk);I load the img1lnk variable externally using
Code: img1lnk=onepic1.swf The SWF loads into the placeholder, NO PROBLEM in that!
And I identify a dragged object into that movie using
[Code]...
View 1 Replies
Apr 2, 2009
What should I use to test my swf movies on another (not my development machine) ?When I open them with IE or firefox the Flash active x player doesnt have the zoom 100% option so I end up with distorted (resized to window) swf is there a standalone flash player for that kind of purposes or something?
View 1 Replies
Aug 17, 2009
So, I have a dynamic text box, which, naturally, being dynamic, changes. What I would like to figure out is how to tell when the changing text is larger than the textbox holding it. Of course, just because it is a certain number of characters long doesn't mean it will be larger than the textbox holding it. Twenty of the letter "w" is larger than twenty of the letter "i" So, is there a way to tell if the textbox isn't large enough to hold its text?
View 5 Replies
Oct 4, 2009
Let's assume that I've got 3 instances of a movie, each labeled team1, team2, team3. In this movie is a BUTTON (named buttonTest) and a TEXTFIELD(teamReply).
I'd like to write a function in the root that the event listener from the button within the movie would call on, but how do I find out 'which button' was pressed dynamically in order to send a line of text back?
For example: if the team2.buttonTest button was CLICKed, how do I pass that information onto the function to tell the function to send the text BACK to that same movie?
View 1 Replies
Nov 25, 2009
So how do i go about using something like indexOf() on a multilevel array? for example, lets say i have the following array:[code]how do i find the index of lets say "tree 1 data 2"?
View 4 Replies
Apr 10, 2010
is there any way of searching a string from right to left and trying to find the first occurrence of like a letter or a fullstop or something like that? also is there any way of finding the index of were its located and then deleting all characters from left to right starting at what ever index value was returned?
View 2 Replies
Jun 18, 2009
I am writing a Flash object which will be an on-line quiz. I got most of it working ok, but it reads the questions sequentially from an xml file. I want it to be random. Each record in the xml file has an 'ID' attribute. This is my code that currently reads the questions in sequential order:
var question = new XML();question.ignoreWhite=true;question.load("Questions.xml");
question.onLoad=function(){ question_txt=this.firstChild.childNodes[_root.record].attributes.ques tion; answer1_txt=this.firstChild.childNodes[_root.record].attributes.answe r1;
[Code]...
There are 300 questions in the xml file. I want to assign a variable with a random number, then look in the xml file for the question which has the ID attribute matching the random number. How do I achieve this?
View 5 Replies
Jan 15, 2010
I have a swf that I am letting people embed on their sites.
From within the flash file, I'd like to find out the url or at least domain for the page where the swf is embedded.
Can this be done without javascript?
(If not - suggestions for javascript solution?)
View 1 Replies