ActionScript 2.0 :: Loading XML Words Into Array?
Jul 11, 2009var answer_array:Array = new Array();
var wordsLoader:XML = new XML();
wordsLoader.ignoreWhite = true;
[Code]....
All of the values in my array are coming up "undefined".
var answer_array:Array = new Array();
var wordsLoader:XML = new XML();
wordsLoader.ignoreWhite = true;
[Code]....
All of the values in my array are coming up "undefined".
I have a sentence that's basically items from an array, and I have this line that when I type one of those words on it, that word is removed from that sentence/array. And I'm having trouble coming up with a function, I'm trying to make it an if statement.so far I tried: and I know I need to put splice in, but this is just to see if it works or not.
ActionScript Code:
if(enterWordLine.text == sentenceLine.text)
{
[code]......
I want something where I click a button, and it replaces words with other synonyms automatically. My thoughts are:
set up array
(array1=array2)
array1="word1","word2","word3"
array2="word1","word2","word3"
search text for word in array1
if find in text= word in array1
replace with random word in array2
Would anyone know how to set this up, or point me in the right direction?
I have a text file that has a large list of words. Each word is on its own line but has no commas or any punctations in between.Can I turn this file into an array with each word being a string in the array?Can I do this without manually putting commas in between each word?
View 1 Repliesis it possible to have an array of words, and then, with another set of code, to have those words randomly animating (perhaps from the distance, to closer up, like a zooming non-blurred effect) on the stage?
View 3 RepliesIs it possible to split a string like "Lorem ispum dolor, sit amet. Howdy doody." into an array of words without commas and periods, in one operation?I've tried words:Array = startString.split(String.fromCharCode(32,44,46));i guess the reason my example doesn't work is because it searced for " ,." to split the string.
View 6 Repliescreating an array of words from a string?
View 8 RepliesHow do I create an array of strings from a string, eg."hello world" would return ["hello", "world"]. This would need to take into account punctuation marks, etc.There's probably a great RegEx solution for this, I'm just not capable of finding it.
View 7 RepliesI need to flash a series of words for 2.5 seconds with a pause for .5 seconds. The words are drawn from an array that is assigned, but I need to have these words flash in a particular order.For example, if the "words" were A, B, C, D, E (each of which I've assigned a stored value), I might need to show A C E B A A F.
View 3 Repliesso i search for keywords ofc, but...doing this isn't really my thing:input.text.indexOf("spam") != -1 && input.text.indexOf("more") ! -1 && ... etc
I'd like to make it some what like:input.text.indexOf(<database>) != -1
I have a flashcard application that i am in the process of process of converting from AS2 to AS3.
i have managed to load the XML but need some help loading it into an array.
Here is the XML:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<flashcard>
<card number='1'>
<question>Is red a color</question>
[Code].....
My problem comes right at the end when i try to load the XML into the cardArray,
My first loop works it load the node the second seems to erase the array for some reason when I trace it. can you tell me where im going wrong here.
[Code]....
Anyway, I want to do something really basic and simple. I want to have a word fade in then fade out. Then another word in another place fade in and fade out.
View 1 RepliesI have a page that I'm trying to build that has a scrolling image bar at the bottom but I want to also show the full size image in flash above the images that come up in the thumbnail array when you mouse over each image in the array. I found some code that makes the thumbnail array work but I have no idea how to display the second larger image on mouse over because its loading the images externally... what can I do? Feel free to email me back.
View 1 RepliesI can use the following code to load in a specific swf:
var clips:Array = ["001/001.swf"];
but how do I tell Flash to load whatever file is in the 001 folder without stipulating a specific filename?
I am trying to develop a way to load and unload pictures and zoom in to them in a dynamically way. This is done with the idea to save space in memory for further use. I was helped by Dawsonk a while ago and we came to this code:
[Code]...
Ok so i have an array of text from diffrent users that gets loaded from a database into flash here is the actionscript:
ActionScript Code:
var varSend:URLRequest = new URLRequest("http://kubassa.limewebs.com/kubassa/scripts/array_test.php?action=readShouts");
[code].....
how to load an array from a .txt file into my flash presentation. The point is that people need to be able to edit a list of products without needing the .FLA movie (or they will mess it up).
The .txt file looks as followed:
PHP Code:
[["Company1","3"],["Brandname1","Productname1","Productname2","Productname3"],["Brandname2","Productname1","Productname2"]],[["Company2","4"],["Brandname1","Productname1","Productname2"],["Brandname2","Productname1","Productname1"]]
And this is where I want it to be. But I know I can't just open a file and put it down there, so does anyone have a suggestion how to do this?
PHP Code:
var LIST:Array = [ *SHOULD BE IMPORTED HERE*];
Right now I am working on a game where I need to have 19 pieces revolving with 19 different MCs in them. The code I have can accommodate the movement and 19 pieces, but how to get 19 different ones in there - just one with 19 duplicates.
I thought if I addressed them in an array, I could tell my emptyMovieClip to load them into itself with individual MCs. I'm sure I'm on the right path, but it's not working yet.
My array:
anames = new Array (mcAnniePiece,
mcAlbertPiece,
mcAshleyPiece,
[Code].....
ok so i have this array from which i wanna fetch names of the XML files i want to load in their XML object, so i write like this but it doesn't work.[code]
View 2 RepliesI have an old gallery that loaded a set of pictures and swf's from a folder using an arrayarMedia = ["clip2.swf", "image01.jpg", "clip2.swf" .. etc ...];I wanted to update this by using xml to generate that array and came up script below.
Code:
//load media paths from xml into an array for gallery or pictuers and swf files
var galleryXML:XML = new XML();
[code].....
I know there are tons of tutorials out there about loading images from an xml file and creating a slide show. I can plug and play with those pretty good. However I would prefer it if I could start writing code myself. I am starting basic and each day working on adding code to a project.
Here is a made up app. Basically I have created three loaders that add an image to each one which I put into an array, cause why not. I have two event listeners one for an on stage click to load an image, and one a timer to load an image. The next thing I would like to try and do is load one image for a period of time, then load another etc.
So would I need a loop that loops through the array somehow connected with a timer?
public class array extends Sprite
{
//Create Loaders
private var imageOne:Loader= new Loader;
[Code].....
I know that problem has been discussed recently, but I cant find the post. Here's the prob
Code:
onClipEvent (load) {
myArray = new Object () ;
[code].....
I have an array, how can I load it into a list box? Also, I have 6 arrays, I put them each into a different layer, Is that correct?
View 5 RepliesI am building a jukebox for a website, which has a genres, bands, and tracks list.These are all populated from a MySQL DB. The info is dumped into a listbox component.ll of the lists are working, but on the tracks list, i need to pull the track name,and its filepath. So that I can assign the track name to the lable property, and the filepath to the data property.My problem, is that I cannot get a multiple value array from php to flash, it keeps coming up as undefined.
PHP Code:
echo "&testArray=[["track1","filepath"] ["track2","filepath"]]";// i have not put the query in i dont think the problem is there
[code].....
i'm trying to do the following: i have a movieclip that show random words, and i want the words to appear just when a specific key is down.
[Code]...
Where I can find song without words?
View 2 RepliesSo I've got an array of images,
Code:
pixArray = ["Images/Architecture/Hospitality/01.jpg", "Images/Architecture/Mixed/01.jpg", "Images/Architecture/Office/01.jpg", "Images/Architecture/Performing/01.jpg"];
It's part of a slideshow, loading one image, waiting 4 seconds, then it loads another, etc etc. The problem is, between each image, it has to load. I'm trying to find a way to get flash to keep loading all the images in the array until they're all loaded, something to the effect of: On the completion of the loading of the first image, start loading the second image in the array. On completion of loading that, load the third image, etc, until there are no more.
I already have a variable that tells it how many items there are as well:
Code:
var total:Number = 4;
I am loading my images into an Array after my url is loaded
Code:
function urlLoaded(event:Event):void {
urlLoader.removeEventListener(Event.COMPLETE,urlLoaded);
xml=XML(event.target.data);
xmlList=xml.children();
[Code] ....
It is arrayThumb I am interested in, I wanted each each to be placed into a location within this Array. I then wanted to do
Code:
thumbArray[0].addEventListener(MouseEvent.CLICK, click_handler1);
function click_handler1(e:MouseEvent) {
trace("IMAGE CLICKED");
}
But when I try this, I get
TypeError: Error #1010: A term is undefined and has no properties.
I have 5 movies in my library, called question0, question1, question2, question3, question4. I linked them with export for actionscript. I have an Array, called questions. Then I have a button that calls the getQuestion function. But I get the following error:
[Code]....