ActionScript 2.0 :: Loading Xml Into An Array
Dec 1, 2009My 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]....
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]....
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,
I 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]...
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".
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].....
So 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]....
I've got an application that has several slides. Each slide has a sound file that goes with it. I created a function on the root timeline that plays the audio sound. Each slide loads one after another and works great. However I have next and previous buttons for each slide. Each button makes the sound channel stop. If I press something too quickly the sound in the sound channel isn't overwritten with the new sound.
So basically I want to know how to remove all sounds from the sound channel so I can load a fresh new sound. Because the stop command only stops the soundchannel until the next sound is loaded and then it starts playing the sound again. It seems like the sound channel is an array of sounds and I don't know how to clear the array before pushing a new sound to it.
I have a flash file that loads images from an xml file. Is there a way to make the images load randomly? I would like a different image to start every time it loads. here is where the xml is pulled in...
[Code]...
I used to put a load of instance names linking to library objs into an array in AS2, then use a loop to add them to the stage..I htought this would work in AS3, alas no.
Code:
var list:Array new Array("one", "two","three");
for(var i:int=0;i<list.length;i++)
[code].....
I'm trying to setup a program that loads a set number of pictures (the exact number is stored in resources/data.txt). Pictures are labled picture# starting at 0 and increasing.
My problem is that I want to store the loaded pictures, which is giving me trouble. When I try to trace the bitArray length, it says it is zero..
My Code:
//Variable Initilizing
//Loaders:
var mLoader:URLLoader;[code]....
I'm just trying to loop this array, it works, I just can't get it to loop:
ActionScript 3.0 var videos:Array = new Array("videos/movie1.flv", "videos/movie2.flv", "videos/movie3.flv");
var currentVideo:uint = 0;
myVideo.mouseChildren = false;
function playCurrentVideo():void {
[Code] .....
I've found a bunch of threads for AS2, but I just can't get anything to work. Not as important, there's a quick gap between the loading of each video when this runs. Can that be improved?
I'm currently working on a project that has eight separate movieclips (for loading content) on separate layers. I have placed code in these mc's to randomly draw from the same array of 61 different swf's. Each mc randomizes the array just fine, but here's the problem. The code works great for one instance, but as soon as I add the code (including renaming) to the other mc's, the swf won't load/play. I am not getting an compiler errors, and am kinda stuck as to what the problem may be. Here's an example of the code I'm using. It is the same for each mc, except I'm renaming the variables as well as the instances for each mc.
[Code].....
Alright. I have been over every inch of the web to find something that works, and nothing seems to. So let me see if I can't explain this as best I can.
I have a simple flash movie with six images in the timeline. One image shows up for a few seconds, then fades into another image. These images are NOT embedded in a movie clip, they are just in the main timeline.
The frames where these images start are at 2, 110, 220, 330, 440 and 550.
When someone first browses to the website, I want the movie to start at one of those frame numbers and then continue to loop through the rest. So if the movie randomly begins at 330, it will then proceed normally to 440, 550 and restart at 2 and continue.
Obviously the code will go into frame 1, but every code I try, the movie will always start at 2 when the person first goes to the site. If the person selects another link on the website, and then goes BACK to the homepage, THEN the movie will pick one of those numbers, but not on the first visit.
Any idea why this is happening? I can only think because the movie hasn't loaded every frame yet.
I have the following problem. I wanna load 3 pictures to the stage using LoaderMax. Their path is stored in an array (urls), and finally I wanna have all their displayList objects in a new array called pictures.here's my code:
var urls:Array = new Array("../data/bild1.jpg","../data/bild2.jpg", "../data/bild3.jpg");
for(var i:Number = 0; i< urls.length; i++){
var loadery = new ImageLoader(urls[i]);
[code].....
I have a main Movie and on certain frames I need to play a random MovieClip which contains a quiz/question...drag/drop...multiple choice..or whatever...so.I'm wondering out of the many ways my mind wants to do this...which would be the smartest.
1. Put all those MovieClips into a main Movie...and have the Array jumble up the frame number to jump to...when it's been used...take that frame number out of the pool...
2. Have just the Actionscript on that frame when you land on it in the Timeline...have the Array jumble up the external movies...and then pick one and load it on that frame...and then remove that choice out of the pool..
I have this script that is working fine.I have some some buttons which when clicked load a .txt file aswell as load an image into a picHolder.However i want it so when the page loads the home.txt is already loaded (at present i have to click the button)
ActionScript Code:
loadListener.onLoadInit = function(){
sizeListener.onResize();[code]..........
I've been working on this for a while, and thought I understood the BitmapData class at least well enough to do basic stuff with it, but I'm doing something wrong.
I'm trying to make a preload function that will load external JPEGs, store them in an Array as BitmapData objects, then distribute them to thumbnail objects after all the images are loaded. The thumbnails are based on an external class I wrote, which already has a function to accept variable data.
My problem is, I can't seem to find a way to store BitmapData objects in an Array. I've even tried using a Vector.<BitmapData> object, but I get the same result, which is no data stored.
Here's the function, isolated from the rest of the script.
[Code]....
The result of this function is supposed to be, a series of images loaded one after the other, stacked 5 pixels down from each other. However, the actual result is, only the last loaded image is displayed. That's true for any number I place in the 'for' loop, only the last loaded image gets displayed.
Obviously I'm doing something wrong with the loading of the 'bitBucket' BitmapData, because it seems to be writing over the previous BitmapData in the Vector series.
I have scoured the internet in search of an answer but everything I find doesn't work. Take this example:
Code:
myData = new LoadVars();
myData.onLoad = function(done) {
if(done){
var wordsArray:Array = words.split(",");
[code]....
When I run the above code the Output window displays Undefined.