2 Dimensional Arrays In Components...?
Hi I have aocmp0onent that I want to pass a 2D array to: Code: var buttons = [[0, 51, 1],[15, 88, 1],[50, 101, 1],[85, 88, 1],[100, 51, 0],[85, 16, 0],[50, 0, 0],[15, 16, 0]]; However it seems to fail... when I create the parameter buttons in the component definition and selct array, then add the 2D array, it doesn;t seem to recognise it, can NE1 help Thanks.
SitePoint > Design Your Site > Flash and Actionscript
Posted on: Feb 21, 2005, 11:57
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sorting Arrays...2-Dimensional Arrays
How would I go about sorting two dimensional arrays using the sort() function. What I'd like to do is organize the arrays inside of an array by a certain variable...
i.e:
array1 = new Array("Name", "State1", "Cost");
array2 = new Array("OtherName", "AnotherState", "OtherCost");
array3 = new Array("DifferentName", "YetAnother", "AndAnother");
allarrays = new Array(array1, array2, array3);
Now, let's say I want to sort the arrays in allarrays by their state variable. In other words, I want to sort them so allarrays would look something like this (if sorted by state):
allarrays:
array2,
array1,
array3
Any suggestions or past experiences with this sort of sorting? Would I use the Sort() fuction? or would I have to make my own sort function? Thanks in advance for any help you can provide.
2-dimensional Arrays
I've got a 2-fold problem. I'm trying to provide an "agenda crawler" to the intranet at work, using flash 5. This will show upcomming events on a person's calendar (all personalized based on who logged in, and coming from a database). It will show the start time of the upcomming event (or, if it's a todo/call/email, that label), the name of the event, and be clickable to bring up that event's details (html) in another frame.
The first problem I'm running into is I need to create a 2-dimmensional array. I want to be able to create something like (pseudo javascript type code with holes missing):
function item(time, title, url) {
this.time = time
this.title = title
this.url = url
}
agenda = newArray()
agenda[1] = new item("10:00 am", "Meet with tom", "/myacgi?event12345")
agenda[2] = new item("11:45 am", "eat at joes", "/myacgi?event12346")
agenda[3] = new item("ToDo", "Call my mother", "/myacgi?todo4321")
That way, I could access info by doing, for example, agenda[1].title (which would return "Meet with tom")
The second problem is, I want to be able to populate the array dynamically from the database, but I want to do it all at once, ie, I want to use a getUrl and load the entire 2-dimensional array as one variable.
I've done simmilar things in javascript, but I'm new to Flash 5, and even with flash 4 I only used it rarely, as I'm a database guy, not a flash guy, so I'm at a loss as to where to start...
2 Dimensional Arrays Help
is it possible to set properties to arrays inorder to create multi-dimension arrays in AS, or do I need to come up with some sort of work around? for example, is something like this possible:
<code>
deal = new Array();
deal[0].xPos = 78;
deal[0].yPos = 175;
deal[0].face = 2;
deal[1].xPos = 145;
deal[1].yPos = 175;
deal[1].face = 2;
deal[2].xPos = 212;
deal[2].yPos = 175;
deal[2].face = 2;
...etc...
</code>
thnx folks,
HITdrumHARD
3 Dimensional Arrays
Hi,
I need to use a three dimensional and am having problems. Apparently you can't just go
myArray = new Array();
myArray[1][2][3] = "test";
trace(myArray[1][2][3]);
Think I'm missing something here,
Thanks,
Chi
2 Dimensional Arrays
Hi, I was trying to get a 2-D array going, but I couldn't figure it out. The Flash actionscript dictionary said the following for a 2-D array:
myArray = [[1,2,3],[4,5,6],[7,8,9]];
trace(myArray[1][2]); //will return 6
I studied Java for a year, and I was taught to use a nested for-loop:
int array[][] = new Int [10][10];
for(int row=0; row<10; row++){
for(int col=0; col<10; col++){
array[row][col] = whatever_value;
}
}
But when I tried the same thing in Flash, using all the correct syntaxes, it just wouldn't work. Someone want to show me the correct way to declare a 2-D array, and loop through a 2-D array?
Thanks a lot,
Kyle
P.S. - I am using Flash MX.
2 Dimensional Arrays
How can I pass this into one array called newPos[] so instead of having two separate arrays couldn't I have one array with the xpos and the ypos all in an array called newPos[] like a 2 dimensional array?
Also how can I retrieve the info from a two dimensional array.
Code:
xstartPos = [];
ystartPos = [];
function shuffel(xpos, ypos) {
var max = 4;
for (var j = 0; j<4; j++) {
xstartPos.push(xpos[j]);
trace("XPOS :"+xstartPos);
ystartPos.push(ypos[j]);
trace("YPOS :"+ystartPos);
}
}
button code
Code:
capabilities_btn.onRelease = function() {
// send all the sq_mc positions
shuffel([20, 40, 60, 80], [200, 33, 567, 55.8]);
};
Two Dimensional Arrays
Well, first of all Hello Everyone.
I've been trying to use ActionScript to create an isometric pseudo3d terrain generator thing, using a dot movie clip.
I come from a C programming background and i thought it'd be pretty easy to just attach a load of movie clips to the stage and put them all (well references to them) into a 2d array so i could call back to them with ease for the moving and the jiggery pokery.
This is what i think sets up a 2d array called point_set, pretty strange syntax a mon avis...
point_set = new Array;
point_set = [[],[]];
Then i attach the movie clips using some nested for loops:
vertex = attachMovie("mcPoint", "n"+total, total);
point_set[j][i] = vertex;
Then when i try and actually reference them, in this fashion:
onEnterFrame = function()
{
for (j=0; j<height; j++)
{
for (i=0; i<width; i++)
{
node = point_set[j][i];
// rest of the function...
but i only get a few of the points in the onEnterFrame. Viz:
www.relain.co.uk/stuff/flash/landscape.fla
and actually at:
www.relain.co.uk/stuff/flash/landscape.swf
[it is actually an isometric grid, well on a Pi/6 angle but its not set up yet]
Well thanks a lot for any help folks
Two Dimensional Arrays
Well, first of all Hello Everyone.
I've been trying to use ActionScript to create an isometric pseudo3d terrain generator thing, using a dot movie clip.
I come from a C programming background and i thought it'd be pretty easy to just attach a load of movie clips to the stage and put them all (well references to them) into a 2d array so i could call back to them with ease for the moving and the jiggery pokery.
This is what i think sets up a 2d array called point_set, pretty strange syntax a mon avis...
point_set = new Array;
point_set = [[],[]];
Then i attach the movie clips using some nested for loops:
vertex = attachMovie("mcPoint", "n"+total, total);
point_set[j][i] = vertex;
Then when i try and actually reference them, in this fashion:
onEnterFrame = function()
{
for (j=0; j<height; j++)
{
for (i=0; i<width; i++)
{
node = point_set[j][i];
// rest of the function...
but i only get a few of the points in the onEnterFrame. Viz:
www.relain.co.uk/stuff/flash/landscape.fla
and actually at:
www.relain.co.uk/stuff/flash/landscape.swf
[it is actually an isometric grid, well on a Pi/6 angle but its not set up yet]
Well thanks a lot for any help folks
Two Dimensional Arrays
Code:
songinfo_arr[i['title']]=fields_arr[0];
songinfo_arr[i['artist']]=fields_arr[1];
songinfo_arr[i['file']]=fields_arr[2];
trace(songinfo_arr[i['title']]);
trace(songinfo_arr[i['artist']]);
trace(songinfo_arr[i['file']]);
Trace prints out fields_arr[2] 3 times, instead of what i set them equal too.
Also, i first tried this...
Code:
songinfo_arr[i]['title']=fields_arr[0];
songinfo_arr[i]['artist']=fields_arr[1];
songinfo_arr[i]['file']=fields_arr[2];
trace(songinfo_arr[i]['title']);
trace(songinfo_arr[i]['artist']);
trace(songinfo_arr[i]['file']);
and i got 3 undefineds, why doesn't this work?
How do i use multimentional arrays in flash?!
2 Dimensional, Sortable Arrays
Anyone interested in seeing a sortable 2D array that grabs data from an external file?
here it is.
http://tutash.com/kaplan/SAT1600/dev...gCards0.1.html
Multi-Dimensional Arrays
Hello,
I have a movie clip where the user enters 8 dollar values. In frame 1 I set a variable called totalcorrect=0.
After the user enters the dollar values into an input box, they click a button to continue. On that button I have the following array:
on (release) {
spaanswers = new Array([1353.15, "1353.15", "1,353.15"], [91563, "91563", "91,563", "91,563.00", 91563.00], [2790, "2790", "2,790", "2,790.00", 2790.00], [773.97, "773.97"], [1353.15, "1353.15", "1,353.15"], [91563, "91563", "91,563", "91,563.00", 91563.00], [2790, "2790", "2,790", "2,790.00", 2790.00], [780.11, "780.11"]);
for (counter=1; counter<=spaanswers.length; counter++) {
(spaanswers[counter-1][answera] == ["spastudy"+counter]);
var totalcorrect = totalcorrect+1;
}
if (totalcorrect == 8) {
var spastudyfeedback = "good";
} else {
var spastudyfeedback = "bad";
}
}
As you can see, I have the various ways they can enter the dollar value to get the question correct.
What I want to do is check this to see if they got all 8 correct. If so, a dynamic textbox says good, if not it says bad.
The input boxes in frame 1 are titled spastudy1, spastudy2, etc.
When I test this I always get bad, even if all of my answers are correct.
Please help.
Thanks in advance!
Multi-dimensional Arrays
I am having trouble with the following array. all _root.xxx are movie clip instances.
deckSorted = [ [ _root.11, _root.12, _root.21, _root.22 ],
[_root.31, _root.32, _root.41,_root.42 ],
[_root.51, _root.52, _root.61, _root.62 ],
[_root.71, _root.72, _root.81, _root.82 ],
[_root.91, _root.92, _root.101, _root.102 ],
[_root.111, _root.112, _root.121, _root.122 ] ];
Multi-dimensional Arrays
I am having trouble with the following array. all _root.xxx are movie clip instances. it keeps expecting either a , or ] in line one and two. I've gone over the syntax a million times and it all looks right to me. Maybe another persons eyes will see what mine are missing. Thanks for your help
deckSorted = [ [_root.11, _root.12, _root.21, _root.22],
[_root.31, _root.32, _root.41,_root.42],
[_root.51, _root.52, _root.61, _root.62],
[_root.71, _root.72, _root.81, _root.82],
[_root.91, _root.92, _root.101, _root.102],
[_root.111, _root.112, _root.121, _root.122]];
-PhishinPhree
Can I Use Multi Dimensional Arrays In My As?
hellow, i'm wondering if there is a way to create and use multidimensional arrays in actionscript,
i saw this entry in the flash help:
Code:
var recArray = new Array();
recArray.push( { name: "bob", city: "omaha", zip: 68144 } );
recArray.push( { name: "greg", city: "kansas city", zip: 72345 } );
recArray.push( { name: "chris", city: "burlingame", zip: 94010 } );
recArray.sortOn("city");
// results in the following:
recArray[0] = name: "chris", city: "burlingame", zip: 94010
recArray[1] = name: "greg", city: "kansas city", zip: 72345
recArray[2] = name: "bob", city: "omaha", zip: 68144
which sure looks like each array entry has a couple keys(name,city,zip) and values
how would one access these in actionscript by key?
for instance, i want to trace just the city for recArray[1]
trace(recArray[0].city);
trace(city.recArray[0]);
trace(recArray[0][city]);
trace(recArray[0]["city"]);
nothing works, see i am just stabbing in the dark here, i'd really like to use multi-dim arrays, and i thot they were illegal in flash, until i saw this, but am so confused because in the array entry it says that keys can only and always be integers.
thanks,
dross
Copy 3 Dimensional Arrays
hi i need to copy a 3 dimensional array in flash
-list of lines with (start and end point(in 3d space)))
this array is stored in obj.pointlist but i can't simply copy them to
obj.pointlist2 with
obj.pointlist=obj.pointlist2;
because when i modify the second one then the first one gets modified too
for a 1 dimensional array there is an easy workaround
Code:
// Credits: FlashGuru
Array.prototype.copy=Array.prototype.slice;
// test
tester=[1,2,3,4];
tester2=tester.copy();
tester.pop();
trace (tester2);
but what can i do with 3 dimensions, instead of copying every single value ?
thanx jakob
Multi Dimensional Arrays
2 questions:
can AS arrays have more than 2 dimensions?
if so, how?
i assumed it would be like java, but that didnt work
Multi-dimensional Arrays?
I'm trying to create a 2 dimensional array for my tile-based game to hold the tile numbers by column, then row.
For example if tile number 17 was at position x=3, y=5 in the tile grid, then to get that information I want to be able to find column three, row five's value in the array.
I was going to do this using nested arrays but I read on this website: http://lab.polygonal.de/ds/ that using a single linear array to simulate a multi-dimensional array is quicker - however how to do this stumps me, could anyone explain how to do this?
Multi-dimensional Arrays
Thanks for tutorial ... Big help on getting me started with remoting. I have one question .... could I put a multi-dimensional array right into flash? Like $_SESSION['AUTH_username'],$_SESSION['P000']['Exp_name'] , and $_SESSION['P000'][1]['ITEM_desc']. Could I just send over the $_SESSION var? If so how does flash convert over these variables?
Thanks
Multi Dimensional Arrays
HELP ME SOMEONE PLEEEEASE!!! I need to create a multi-dimensional array...(?) - and thats all I know.... (well almost!)
Invoking Two Dimensional Arrays
I am trying to create a two dimensional array in AS2. It should have two values like name and roll no. and stored in such a manner that they can be traced out and also the corresponding values should be together.
as of now I am using...
myArray1.push({name1:inpName,roll:inpRoll});
trace(myArray1);
not working..please advise
Multi-dimensional Arrays
I can create them no propblem but say i have soimething like
multArray[62]=(23,34,63)
if I just wanted to change the 34 value only how would I do it, or if I only wanted the 3rd value to exist and the other 2 as null
Z
Sorting Multi-dimensional Arrays
is it possible to sort multi-dimensional arrays by one of its dimensions? if so, can someone show me an example of how that would be done?
tia
Multi-dimensional Arrays AGHHHH
I have little knowledge of multi-dimensional arrays. My big question is that I am going to put user data into the array, so how would i put all that information in?? Would i have to declare an array, make a for loop to make it a multi-dimensional?? If you know of any tutorials or have suggestions they are welcome'd!! Thanks in advance
-Corey-
Sorting Multi-dimensional Arrays?
Ok so I know how to sort single arrays but am having trouble sorting multi-dimensional. Do you just set up the sort in the same way!?
Thanks in advance
Corey
Multi-dimensional Arrays - The Question Is... HOW?
My feeble attempts at making an array that will store the cell with the location of "11x11" of a 23x23 grid stores a value of 1: (wow thats a mouthful)
Code:
Cellarrayone = new Array(23);
for (x=0; x<=23; x++) {
Cellarrayone[x] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}
Cellarrayone[11][11] = 1;
While i'm asking questions PROBLEM #2 (unrelated to above)
How to use attachmovieclip correctly?
Code:
_root.cell[y], [t].attachMovie("NormalCell", "NormalCell[t],[y]", 2["16x16"]);
_root.cell[y], [t].moveTo(trace(8*(x+1)), trace(8*(y+1)));
}
HA~! my feeble attempts briong about a laughter from my diaphragm... POST NOW!!! patience of which have i little, caffiene, of which the drink of cuba provides, is in large quantity in my surroundings...
EDIT: I have a hunch, a hunch, a hunch, that these questions are commonly asked, quite so, quite so, this answer will bring about a change in this threeeaaaadddd... and now its dead.
Dynamic Multi-Dimensional Arrays
hello all - again i must ask the superbrain of kirupa for help
following on from B.Rich's great Multi-Dimensional Arrays and attachMovie tutorial, i'm trying to load the array from an external source.
i've got a text file that outputs:
myArray=samuel price,28,http://www.hybred.co.uk|becky
holland,28,http://www.hybredproductions.co.uk|mark
ovenden,31,http://www.hybred.co.uk/mark
i then try to break this down in flash into a multi-dimensional array that provides info for dynamic buttons:
var myVars:LoadVars = new LoadVars();
var newArray:Array = new Array();
myVars.onLoad = function(success) {
if (success) {
newArray = recreateArray(this.myArray);
trace(newArray);
//Starting x & y values
var xPos = 250;
var yPos = 100;
for (i=0; i<newArray.length; i++) {
attachMovie("container", "main"+i, i, {_xPos, _y:yPos});
yPos += this["main"+i]._height+5;
this["main"+i].name.text = newArray[i][0];
this["main"+i].interest.text = newArray[i][1];
this["main"+i].link = newArray[i][2];
}
}
}
myVars.load("textfile.txt");
function recreateArray( textArray:String ) : Array {
var multiDimentionArray:Array = new Array();
var singleDimentionArray:Array = textArray.split("|");
for (x = 0; x < singleDimentionArray.length; x++) {
multiDimentionArray.push(singleDimentionArray[x].split(","));
}
return multiDimentionArray;
}
however its not working at all. i'm not sure if its because the attachMovie loop is not getting initiated or what...
if anyone could spare a few minutes to help there would be serious apriciation
pre emptive thanks!!
Multi-Dimensional Arrays And AttachMovie
This is my first posting! I visit this site almost every other day and it has been a sort of online Gita for me. I am a designer and I find advanced actionscript really tugging at my brain cells. A little help in solving this would be nice.
memberInfo = [["1","http://www.madmusings.com"],["2"],["3"],["4"],["5"],["6"],["7"]];
xPos = 100;
yPos = 100;
for (i = 0; i < memberInfo.length; i++){
attachMovie("container", "new"+i, i, {_x: xPos, _y: yPos});
xPos += this["new" + i]._width + 5;
this["new" + i].name.text = memberInfo[i][0];
this["new" + i].link = memberInfo[i][1];
}
As you can see I got it working this far. Now I want to have an inner loop so that only 5 buttons ["container"] come in the first line at yPos=100 and next five in the second line at yPos=150.
I know it is a simple fix. But I just can't seem to get it.
Madmusings
Multi-Dimensional Arrays And AttachMovie
I made. Thus ok but not accepted upgrade; because? I need to make upgrade of a multidimensional Array.
You can nest brackets to simulate multidimensional arrays. You can nest arrays up to 256 levels deep.
The following code creates an array called ticTacToe with three elements; each element is also an array with three elements:
var ticTac:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
tictac[[1]] = "1111"; ???
or
tictac[0][1] = "9999";
// to see a list of the array elements.
trace ("TICTAC" +ticTac); ---->TICTAC1,2,3,4,5,6,7,8,9
trace ("TICTAC--" +ticTac[0][1]); ---> TICTAC--2
I need that he is: TICTAC--9999
It helps me; where it is the error?
Multi-Dimensional Arrays And AttachMovie
In reference to this article, http://www.kirupa.com/developer/actionscript/multiDimArrays_attach.htm
I need to do something similar, but how do I do this in actionscript 3.0 as attachMovie is now deprecated?
Joins Multi Dimensional Arrays
Code:
blank = [[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0] ];
topStraight = [[1, 1, 1, 1],
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0] ];
levelEditGrid = new Array ( ["blank", "blank", "blank", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "blank", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "topStraight", "topStraight", "blank", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "blank", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "topStraight", "topStraight", "blank", "topStraight", "topStraight", "topStraight", "topStraight"],
["topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight", "topStraight"] );
fullLevel = new Array ();
the fullLevel array, is a 37 by 28 multidimensional array.
From the levelEditGrid array, I need to get the value from each element, and use that the reference the other two arrays eg. blank and straightTop.
And then get the values from that array and put each element as it is from that array into the fullLevel array, exactly as it is in its original array except its new position in the fullLevel array.
This is quite hard to explain, so if you don't get it ask me.
For Loops And Multi-Dimensional Arrays Problem
Can someone please explain to me the fundamental difference between these 2 functions. I have spent hours trying to figure this one out.
Essentially, the 2 functions below create a multi-dimensional array (array3) although the second function uses a for loop to assign the values for array2.
The first one behaves correctly in that it will output the same numbers twice but will not work for my purposes. The second outputs different numbers for the array3[0][0] value even though I only assign the value once. I need to be able to create a mulit-dimensional array using this method but can't seem to get it to work. They fundamentally seem the same to me. If there are any Actionscripting Gurus out there, I would greatly appreciate any help with this matter. Thank.
FUNCTION 1 (DOES WORK)
function parse () {
array1 = new Array();
array3 = new Array();
var x = 0;
for(i=0; i<2; i++) {
array1 [i] = "test1";
array2 = new Array(50*random(10),50*random(10));
array3[x] = array2;
trace(array3[0][0]);
x++;
}
}
FUNCTION 2 (DOES NOT WORK)
function parse () {
array1 = new Array();
array2 = new Array();
array3 = new Array();
var x = 0;
for(i=0; i<2; i++) {
array1 [i] = "test1";
for(j=0; j<2; j++) {
array2[j] = 50*random(10);
}
array3[x] = array2;
trace(array3[0][0]);
x++;
}
}
Multi-Dimensional Arrays And AttachMovie Question
I am working on an Array that is in a movie clip which is on a scene. The attachMovie function is working and duplicating the array's movie clip but none of the data in the array is showing and I don't why this is happening. Here is the code:
Code:
//Array with all our information
memberInfo = [["1", "info"], ["2", "info"], ["3", "info"], ["4", "info"]];
//Starting x & y values
var xPos = 150;
var yPos = 60;
//For loop to attach our container movieclip and pass the array information
for (i=0; i<memberInfo.length; i++) {
//attach the container clip
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
//increase the y postion each time
yPos += this["new"+i]._height+5;
//add the information
this["new"+i].name.text = memberInfo[i][0];
this["new"+i].interest.text = memberInfo[i][1];
}
Anyone have any advise?
.length With Multi-dimensional Arrays Doesn't Work...
Is it even possible to get the length of a multi-dimensional array without making a custom function?
Code:
Temp = ArrayBufferCords.length;
ArrayBufferCords[Temp][0] = X;
ArrayBufferCords[Temp][1] = Y;
trace(Temp) // Result = 'undefined'
Thanks
Links Are Undefined. Why? Dynamic Multi-Dimensional Arrays
When attempting the tutorial Multi-Dimensional Arrays the "link" always shows as undefined. Can't seem to figure it out.
Code:
memberInfo = [["Google", "Online Search Engine", "http://www.google.com"], ["B.Rich", "Basketball, Golf, Web Media.", "http://www.yahoo.com"], ["Senocular", "Fun stuff, like Flash", "http://www.lycos.com"]];
var xPos = 10;
var yPos = 10;
for (i=0; i<memberInfo.length; i++) {
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
yPos += this["new"+i]._height+5;
this["new"+i].name.text = memberInfo[i][0];
this["new"+i].interest.text = memberInfo[i][1];
this["new"+i].link = memberInfo[i][2];
}
Adding Image To Container Help. Multi-Dimensional Arrays Tutorial
I am trying to add a image to the container but am having problems. The image variable is loading fine but not attinching itself to the empty MC I have on the container.
Code:
memberInfo = [["Cnet", "Online Search Engine", "http://www.cnet.com", "images/bp1_s.jpg"], ["Yahoo", "Online Search Engine", "http://www.yahoo.com", "images/bw1_s.jpg"], ["Google", "Record Label Information Site", "http://www.Google.com", "images/ms1_s.jpg"]];
var xPos = 10;
var yPos = 10;
for (i=0; i<memberInfo.length; i++) {
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
yPos += this["new"+i]._height+5;
this["new"+i].name.text = memberInfo[i][0];
this["new"+i].interest.text = memberInfo[i][1];
this["new"+i].link = memberInfo[i][2];
this["new"+i].image = memberInfo[i][3];
}
And this is on the instance of the empty movie clip oin the container
Code:
onClipEvent (enterFrame) {
load(this.image);
}
Components & Arrays
Issue:
Trying to designate an array for each instance of a component button. Ultimately, attempting to load in order (or randomly) a .swf file from the array for each button into an MC target.
Right now, I'm just trying to get this simple trace function to work to know that I'm on the right track...
At the instance level, I've definied:
myNumber = 0;
myArray = swfArray;
At the component level, here's the code:
on (release) {
trace (myArray);
trace (myRight);
trace (myArray[myRight]);
}
The first two trace actions return the expected result, but the third simply comes back undefined. I can't figure out exactly how I need to set up the component, or the particular value for the myArray variable.
If anyone out there has suggestions, I'm all ears. Even a new way to approach the problem would work -- I'm really wanting to keep a single definition of the button though, with multiple instances...
Thanks,
Ryan
Help Setting Arrays To MC Components
hello all,
I need some help. I am able to make an array from a txt file
using .split when making the array. I then I assinged the variables from that array to variables on the _root, then I set the variables
to the textfields in a MC component on the stage. Here's my code below:
the .txt file:
&e1=Scene 01,The Awakening,Subi,scene01.jpg
the actionscript:
//set up the array
entry = new Array();
entry = e1.split(",");
//defining variables
name1 = entry[0];
title1 = entry[1];
artist1 = entry[2];
url1 = "http://eva-r.com/manga/";
url2 = entry[3];
Furl = url1 + url2;
//set varariables to MC component(MCe1)
//component variables tied to textfields
MCe1.Ename = name1;
MCe1.Etitle = title1;
MCe1.Eartist = artist1;
MCe1.Eurl = Furl;
I got that to work with 1 array and 1 MC component...but
I want to be able to create multiple arrays from the txt file
and have it duplicate the MC for as many arrays there are and assign
the array variables to the MC, so that the end result is a formated listing of all the array's information, each MC being a
line in that list.
I'm pretty sure I need to use a For Loop but I can't seem to make
sense of it when I'm writing it out. Maybe I need to make an Object
instead? Any help would be appreciated, I've been working on this
for sometime now.
Help Setting Arrays To MC Components
hello all,
I need some help. I am able to make an array from a txt file
using .split when making the array. I then I assinged the variables from that array to variables on the _root, then I set the variables
to the textfields in a MC component on the stage. Here's my code below:
the .txt file:
&e1=Scene 01,The Awakening,Subi,scene01.jpg
the actionscript:
//set up the array
entry = new Array();
entry = e1.split(",");
//defining variables
name1 = entry[0];
title1 = entry[1];
artist1 = entry[2];
url1 = "http://eva-r.com/manga/";
url2 = entry[3];
Furl = url1 + url2;
//set varariables to MC component(MCe1)
//component variables tied to textfields
MCe1.Ename = name1;
MCe1.Etitle = title1;
MCe1.Eartist = artist1;
MCe1.Eurl = Furl;
I got that to work with 1 array and 1 MC component...but
I want to be able to create multiple arrays from the txt file
and have it duplicate the MC for as many arrays there are and assign
the array variables to the MC, so that the end result is a formated listing of all the array's information, each MC being a
line in that list.
I'm pretty sure I need to use a For Loop but I can't seem to make
sense of it when I'm writing it out. Maybe I need to make an Object
instead? Any help would be appreciated, I've been working on this
for sometime now.
Text Files, Arrays, And MC Components
hello all,
I need alittle help...Im trying to apply data from a text file to
an array with in turn will be applied to variables in an MC component
on the stage.
for example my text file:
e1=one,two,three,four
e2=five,six,seven,eight
e3=nine,ten,eleven,twelve
I want to be able to make an array for each variable in the text file,
duplicate a MC component on the stage for each array, and set the
variables in the component to the variables in the array
(basically the array values go to the dynamic text fields in the MC component)
I'm sure this is possible I'm just stuck, I think I need a Loop or nested Loop....or maybe setup an object()? Any help would be much appreciated.
Flash MX...txt Files,arrays,MC Components
I need alittle help...Im trying to apply data from a text file to
an array with in turn will be applied to variables in an MC component
on the stage.
for example my text file:
e1=one,two,three,four
e2=five,six,seven,eight
e3=nine,ten,eleven,twelve
I want to be able to make an array for each variable in the text file,
duplicate a MC component on the stage for each array, and set the
variables in the component to the variables in the array
(basically the array values go to the dynamic text fields in the MC component)
I'm sure this is possible I'm just stuck, I think I need a Loop or nested Loop....or maybe setup an object()? Any help would be much appreciated.
Arrays, External Xml And Flash Components
hi,
I have a few questions concerning arrays, external xml files and flash components. Any help will be really appreciated.
1)Let’s say I have several items (with labels and data) – item_a = 10, item_b = 15, item_c = 25. How to put them in array? How to write this array in Actionsript?
2)How to write this array in XML file and how to load it in Flash?
3)I would like to build a Combo box from the items of my array. I want to show items labels as drop-down list, but use items data as variable. How to write this in Actionscript?
thanks.
How Do I Get One Level Of A 2-dimensional Array Into A One Dimensional Array?
Hello,
I have a problem. Hoping someone out there can help.
I'm building a slideshow for a used car dealer. I am fairly new to actionscript, but not to programming.
The slideshow portion of the animation was obtained off of the web, and does exactly what I need with some modification. However, it is set up in such a way that you have to enter the data in an array from within flash.
ie:
this.pArray = ["1505", "1506", "1507", "1508", "1509"];
However, I want the data to come from a MySql db, that can be controlled by the owner of the site.
I can get the data into a 2d array (named slides) and I can trace it. It is also showing in the debugger under variables.
The problem is that I cant get the Vehicle ID number (VIN) into the array "this.parray".
slides[0][0] = vin #1
slides[1][0] = vin #2
slides[2][0] = vin #3
and so on.
so how do extract one element of a multidimensional array (slides[i][j])
and shift the values into this.parray[i]? If this was php, asp c++ it would be easy. However there is something that I am missing.
I am sure that this is a simple thing, for someone experienced with actionscript. I can usually figure this type of stuff out, however I am in a time crunch.
Any help would be appreciated.
3-Dimensional Scrolling
Hello
I'm very curious to learn how to make 3dimensional scrolling after I viewed the website of http://www.agentprovocateur.com (sorry, flashkit moderators --feel free to take this posting off if it's too provocative). Once you go to the agentprovocateur.com website and then go to The Store, you'll see ViewByItem, and then click on either "bra", "brief", or "string", you'll be taken to a screen that scrolls the items in 3D. THAT EFFECT IS WAYYYY SO COOL!!!!!!!!!!!!!!!!
Does anyone know how to do this, step-by-step, or know of any tutorials on flashkit or anywhere on the net of achieving this effect?
I'm dying to add this type of scrolling to my website.
Any suggestions or tutorials are very much appreciated....
3-Dimensional Scrolling
Hello
I'm very curious to learn how to make 3dimensional scrolling after I viewed the website of http://www.agentprovocateur.com (sorry, flashkit moderators --feel free to take this posting off if it's too provocative). Once you go to the agentprovocateur.com website and then go to The Store, you'll see ViewByItem, and then click on either "bra", "brief", or "string", you'll be taken to a screen that scrolls the items in 3D. THAT EFFECT IS WAYYYY SO COOL!!!!!!!!!!!!!!!!
Does anyone know how to do this, step-by-step, or know of any tutorials on flashkit or anywhere on the net of achieving this effect?
I'm dying to add this type of scrolling to my website.
Any suggestions or tutorials are very much appreciated....
|