ActionScript 2.0 :: Loading Array Into List Box
Sep 27, 2003I 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 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 RepliesSo I am trying to load a text file into flash, grab all of the files listed in it and then load them into flash. Not working. Heres my code.
ActionScript Code:
import flash.display.Sprite;
import flash.events.Event;
[Code].....
I'll start by posting my code then explain what I want it to achieve.
[Code]...
What I am attempting and failing to do after much trial and error is to have a random ingredient from the ingredientList array pushed into the previewIngredients array making sure the new value going in is not already in the preview ingredients array. If the same value is there I want it to keep choosing an ingredient from the list array until it finds a value thats not in the preview array then push that one in there. It feels like I'm getting close but obviously I'm either going about it the wrong way or just missing a little somthing somthing out.
how to populate a list box component located within a seperate mc in my swf with an array... the array comes from a response from a webservice call. I am not currently on the computer with my source code available so lets just use the following....
listdata[i] = the array i want to populate the list box with..... (listdata1, listdata2, listdata3, listdata4, etc. etc.)
movieclip1 = the MC within my fla containing the list box component
mylist = the actual list component
... just not all that familiar with the format of actionscript when working with objects... using CS3 and as2 btw,
lets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?
[Code]...
I am trying to add data from my XML list into an array. I keep getting a error in the output panel and I marked what line it is failing on. Can someone share with me how to do this?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Pegasus1to1_fla::MainTimeline/frame1()[Pegasus1to1_fla.MainTimeline::frame1:65]
[Code]...
For my work i'm trying to get an Array properly into a text field. The array is being taken out of XML and then turned into the array and fed into a textfield. But it shows up like this:
[Code]...
i have wasted almost two days on that.im loading a list of img urls from xml file:
<image>
<item><![CDATA[http://www.thelatest.co.il/images/tags/court.png]]></item>
<item><![CDATA[http://www.stockvault.net/images/sv08/random/firepit.jpg]]></item>
<item><![CDATA[http://www.stockvault.net/images/sv08/random/cloudysun.jpg]]></item>
[code]....
now, the problem is that only imges in the array that located in 1,3,4 etc position are loaded,and the mc ignores the imges in 0,2,4 positions.
Is it possible that object can be store in array list.
package {
// Importing object from flash library
import flash.text.TextField;
import flash.display.Sprite;
// Creating class
public class Show extends Sprite {
[Code] .....
Error
Description : Label must be a simple identifier
Location : Above orange textcolor line
So, pretty much I have made a little flash app for a project at uni, and I have a tree which these little bat creates land onI have drawn the tree as a MC, and then use a hitTestPoint function to check wether the centre point of each bat character is touching the tree. If so land... blah blah pretty simple.Except I need to create a function that actually randomly spawns these characters on the tree. So to do this i would ideally have a get function that collects every x and y point on the and stores this data into a list
View 8 RepliesI want to sort an Array list in flash as3. xmllistcollection class work for flex but how can i do that in cs5 ,i hav tried to import the swc but it does seem that class in to this flex swc.
View 2 RepliesI 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 RepliesGot a list of numbers in an array 7, 3, 8, 4, 3, 4, 4, 7, 9
But I need the output to be 3, 3, 4, 4, 4, 7, 7, 8, 9
How do I do this?
[URL] -heres a intresting portfolio site at the bottum they have 3 columns i want to do they same thing where they select from the first list they select from the secong list then the description shows up and loads a swfs which of these two methods would be easier to use
1.use a array or list
2. use movie clips
I'm making a flash app that play's movie clips on the main stage.
I have 4 buttons on the bottom for 4 different catagories of movie clips.
I plan to be able to update the catagories with 5 new movies per week (replacing 5 older movies).
My knowledge of actionscript is limited, so I have just imported each individual flv (which are hosted on a webserver) onto individual keyframes on a movie clip and just placed a simple gotoAndplay action script on buttons to play the movies.
My question is: Is it possible to have a file with the list of .flv url's on it and then each keyrame to look at the file and load a specific line.
i.e. keyframe 1 load line1 from movie list, keyframe2 load line2 from list etc etc.
This would save me alot of time, as at the moment I am going into each keyframe and changing the url of the flv when I update. If I could just change the url's on the text file, that would be great.
I'm building a kind of dynamic level generator, at the moment I have it draw a grid of alternating coloured squares/plots (for visual debug), currently set at 1 pixel which I then scale up so they are easier to see. I make a list of all these open 'plots' in an array(maybe a dictionary would be better?)... Next I draw a random selection of roads on top of my grid in another sprite. Ranging in width from 2 to 8 plots. First drawing all the horizontal, and then the vertical ones. Now I'm wondering what would be the best way of finding all the plots/pixels that these roads occupy?I thought perhaps I could draw the roads into bitmap data, and then find the x,y values of all the black pixels? something like:
PHP Code:
var bData:BitmapData = new BitmapData(roads.width, roads.height, false);
bData.draw(roads)
[code]........
I have an ActionScript 3 array that lists pairs of items like this:
pairs[0] = Array('ItemA', 'ItemB');
pairs[1] = Array('ItemA', 'ItemC');
pairs[2] = Array('ItemC', 'ItemD');
[code]......
Basically each row in my table is a different food. I have columns for basic things like description. But, I have a "ingredients" array, and "how much" array, in an array. Basically on my end I can go ingredientsArray[0] howMuch[0] to display the ingredient and how much of it. So, Id like to save both of these arrays in a cell for the row of the food. I heard I could serialize the array, and save it. But I need it to be searchable. (Also, there is no set limit to how many ingredients. So I cant like have a column for each thats why I am going the array route). I'm doing my programming in AS3, and usng AMFPHP to connect to Mysql.
View 4 RepliesPremesis:I am using actionscript with two arraycollection containing object with value to be matched...Let's assume I have two list of elements A and B (no duplicate values) and I need to compare them and remove all the elements present in both, so at the end I should have
in A all the elements that are in A but not in B
in B all the elements that are in B but not in A
now I do something like that:
for (var i:int = 0 ; i < a.length ;)
{
var isFound:Boolean = false;[code].....
I cycle both the array and if I found a match I remove the items from both of the array (and don't increase the loop value so the for cycle progress in a correct way).I was wondering if (and i'm sure there is) there is a better (and less CPU consuming) way to do it...
I'm trying to turn this
ActionScript Code:
var a1:Number = 563
var a2:Number = 500
var a3:Number = 600
[Code].....
I'm trying to make an array and list it's elements in a text box.
Code:
tabs = new Array();
tabs[0] = "jerseys";
tabs[1] = "tshirts";
[code]....
I am trying to create a buttons menu with Array, and for some reason it only show the lastone on the list.
Here is my code (AS3):
var nav1Items:Array = new Array("about", "work", "contact");
//Create text field
var myFont:Font = new Calibri();
var myFormat:TextFormat = new TextFormat();
var label_txt:TextField = new TextField();
//Set text style
[Code] .....
Convert XMLList to Array / comma delimited list ?Consider this XML[code]...
View 5 RepliesI have an array called "webSite" that has a list of website addresses (url..).I have this code snippet that works great except that all the siteButton moviclips all go to the last website address in the "webSite" array.I need each button that is created to go to the proper website in the array. (siteButton[0] goes to webSite[0], etc.).Here is the shippet of the code where I am having the problem.[code]...
View 2 RepliesI wanted a sprite to move round on the screen when a play button was pushed. I have a left and a right button which store strings "left" or "right" into the next positions of an empty array called history.
When i push the play button i want i want the sprite to move either left or right according to what commands are in the array. My code just seems to play one single command and then stops when i hit play again it just repeats the same command.
Is there any way to make it play through all commands in the array one after another?
Here's the loop that i was trying to use.
[Code]....
I originally built this in Flash 8, then moved the files over to CS4. I have a list component where I've loaded song files through xml and everything is working great. How to make it play one of the 8 files randomly when it starts playing, instead of it always starting with a specified track (currently track one obviously). So each time a visitor comes to the site it is a different song.
PHP Code:
this._lockroot = true;
//make textfields autosize
album_txt.autoSize = "left";
artist_txt.autoSize = "left";
title_txt.autoSize = "left";
//create sound object
[Code] .....
How do I manage that, while the movie starts, some parts of the Display List are "hold in the backhand" and get loaded when I decide that they should.Can I only do that via external SWF-Files? Further question: Is it possible to stream the files, by calculating the download speed and starting the movie when I want it to do, or is Flash doing that automatically
View 4 RepliesI'm loading an xml file that contains nothing more than a list of "valid" zip codes. Here's a sample of the xml:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<zipCodes>
<zip>82930</zip>
<zip>82931</zip>
<zip>83114</zip>
...and so on.
What I need to happen is when a user enters a zip code, I need to return a "yes" or "no" based on whether or not the zip code they entered is in the xml list. So far, it only works if the zip they enter happens to be the last one on the list. This tells me that it's either not searching the entire file, or that it perhaps needs to search in a loop somehow.
Here's the code that works the closest to what I need:
stop();
var xmlLoader:URLLoader = new URLLoader;
xmlLoader.addEventListener(Event.COMPLETE, showXML);
xmlLoader.load(new URLRequest("zipCodes.xml"));
var xmlData:XML;
function showXML(e:Event):void {
[Code] ....
I have a list of countries that are in an xml document. I was wondering if here was a way to randomly load ten of these and place them on the stage in random places. I want to get the effect of this intro: [URL]. (not the one with the black background)
View 8 RepliesI got a text file in the same directory as the flash file, and I am wondering what is the problem with it loading the url. the header is live on [URL] and it doesn't want to load the urls. what would be required to get it to do this? when ctrl + enter to test the movie, it loads the url in a new window. am pasting the code below:
Code:
// CLASS IMPORTS
import flash.geom.*;
import flash.display.*;
import flash.events.*;
import flash.filters.*;
[Code] ......