I'm doing a drag and drop type interaction. When the user drops an mc on another mc it will reveal a hint on screen. I want to determine the hint to display by the number contained in the _droptarget name (dragObj_mc1, dragObj_mc2, dragObj_mc3 etc). I'm then splitting that string into an array, converting each index back to a string and using indexOf to determine the number. I've got the following code which works but there must be a better way
Is there a way of telling a null value in the _droptarget property?
Basically I've got 9 draggable objects, and what I want them to do is if there is no _droptarget when you release the drag, flick back to it's riginal position.
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?
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.
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?
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.
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.
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?
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.
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.
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
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.
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?
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)
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.
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.
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?
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?
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?
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"?