all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

populating array from data in ext. swf


populating array from data in ext. swf MichaelS
1/25/2005 11:07:53 PM
flash actionscript:
I have a main.swf that loads an external setup.swf. The setup.swf, among other
things, loads some variables to the main.swf. Included with some individual
vars is an array. Is there a way to test in main.swf that it has actually
received all of the values for the array? main.swf has an empty array that I
want to fill with data from the setup.swf but I don't want the timeline to
continue to the next frame until the array in main.swf is completely full.
Would I use 'setInterval' to accomplish this? Thanks in advance for any ideas
and help.
Re: populating array from data in ext. swf NSurveyor
1/25/2005 11:11:45 PM
You can use setInterval to accomplish that. For example:

stop();
myArray = new Array();
setInterval(isComplete,1);
function isComplete(){
if(myArray.length>0){
nextFrame();
}
Re: populating array from data in ext. swf NSurveyor
1/25/2005 11:19:32 PM
Actually, it should be:

stop();
myArray = new Array();
cID = setInterval(isComplete,1);
function isComplete(){
if(myArray.length>0){
nextFrame();
clearInterval(cId);
}
Re: populating array from data in ext. swf NSurveyor
1/25/2005 11:19:59 PM
Sorry again:

stop();
myArray = new Array();
cID = setInterval(isComplete,1);
function isComplete(){
if(myArray.length>0){
nextFrame();
clearInterval(cID);
}
Re: populating array from data in ext. swf barn
1/26/2005 6:16:17 AM
You cannot load an array directly. You can only load variables and if you use
some sort of text delimiter, you can then parse it to an array once you get the
data loaded into Flash. But if you use the array access operator character
(square braces) in your data file, it is treated simply as an ascii character
when loaded, not as an array access operator.
AddThis Social Bookmark Button