ActionScript 3.0 :: Search Through XML To Match ID?

Jul 9, 2009

I'm pulling news information from an XML file. The root node is "article", the child nodes are (for example) "date", "title", "caption", "copy", "link", etc.

Each time an article is added, a couple button (mc's) will be added to the stage. One button when clicked displays a movie clip and attempts to update the dynamic textfields within to display just the date and caption. The other button when clicked displays a different movie clip and attempts to update the dynamic textfields within to display all of the information noted above.

Being that this is dynamic and coming from an XML file, I want to avoid having to write if ... else statements for every new article (and each button).

Is it possible to search an XML document and scan for a name/ID match to create certain actions?

In other words, If I were to give an MC a name of "thisButton123" and also give an XML article node an ID attribute of "thisButton123", I could say something like if the currentTarget.name == any of these XML node attributes than pull that nodes content. Eliminating the need to compare/contrast names and ID's specifically.

View 4 Replies


Similar Posts:


Actionscript 3 :: Search A Very Long List Of Words For A Match In It?

May 16, 2010

For a word matching game, when a player moves a piece I need to check the entire dictionary to see if the the word that the player made exists in the dictionary. I need to do this as quickly as possible. simply iterating through the dictionary is way too slow.

What is the quickest algorithm in AS3 to search a long list like this for a match, and what datatype should I use? (ie array, object, Dictionary etc)

View 2 Replies

ActionScript 2.0 :: Type A Word In A Textfield And Have It Search For A Match Through A List Of Words In Xml

Jun 1, 2007

I'm trying to figure out how to get this started. I'd like to type a word in a textfield and have it search for a match through a list of words in xml. There would be 26 xml files containing a list of words starting with a letter of the alphabet.

View 2 Replies

ActionScript 2.0 :: Senocular XML Search Tutorial (search Query Case Sensitive)

Dec 3, 2004

I've just tried senocular's xml tutorials. [URL] The search query seems case sensitive. How to make it accept upper and lower case characters. Actually i'm trying to make a search by myself by using the same code.

View 6 Replies

ActionScript 3.0 :: Create A Search Field To Search Keywords In XML File?

Sep 6, 2010

I am trying to create a search field in AS3 to search keywords in a dynamic text field of the same flash movie, where the text is loaded from an XML file.

View 1 Replies

Search Function To Search For Button Names?

Jun 8, 2009

I've started a project a while ago, so far it is almost done but there is something that I seem not to be able to do alone... I would like to add a search function which I don't know how to do.It will not be a normal search function so I am going to try to beak it down with an easy example:

Let's say I did a project that is embeded somewhere in a normal html page with a main menu from where you can get to different city maps (e.g. New York, Paris, Berlin). The maps are seperate swfs. On all those maps there are several buttons for historical sites (or whatever) with a mousover function and a link to a page with more information about that specific site (on html).the names of the buttons are always a letter and a number (New York: "N1","N2","N3"...; Paris: "P1","P2","P2"... instance name for P1 is p1_btn)

What I need now is a search field in the main menu where you can search for those buttons. Meaning if I type in "N2" and hit search it will take me to the New York swf and show me button "N2".

I know this might not make much sense like this but the actual version is quite different and more complicated context-wise. Therefore if possible I would like to leave it that way with the main menu, the linked swfs and the buttons.

View 1 Replies

ActionScript 1/2 :: Develop A Search Box That Will Search Through The Titles?

Nov 23, 2011

I've got a catalog of events in XML that is read into my Flash swf. I'm trying to develop a search box that will search through the titles, descriptions, presenters, etc. and return a list of related events.
 
Does anybody know a prebuilt AS2 system that does this? Or a good tutorial on how to go about this? I have googled, but haven't found much.
 
Here is my approach so far. When I load in the XML I create an array of the frequency of all the words in the nodes that I'm interested in. I figured it would be useful to do this once instead of each time a search is performed. I store that word index in another array with an index that will take me back to the original node. I was trying to figure out if there was someway to put it all into one index, but then I'm not sure how I'd link back to the original nodes.
 
When performing a search I look through the array of word indexs and check for the word and return another array of which original nodes contain the word.
 
If the search term isn't represented I generate all the permutations of the word that have an edit distance of 1 -- i.e. that have a letter changed, added, or deleted in any position. So for example if the search is for "the" the list of 1-edit would be ahe, bhe, ... tae, tbe,... tha, thb...athe, bthe,...tahe,tbhe, ....... he, te, th. If any of those are found it returns the results and puts up a "Did you mean xxxxx?" type of notice.
 
So far all of this is working rather well.
 
I'm still working on figuring out what to do if the user puts two words into the search box.
 
Also haven't figured out what to do with plurals and other "stem" type situations.
 
I want to make this pretty simple and easy for people to get the results they want.

View 5 Replies

ActionScript 2.0 :: Google Search Is Always The Same Except For The Search Variables At The End?

Jun 16, 2003

Its mostly the way google is set up that makes it so easy. I just happened to notice that the url for a google search is always the same except for the search variables at the end. http:[url]....So all I did was to add a textfield to get the variable to put on the end of the URL. (And a button to press)

on(press){
getURL("http://www.google.com/search?q=" + inputText);
}[code].....

P.S. I am going to put this into a thread too in case any one else is interested.

View 7 Replies

ActionScript 2.0 :: How To Search Use Code To Search

Dec 21, 2009

How do i search use the code to search?e.g. From Zoo, To City Hall.The zoo(hv already create the flash animate to city hall)but the problem is how to write a code to point to zoo(action script)!

View 2 Replies

Actionscript 3.0 :: Search Function - Search Through The XML?

Jul 14, 2009

I've got a flash movie that reads in an XML file and has an input text box. When you type something in the input box, I want to search through the XML and return the names of the elements that match whatever is currently in the input box, even if its only partially complete.The input box has an event listener of type Event.CHANGE on it and it runs the following function.

Code: Select allfunction searchWords(e:Event):void {[code].........

View 7 Replies

Arrays :: Search Multidimensional Array (Flash As3) Using Another Array For Search Criteria

Sep 26, 2011

Long story short: I want to search a multidimensional array in AS3 for (in this example) the location of 6 strings - all of which are stored in another unrelared array. Long story long: Once I get the locations (in the multidimensional array) of each string, i then know where it's located, and can access other atributes of that object - so if i found the string "box3" is located in element [5] of my multidimensional array, i can now target: multiArray[5][3] to return the 4th item stored (keeping in mind we're starting from 0, so 3 is the 4th position).

I can get this to work once, but I'm trying to set up a for loop based on the length of my basic string storage array - this array holds (in this example) 6 instance name strings - each time my for loop loops, i need to run a search in my multdimensional array for the next consecutive instance name. Then, once I've located all of them (and store the results in a new temporary array) I can dig around in each location for the info I need.

[Code]...

View 3 Replies

Actionscript :: How To Get Value From Match

Dec 6, 2009

How to get value from match in ActionScript?

View 1 Replies

Swf Doesn't Match My Fla File

Jul 26, 2009

I have a problem in that I've made a web banner - text with motion and shape tweens. Trouble is when I test movie, it not only plays in a different font to the one I've used in the design (metaPlus normal) it misses out text!?I'm not getting an exact replication of what the fla file is.[code]

View 5 Replies

ActionScript 3.0 :: Match Two Arguments In One?

Jun 14, 2011

I have this piece of script, where I want to do a hittest when both the x AND y are not the same (and some other variables) now, that wouldnt be so hard, you think: if (MovieclipA.x!=MovieclipB.x && MovieClipA.y!=MovieclipB.y) but! if i now have a MovieclipC, which is on the same y coordinate as A, but not on the same x coordinate, the hittest wont execute..., as the y coordinates match...
 
it probably is really simple, but how can i solve this problem?

View 8 Replies

ActionScript 3.0 :: Use Reg Exp To Match Every Line?

Oct 11, 2011

I'm counting lines of codes in my flash builder project, and I try to use Search function Ctrl+H, and search how many lines in *.as file, and I failed to match with /[.]+/, how can this be done?

View 6 Replies

ActionScript 2.0 :: How To Match Variable A To B

Jun 23, 2010

I want to make a mail script. The user will enter the recipient's name, which is linked to variable "name". I've got a variable, EMAILA which is
ActionScript Code:
var EMAILA {
Cem : "cemgokmen97@gmail.com",
Muhittin : "gokmen@itu.edu.tr"
}

And on the SEND button, I have this code :
ActionScript Code:
on(release){
if(name){
getURL('mailto:'EMAILA[name]
}}

But for some reason when the mail client opens, the address does not appear in the "To" box.

View 6 Replies

ActionScript 3.0 :: XMLList Empty When Only One Match?

Sep 7, 2010

I have a problem with XML filtering. [code]If there is only one result, trace is empty. If there are 2 results or more, they will be traced fine. Is it because one result is not an XML 'list'? If so, how do I get the results if there is only one match?

View 2 Replies

Scale Swf To Match Browser Size?

Jul 17, 2010

I've created a website in Flash and have posted it to the net. I want it to scale as the user resizes the window, but having little formal training in Flash I'm not entirely sure how to go about it.

View 4 Replies

Regex :: Match Something With RegExp Between Roundbrackets?

Jun 25, 2009

I have this:

var regExp:RegExp = new RegExp("((.*?)%)");

and want everything between the ( and the %)the string looks like this: (-24%)I now get a return back "(-24" and have searched for a long time to find a solution but didn't find any.

View 2 Replies

Actionscript 3 :: Check An Array For A Match

Jan 12, 2010

If you have an array with six numbers, say: public var check:Array = new Array[10,12,5,11,9,4]; or public var check:Array = new Array[10,10,5,11,9,4]; How do you check for a match (of a pair?)

View 2 Replies

Actionscript 3 :: Comparing Two Bitmaps Against Each Other For Match?

Mar 25, 2011

I'm trying to position an image on top of another image based upon the make-up of the smaller image. The smaller image is a cut-out of a larger image and I need it to be positioned exactly on the larger image to make it look like a single image, but allow for separate filters and alphas to be applied. As the images are not simple rectangles or circles, but complex satellite images, I cannot simply redraw them in code. I have quite a few images and therefore do not feel like manually finding the position of each image every and hard setting them manually in actionscript. Is there any way for me to sample a small 5-10 sq. pixel area against the larger image and set the x and y values of the smaller image if a perfect match is found? All the images are in an array and iterating through them has already been set, I just need a way to sample and match pixels. My first guess was to loop the images pixel by pixel right and down, covering the whole bitmap and moving to the next child in the array once a match was found, leaving the matched child where it was when the perfect match was found.

View 4 Replies

Actionscript :: Matching Traces Don't Actually Match

Sep 28, 2011

i'm itterating thru an array of text field objects and tracing the selected focus field when pressing tab, as well as each object.i'm trying to equate these object, but while they trace the exact same they are not.

m_InputFieldsArray = new Array(m_TitleTextInput, m_CommentsTextArea, m_EmailTextInput);
for (var i:Number = 0; i < m_InputFieldsArray.length; i++)
{
trace("Get Focus: " + Selection.getFocus());

[code]....

the first group traces the same, but apparently they do not match. Selection.getFocus() returns a string, while the array index is tracing the text field object. if i add toString() to the text field object it will trace as [Object object] how can i accomplish a match?

View 2 Replies

ActionScript 3.0 :: .match - How To Find First Index

Aug 9, 2011

I am stuck with a string search

ActionScript Code:
var str:String = "this is better than what is better.";
var pattern:RegExp = /this.*better/gi;
var results:Array = str.match(pattern);

I want to search in a string from word1 to word2 and place all the results in an Array. So this should be accomplished using match().However the above code would return " this is better than what is better" while it should return "this is better". So the output takes the last match in the line, but I want it only to output till the first match in the line.

View 4 Replies

ActionScript 3.0 :: How To Match Substrings Accurately

Mar 14, 2010

How to match substrings accurately?eg: I wanted to search whether any pronouns like he, she etc are present in a string say input.Where is he?Here I wanted to find whether the pronoun 'he' is present. But since the where contains the substring 'he' I can't get the result properly.I tried with RegExp and arrays and strings; using match(), search() indexOf(). They all do it the same way.My RegExp pattern is as below:

Code:
var pronouns:RegExp = /(i)|(me)|(us)|(he)|(him)|(she)|(her)|(it)|(they)|(them)|(that)/;

I wanted to find for eg, strings like

He is alright
Where is he
She is there
Who is it
I know them

In the above sentences I wanted to get the position of where the pronouns 'he' 'she' 'it' 'them' etc occurs.Why because if it occurs I wanted it to replace them with another words.

View 3 Replies

ActionScript 2.0 :: CS3 Match XML Attribute Name To Text Box Instance Name?

Jun 26, 2009

I have a list of items in XML that populate dynamic text boxes using the code below. I basically reference an attribute in the XML element to a specific instance name on a text box.

This works great for a few items, but I need to do this for several hundred, perhaps a thousand, items in an XML. Rather than copy & paste my code for each item and call out each specific text box and attribute value, is it possible to modify this code to match an instance name to the XML attribute value? In other words, one set of code that says "if the text box instance name is "x," provide the price of "x" from XML, but if the name is "y," provide the price of "y."

My xml code (3 item sample):

PHP Code:

<products>
<info_source id="SQL">
<item id="apples">$1.00</item>
<item id="oranges">$2.00</item>

[Code].....

View 4 Replies

ActionScript 3.0 :: How To Match / Track Object In Video

Jul 19, 2009

I've got a video with a black rectangle that moves, tilts and zooms...is there any way flash can match an object to that? (for example, if I want to put an image over the black box?? Is there any way to detect where objects are in a video from flash? I've seen some things with web cams where snow collects on people in the cam, etc. so there's got to be some way to "find" things.

View 3 Replies

Match Up Shape So It Vibrates To Sound On Rollover

Mar 1, 2011

I'm trying to match up a shape so it vibrates to the sound on rollover.On rollout I'd like it to slowly deminish the vibration as the sound deminishes too.I've experimented with a number of functions with out success.I've included the source code i've been working on, Should the source file be required I will supply it on request.[code]

View 4 Replies

X And Y Coordinates Do Not Match For Dynamically Generated Movieclip

Aug 6, 2011

I have a movieclip that I am adding to the stage dynamically. The movieclip has to be placed at specific coordinates to match the current text field.The coordinates that show on the INFO tab are x=264 and y= 365. However, in order to get the movieClip to match those I have to set x to 398 and y to 200.If I set the coordinates to those in the INFO tab then the movieclip does not show; it appears off stage.

View 2 Replies

ActionScript 3.0 :: The Package Does Not Match The File Path

Apr 20, 2010

The package does not match the file path

View 4 Replies

ActionScript 1/2 :: SlotMachine / Match Game Scoring

Sep 24, 2010

I am working on a game that is set up like a slot machine. The first box contains a name, the second box cotains a piece of information about the person and the third box contains another piece of info. Each box has a movie clip in it that contains 10 frames, each frame has text in it (a name or piece of information). There are up and down arrows above the second and third box as the user can control what piece of info is in that box using the arrows (if the user clicks the up arrow they go up 1 fram to different info....if down down a frame to new info.) The first box is not user controled, it has a button that randomly generates the name the player is given with a spin animation.
 
The goal of the game is to match all three boxes the random name with the 2 user controlled pieces of info. If this happens I want the player to receive 20 points. However, if the player only matches one of the pieces of info to the random name then they should only get 10 points. If they do not match ny pieces then no points are awarded.

I figured the best way to do this would be to give the corresponding correct answers and names matching variable names and set it so if you have 2 matching variables you get 10 points and if you have 3 matching variables you get 20 points (no points awarded for 1 variable because 1 variable alone would be the name). My problem is that I dont know how to assign a frame a variable number and I also dont know if its even possible to do something like this. Am I on the right track or is there a much better way to set up scoring?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved