Ok I hope someone can help me. My first array looks like this
array1 = (Section A, Section E,undefined,undefined,undefined,undefined,undefine d,undefined)
and my second 1 looks like this array 2 =( Section A, Section B, Section C, Section D, Section E,2. GRCM,3. ASPEN,4. R1)
I need to place Section A in my first array in position [0] and in position [4]. Can this be done by using the information from the second array. Please please can sonebody help me
6 1393
Ok I hope someone can help me. My first array looks like this
array1 = (Section A, Section E,undefined,undefined,undefined,undefined,undefine d,undefined)
and my second 1 looks like this array 2 =( Section A, Section B, Section C, Section D, Section E,2. GRCM,3. ASPEN,4. R1)
I need to place Section A in my first array in position [0] and in position [4]. Can this be done by using the information from the second array. Please please can sonebody help me
Is this in AS Flash?
Is this in AS Flash?
Yes it is as flash file. ireall hope you can help me
Zar
Not sure what your trying to acheive but if you use Array.splice you can insert values into an array at a given position.
Take a look here for more info.
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary070.html
Hope this helps!
Thanks for that but I know it does not do what I want.
I have not explained myself properly.
I's like this I have one array that looks like this
(Section D,Section A,undefined,undefined,undefined,undefined,undefine d,undefined)
and another array looks like this (Section A,Section B,Section C,Section D,Section E,2. GRCM,3. ASPEN,4. R1)
I need to find where Section D and Section A are in the second array. ie Section A = 0 and Section D = 3
I hope this makes sense
Are you trying to make a recursive method that uses the values in the first array to find the position of values in the second array?
Here is an example model of the top of my head (untested); - var array3:Array = new Array();
-
var t;
-
for(var i=0; i<array1.length; i++){
-
t = firstArray(array1, array2)
-
if(t>0){
-
array3.push(t);
-
}
-
}
-
-
function firstArray(array1:Array, array2:Array):Number{
-
var l = array1.length;
-
for(var i=0; i<l; i++){
-
if(array1[i] == secondArray(array2, array1[i])){
-
return i;
-
} else {
-
return 0;
-
}
-
}
-
}
-
-
function secondArray(array2:Array, arrayObject:Object):Object{
-
var l = array2.length;
-
for(var i=0; i<l; i++){
-
if(array2[i] == arrayObject){
-
return array2[i];
-
}
-
}
-
}
-
Not sure if this will work but should get you started.
Thanks
for your help
Are you trying to make a recursive method that uses the values in the first array to find the position of values in the second array?
Here is an example model of the top of my head (untested); - var array3:Array = new Array();
-
var t;
-
for(var i=0; i<array1.length; i++){
-
t = firstArray(array1, array2)
-
if(t>0){
-
array3.push(t);
-
}
-
}
-
-
function firstArray(array1:Array, array2:Array):Number{
-
var l = array1.length;
-
for(var i=0; i<l; i++){
-
if(array1[i] == secondArray(array2, array1[i])){
-
return i;
-
} else {
-
return 0;
-
}
-
}
-
}
-
-
function secondArray(array2:Array, arrayObject:Object):Object{
-
var l = array2.length;
-
for(var i=0; i<l; i++){
-
if(array2[i] == arrayObject){
-
return array2[i];
-
}
-
}
-
}
-
Not sure if this will work but should get you started.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of...
|
by: Wynand Winterbach |
last post by:
I think every C programmer can relate to the frustrations that malloc
allocated arrays bring. In particular, I've always found the fact that
the size of an array must be stored separately to be a...
|
by: BuddyWork |
last post by:
Hello,
I want to know if there any good tools out there which
will show me a breakdown of the memory allocation in Gen
2 heap, basically a breakdown by object is what I'm
looking for.
The...
|
by: Leszek |
last post by:
Hi.
Is it possible in javascript to operate on an array without knowing how mamy
elements it has?
What i want to do is sending an array to a script, and this script should
add all values from...
|
by: Peter Olcott |
last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a
I think that the operator() member function does not work correctly, does
anyone else know how to make a template for making two...
|
by: Tim Hunter |
last post by:
Hi I am using WinXP and Access 2003
Is it possible to store the field names of a table in an array and then
loop through the array and update the table using the field names stored
in the array? I...
|
by: theballz |
last post by:
Hi,
I am learning c programming and come across a problem i cant seem to
solve. I have a file which i wish to parse and put certain lines
(which do not contain a hash character) into an array...
|
by: Daron |
last post by:
Is it possible to use SQL to take a field, and break it down by
denominations?
I would like to take a field, and then break this out into the number
of bills($100's, $50's, etc) I would need:...
|
by: rbutlerjr |
last post by:
Hi, I've racked my brain for the last few hours trying to figure
this one out. I have an array of language strings such as :
$lang = array();
$lang = 'hello';
$lang = 'goodbye';
$lang = '1st';...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |