ActionScript 3.0 :: How To Find Arr.indexOf(someVariable)
Oct 17, 2010
I can't get it two work. If I replace mySide with a hard coded movieclip name it works, but not with the variable. Am I missing something or just barking up the wrong tree?
var dots:Array = [north_mc.dot1, north_mc.dot2, east_mc.dot1, east_mc.dot2, west_mc.dot1, west_mc.dot2, south_mc.dot1, south_mc.dot2,];
var mySide:String = event.currentTarget.parent.name + "." + event.currentTarget.name;
I have a function that finds the smallest five numbers out of an array of values and returns their index numbers. Here's a block of code from that function[code]...
The whole thing is slow, but I imagine that indexOf() is probably the worst offender. Is there any more efficient way to correlate a series of minimum values with their indexes without having to use indexOf()?
The values don't necessarily have to be stored in _elements, but they're pulled from a multidimensional array so I figure that it's the most efficient I can get at the moment.
"what if i want to find all the what's in this sentence full of what's?" i cant do this with indexOf, and it wont work either with lastIndexOf, since there are 3... i'm trying to do a simple htmlText editor and got stuck in the part where i cant check the selected word's position only with indexOf...
When trying to do indexOf on a "static" array, it works, doing the same thing on an array populated with xml, i always get the result = -1Static Way
var myarray:Array = new Array("Pub Pepsi","Shadow E-Bike","Icon Air Craft","Test","La page 4","La page 5","La page 6","La page 7"); var myresult:* = myarray.indexOf("Icon Air Craft");
In ActionScript3 i wanted to get the text between 2 quotes from some HTML using a input index value where i would simply increase the 2nd quote characters value by 1. This would be very simple however i have now noticed using indexOf does not seem to work correctly with quotes and other special characters.[code]...
I have a list object and I'm adding items to it with addItem through the dataProvider.Before adding an item to the list I want to make sure it's not a duplicate. I've tried using indexOf on the dataProvider and it returns null. I've tried casting it to an array and it works, but always returns -1 even if the element exists in the dataProvider.The only method I've been able to use seems a little hacky and I'd like to know if there is a better way to find an element in a dataProvider.
I'm using the indexOf method to search for a substring in a String variable in Actionscript 3. The indexOf method allows you to specify a second, optional parameter - the starting position for the search. However, I'm not sure whether the position returned by indexOf is relative to the very beginning of the string, or to this optional parameter.
I need some help with validating a phone number. I want to check if the length of the number is ten chars and if the first number is a "0" and the second number a "6".[code]This only checks if there is a "0" and a "6", but not if they are the first and second char in the string.
I have a XML searcher thingy made and for the results in it I want to only display, lets say 50 characters to either side of the word that is searched. I am reading from a XML file and I am using indexOf to ge the current location of the word.
I am embedding the sowpods dictionary into an array in AS3 then submit searches using indexOf() to verify existence of the word. When I load a smaller text file it seems to work but not the larger. Since the file is embedded during compile, there shouldn't be an event for loading to listen to right?
Code:
package { import flash.display.MovieClip; public class DictionaryCheck extends MovieClip {
I`m trying to set-up a script that changes the color of a movie clip, depending on the current url of the page... My code is:
Code: var link = "http://localhost/v-v/indexSRP.php?kategorija="; var link2 = "http://localhost/v-v/index.php?kategorija="; if (_root._url.indexOf(link + "3") == 0) {
I must rejected all users outside Denmark from our live streaming (c-ip) and this is done in an access plug-insBut now I need to open up one of the streams, but I can't get the streaming name in the access-plug-ins only in the Auth-plug-ins.I cant use x-page-url or s-uri I need pStreamName. in access-plug-in like thissetStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);but I cant get it inside the access-plug-in
is there a way to find the index of the return character inside a dynamic text field?here is what i am trying for this example i have a dynamic text box on the stage with instance name "distractor_txt"
Code: stop(); var str:String = "this is my string with a return"; distractor_txt.text = str;
My problem is that the close button is going out of screen to somewhere after I made the gallery images fullscreen.It looked like this before they changed to fullscreen.. On right top corner you can see close and slideshow button etc...But after we made them fullsreen, the buttons are gone wide top right I guess. I can send the xml or .as files dont know which ones you need..
I've got two different domains and both of them direct to the same website. This website has a menu on top made in Flash (the rest is HTML, so the page must be reloaded everytime I click on an option or I need new content).
But this Flash movie has to show a different animation depending on the URL.
What can I do to find out the current URL in ActionScript?
I have a fla that does a few things before loading in a .flv file and playing this. All this works fine, now comes the issue.
I have to find when the player stops.
I have tested around with cuepoints as well as many other options and found this code on these forums, where at least my flv file is played through, but the buffer throws an error[code]...
I have a number of different buttons which I have calledred, blue and green (instance name)I want a piece of code that recognises which of the button red, blue, yellow and green has been chosen.note these are buttons and not radiobuttons.
I need to update the dynamic text in this flash file I have and export it to SWF. I've looked at the actionscript in all the frames and symbols but the only thing I've found so far are "stop();" 's
I tried exporting this to SWF to see if the file size was the same as the current working version on the site, and it was about 15kb smaller, and does not work at all.
How can I see all external file references in flash? I need to be able to tell my boss which files are needed or at least what is missing.
The only place where I used templet was in google, it was free, but not for commercial use, if someone know about a place where to find them, if they charge for one or for a year a don't know. and a good place.
I am trying to locate the letter at a certain number of characters after a word.For instance, in this sentence:"Hello, I really like dogs"I want to find the character of position 7 after the word "really", which in the above sentence would be the letter "d"