Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Storing Data In A Array



Does anybody know about a site that explains how to store data in array sent from check boxes, button, lists?

I really appreciate the help.



FlashKit > Flash Help > Flash ActionScript
Posted on: 12-21-2005, 01:47 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Storing Data In An Array
Hey,

K im new to all this actionscript stuff so ill try and explain this as best as i can.

Im trying to generate a random number between 1-52(deck of cards)

So when a number is displayed it will call the name of the card which is stored in and array.

This is what i came up with
Quote:




on (release) {
myDisplay = deck[random (13)];
}

deck = new Array();
deck[0] = "Ace of spades";
deck[1] = "Two of spades";
deck[2] = "Three of spades";
deck[3] = "Four of spades";
deck[4] = "Five of spades";
deck[5] = "six of spades";
deck[6] = "seven of spades";
deck[7] = "Eight of spades";
deck[8] = "Nine of spades";
deck[9] = "Ten of spades";
deck[10] = "Jack of spades";
deck[11] = "Queen of spades";
deck[12] = "King of spades";







the next thing I want the data that is generated to be stored in another array so I can gather how many times each card was generated (PROBABILITY) for all use maths people

Please help ive tried everything i just cant seem to get my head around it

Thanks
Barry

Storing XML Data In Array
This is just a simple problem that has annoyed me for hours. I want to get data from my XML file an store them in arrays but it doesnt!! Why??
My script:

Code:
//XML function
function loadXML(loaded) {
var headline_temp:Array = [];
var text_temp:Array = [];
if (loaded) {
for (i=0; i<5; i++) {
headline_temp[i] = this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
text_temp[i] = this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
}
} else {
trace("file not loaded!");
}
}
//////////////////////////////////////
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("extern/text.xml");
If I trace the arrays, it just returns 'undefined' but if I trace inside the function it returns the actual data. Why??

Storing XML Data Into An Array
I always have this problem which I didn't really care because most of the time, I will just stick with it but now, I have a situation which I thought this problem may create hinderance to what I am going to do later.

I am trying to load a XML file into flash and store the data from the XML into an array. However, something which I thought is logical doesn't seem to work.
Here's the example code:

Code:
myxml = new XML();
myxml.ignoreWhite = true;
myxml.load("saleskit.xml");
myxml.onLoad = doXML;
elements = new Array();

function doXML() {
saleskit= myxml.firstChild;
shops= saleskit.childNodes;
trace(shops);

for (var i=0; i<shops.length; i++){

for (var node = shops[i].firstChild; node != null; node = node.nextSibling) {
if (node.nodeType == 1) {
if (node.nodeName == "saledollar") elements.push(node);
}
}
}

//XML data in elements array are still accessible
setProperty (_root.RectInstance0, _height, parseInt(elements[0].firstChild));
setProperty (_root.RectInstance1, _height, parseInt(elements[1].firstChild));
}
//XML data in elements array are now inaccessible
setProperty (_root.RectInstance2, _height, parseInt(elements[0].firstChild));
setProperty (_root.RectInstance3, _height, parseInt(elements[1].firstChild));
A very common piece of code to load a XML file into flash if you look at the elements array, which is declared outside of the function, supposed to be a global variable within flash right?
I had the function doXML() to go through the XML nodes and stored the XML data into the elements[] array. I can still use the data in the elements[] array within the scope of the function. But when I try to access the data outside of the function, the array seem to return empty values, as if it has never been used before by the function. I thought that it is logical that the elements[] array will remain with the values the function doXML() has passed into?

I am trying to store some XML data into an array so that I can later use them easily, without reloading the xml file again.

Thanks!

Storing XML Data Into An Array
I always have this problem which I didn't really care because most of the time, I will just stick with it but now, I have a situation which I thought this problem may create hinderance to what I am going to do later.

I am trying to load a XML file into flash and store the data from the XML into an array. However, something which I thought is logical doesn't seem to work.
Here's the example code:

Code:


myxml = new XML();
myxml.ignoreWhite = true;
myxml.load("saleskit.xml");
myxml.onLoad = doXML;
elements = new Array();

function doXML() {
saleskit= myxml.firstChild;
shops= saleskit.childNodes;
trace(shops);

for (var i=0; i<shops.length; i++){

for (var node = shops[i].firstChild; node != null; node = node.nextSibling) {
if (node.nodeType == 1) {
if (node.nodeName == "saledollar") elements.push(node);
}
}
}

//XML data in elements array are still accessible
setProperty (_root.RectInstance0, _height, parseInt(elements[0].firstChild));
setProperty (_root.RectInstance1, _height, parseInt(elements[1].firstChild));
}
//XML data in elements array are now inaccessible
setProperty (_root.RectInstance2, _height, parseInt(elements[0].firstChild));
setProperty (_root.RectInstance3, _height, parseInt(elements[1].firstChild));



A very common piece of code to load a XML file into flash if you look at the elements array, which is declared outside of the function, supposed to be a global variable within flash right?
I had the function doXML() to go through the XML nodes and stored the XML data into the elements[] array. I can still use the data in the elements[] array within the scope of the function. But when I try to access the data outside of the function, the array seem to return empty values, as if it has never been used before by the function. I thought that it is logical that the elements[] array will remain with the values the function doXML() has passed into?

I am trying to store some XML data into an array so that I can later use them easily, without reloading the xml file again.

Thanks!

Storing Data In Array Takes A Toll In Performance?
Hello,

I'm developing a small portfolio, making everything text -from the labels on buttons to contents- dynamic, loading content from different txt files to easy update and lenguage options. All is working fine, with a small script to create arrays and populate them according to the total number of txt, etc... everything kinda self-arranges nicely, but the problem is that by loading the data to flash, the player starts to run slowly, specially in the browser, and flash itself gets unstable to work in (i can't ask it to trace all variables anymore, once they're loaded, because it crashes the program; any wrong parameter in a for loop crashes the program, etc)...

I'm experimenting with the logic to develope such website, but i'm not that familiar with the tips and tricks when working with external data, what are the limits, workarounds, main considerations, etc. I'm looking and reading but haven't find anything particularly enlightening about it.

So, if anyone can give me a hint about how to tackle this performance issue, i would be very glad. The strange thing is that the data (text) itself isn't that much by this testing time, just a bunch of "hello, i'm the first item" and such... i fear that when the time for the real info to be put in place comes, it will crash the player... i'm following the general guidelines for optimizing performance in coding

is 35+- arrays holding different categories of data too much? how can i know if there's a loop or event that is repeating unecessarily (or do i have to put a trace in each and every one of them?) The testing so far tells me that in theory the scripting structure works fine, every for breaks when is no longer needed (if such is the case, before it meets its condition), the graphics cannot be more simple (in this stage, i want to include frame by frame animations, but can't even think of it with that poor performance)

well, here's the main script, the one that initiates all the arrays containing data; after everything is loaded, independant "ini"functions populate textfields and such, according to the contents of the arrays created...


ActionScript Code:
stop();
System.useCodepage = true;
////////////////////////////////////////////////0. TEXTOS Y VARIABLES EXTERNAS
//idioma inicial
_global.id = "ESP";
//sección inicial
_global.sccAct = 1;
//submenu servicios inicial
_global.smAct = 1;
//array para determinar secciones (interno)
_global.iSecc = new Array("srv", "ima", "mult", "cont");
//array para determinar txts a cargar (interno)
_global.iTxt = new Array("int", "srv", "not", "isc1", "isc2", "isc3", "isc4", "msc1", "msc2", "msc3", "msc4");
//array para determinar prefijos de las variables a cargar (interno)
_global.iVar = new Array("t", "p", "s", "d");
//array para armar los nombres de las arrays a llenar con sayArray(interno)
_global.iArr = new Array(["mTag", "fTag", "fPol", "txtDsc"], ["srvTit", "srvPar", "smTag"], ["iscTag", "news", "mscTag"], ["iSc1Tit", "iSc1Dsc", "iSc1Par"], ["iSc2Tit", "iSc2Dsc", "iSc2Par"], ["iSc3Tit", "iSc3Dsc", "iSc3Par"], ["iSc4Tit", "iSc4Dsc", "iSc4Par"], ["mSc1Tit", "mSc1Dsc", "mSc1Par"], ["mSc2Tit", "mSc2Dsc", "mSc2Par"], ["mSc3Tit", "mSc3Dsc", "mSc3Par"], ["mSc4Tit", "mSc4Dsc", "mSc4Par"]);
////////////////////////////////////////////////0.1 FUNCIONES DE CARGA EXTERNA
//carga del css
css = new TextField.StyleSheet();
css.load("txt/estilo.css");
//función para automatizar el proceso de relleno de arrays para cada txt
_global.fillArray = function(idioma, iterus) {
    var secc = iterus;
    //variable que arma el nombre del txt a cargar
    var prefix = "txt/"+idioma+iTxt[secc]+".txt";
    var varTxt = eval("txt"+iTxt[secc]);
    //numero mayor que el máximo de items posibles para cualquier tipo de variable
    var veces = 60;
    varTxt = new LoadVars();
    varTxt.load(prefix);
    varTxt.onLoad = function(success) {
        if (success) {
            //loop para crear los nombres de las variables (item), usando los prefijos en iVar
            for (i=0; i<=iArr[secc].length; i++) {
                if (i<_global.iArr[secc].length) {
                    var item = iVar[i];
                    //crear un array global de acuerdo al nombre eq al indice [secc]
                    //subitem [i] en iArray
                    var nTmp = iArr[secc][i];
                    _global[nTmp] = new Array();
                    for (j=1; j<veces; j++) {
                        //crear el nombre del item uniendo la letra con el numero que da el loop
                        //y buscar la coincidencia dentro del txt cargado segun secc
                        var fld = aCaps(varTxt[item+j]);
                        //mientras que encuentre contenido para el nombre de item
                        if (fld != undefined) {
                            //crear item, y eliminar retornos y espacios del txt
                            _global[nTmp][j-1] = srchCut(fld, "
", "*", "<br><br>");
                        } else {
                            //detiene el loop si el contenido no existe       
                            break;
                        }
                    }
                } else {
                    if (secc<(iTxt.length-1)) {
                        fillArray(id, secc+1);
                    } else {
                        trace("terminé todo");
                        _root.nextFrame();
                    }
                    break;
                }
            }
        }
    };
};
//ACAPS ::pasa el texto a todo mayúsculas::
_global.aCaps = function(texto) {
    return (texto.toString().toUpperCase());
};
//STRCHNG ::reemplaza strings, para cambiar "*" por <br> (funciona con srchCut)
_global.strChng = function(que, cual, strng) {
    while (strng.indexOf(que) != -1) {
        var iNum = strng.indexOf(que);
        var tTxt = strng.slice(iNum+que.length);
        strng = strng.slice(0, iNum)+cual+tTxt;
    }
    return (strng);
};
//SRCHCUT ::corta los caracteres innecesarios que genera el txt (espacios y retornos)
_global.srchCut = function(texto, sub, que, cual) {
    //busca si texto contiene a sub, de izq a derecha
    var soy = texto.indexOf(sub);
    //si lo encuentra, genera una substring; si no, tira lo mismo que llegó
    //en ambos casos busca un * y lo cambia por <br><br>
    if (soy>0) {
        return (strChng(que, cual, texto.substring(0, soy)));
    } else {
        return (strChng(que, cual, texto));
    }
};
fillArray(id, 0);

Thanks in advance,

Sir Patroclo

Storing Data
Hi,

I've got the following problem:
I want to create a little flash-game which will be published as a .EXE
Now, that game should become a local game (and not to be placed on a server with a SWF). Now, I want this game to contain high-scores on the localmachine (so that the highscores are always from the people that play on that computer, where the exe runs on). I thought i could do this with "SharedObject" but I can't get it working. I have absolutely no expirience with this "SharedObject".

Can anyone help me please?

Thx in advance,
Death-Ruler

Storing Data
Hi.
I want to build a simple notepad application for me to write small notes from the office to home and from home to office. I mean to host the application on my domain and write small notes like links etc there and access them from home.
Can i do this any other way then using a database and side-script?

I tried to configure a SharedObject, but it's not working. I set the path for it on the domain and still it only works on the first computer that stores data in the SharedObject.

Can anyone help? Thanks a lot.

Storing Data Within A Swf
Howdy,

Im making an application that allows people to drag objects around in a swf. Is it possible to have the coordinates of those objects stored so that anyone else who looks at the swf sees where the objects where last dragged to.

im aware of sharedObjects, but this wont work as multiple users dont have access to the same store of information (i.e. only the person who dragged the objects will see where they have been moved to when they next open the swf...)

Regards,
JAmes

Storing Data
Hi.

I want to build a simple notepad application for me to write small notes from the office to home and from home to office. I mean to host the application on my domain and write small notes like links etc there and access them from home.
Can i do this any other way then using a database and side-script?

I tried to configure a SharedObject, but it's not working. I set the path for it on the domain and still it only works on the first computer that stores data in the SharedObject.

Can anyone help? Thanks a lot.

Data Storing
Hi. I was wondering if there is a posibility to store data from flash form in a simple file (say txt) on local hard not in database. I know it may be stored in memory using dataholder and dataset components but how to make it saved or writen in file and stored on hard drive?
But if there isn't shuch a posibilty then how can I store data in Access database using or not using dataset/holder

Storing Data
Hello all...

I'm having a few problems finding tutorials on storing the data that the user inputs during a movie. I have two questions really:

I have used the
Code:

print_pj.addPage(0, {xMin: 50, xMax:150, yMin: 10, yMax:110})
method to specify the printable area of my movie. Is it possible to save this specified area to an external file on my computer, possibly as a jpeg or some other type of graphic, so that I can access it at a later date?

Is it possible to save the text in dynamic text boxes / input text boxes to an external source, possibly a wordPad doc?

Thanks in advance for any help that you are able to give,

David

Storing Data With Flash?
Is there anyway to store data in any type of external file using FlashMX?

Cheers

Storing Data On Server (in MX)
Hi, I was wondering what the easiest way to store a small amount of data on the server would be.

Basically I wanna keep a hiscore table for a flash game, and would need to store juz a couple of names and a couple of score in a little file, but i havent the faintest idea how to go about it. any ideas?
thx

Storing Data From 2 Buttons To Go To One Url
Hi,

I have attached a map in flash, basically the buttons represent places. I wish to select 2 buttons store the variables and the click the GET DIRECTIONS button to go to another URL specific to the selection.

Are there any tutorial similar to this as i can't find any?

Storing Data About A User
is there a way to store infomation about a user eg storing there picture of something they changed like a charicters hair using cookies or something diffrent any help apriciated
thanks

Storing Data From A Text Box
I am creating a journal type of project. Does anyone know what the best way to store text is? I have my stage with an input textbox and i want to be able to enter my text and press a button and it displays underneath. Am i able to write text from an input text box into a html or txt file and then have flash read it back underneath the text box?

Storing Data In Flash
I want to set up a Flash file that stores data.

I'm not sure if this is possible, but basically I want the Flash file to have an input box and a button. The user can type data into the box (i.e. their name) and when the button is pressed the name is saved and can be viewed elsewhere in the Flash file. The problem with this is I want the name to be available even after the file has been closed and then opened again. The only solution I can think of is for Flash to save the data to a .txt file. Is this possible and, if so, can someone tell me how?

Thanks in advance!

Storing Viewer Data
When someone views a flash movie, is there a way to capture their screen resolution and store it to a text file along with, say, their IP address? How would I go about implementing this?

Storing Data From Flash...
Hey there

I am wanting to create an application in flash where the user inputs some data and it is stored in a file on their PC, but I am wondering what is the best way to do this?

I have looked at XML and Cookie files but cant seem to think what is the best and easiest method... also is there any tutorials relating to the problem I have?

Much obliged if you can aid me in my quest

Fatwood

Storing Data In Variables - Best Way?
I'm hoping a few of you expert AS'rs can tell me the best way to store temporary data within a flash movie without relying upon XML or a database. I've created a movie that calculates specific data for a company then generates a graph. I have probably 50 variables that store numbers and then eventually calculate at the end. I've been keeping them on the _root timeline and was wondering if there is a better way to store them?... maybe a more optimized procedure? Thanks in advance

Storing Data AS SharedObject
Hi,

Presently I'm in developing a game simulation for my client's network machines, where I've need to save game data as per machine/user specific. So, I preferred to use SharedObject for storing data as the game can also be played offline.

Now the problem is, the client's company doesn't permit us to storing any information (even this game related) to their machines, their securities are too tight that no data even SharedObjects are permitting to store locally.

So I wonder, if we can somehow overcome this problem.. I've two questions on this,

1. Can we change the SharedObject path to somewhere as I want..?
2. Can we use any other techno in place of SharedObject but works like storing data in SharedObject..?


Suggestions will be highly appreciated.


Thanks,

Santanu.K





























Edited: 05/22/2007 at 04:19:15 AM by aSuitableBoy

Storing Data AS SharedObject
Hi,

Presently I'm in developing a game simulation for my client's network machines, where I've need to save game data as per machine/user specific. So, I preferred to use SharedObject for storing data as the game can also be played offline.

Now the problem is, the client's company doesn't permit us to storing any information (even this game related) to their machines, their securities are too tight that no data even SharedObjects are permitting to store locally.

So I wonder, if we can somehow overcome this problem.. I've two questions on this,

1. Can we change the SharedObject path to somewhere as I want..?
2. Can we use any other techno in place of SharedObject but works like storing data in SharedObject..?


Suggestions will be highly appreciated.


Thanks,

Santanu.K

DataSet Not Storing Any Data?
Maybe I am a bit dense, but I have been trying to make this work all day and I can't get it to, so I would kindly request some assistance.
Basically what I am trying to do is to read data from a database containing a number of products and showing them on the stage.
Of course it is a work in progress and I have a lot of lines commented for later implementations, still the problem I am facing here that the data loaded in the first part of the code fails to show up later when I try to retrieve it via the _root.datacontainer.items[j].xxx method. All I get is a number of "undefined" on the screen.
Where am I going wrong? Any help is appreciated.







Attach Code

directory="public/";
lista=new LoadVars();
lista.load("http://www.agricolabaldi.com/tuttiProdotti.php");
lista.onLoad=function(success){
function carica(){
i = 0;
var totale=lista.t;
var elenco:Array=new Array();
for (i=0; i<(lista.t); i++){
elenco.push({
id:lista["id"+i],
nome:lista["nome"+i],
descrizione:lista["descrizione"+i],
nomeFoto:directory+lista["nomeFoto"+i],
novita:lista["novita"+i],
tipologia:lista["tipologia"+i],
confezionamento:lista["confezionamento"+i]
});
}
_root.datacontainer.dataProvider=elenco;
}
carica();
}
var thumbWidth:Number = 120;
var thumbHeight:Number = 75;
var MainTL:MovieClip = this;
var selected_thumb:MovieClip;
var thumbs:Array = new Array();
var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
initThumbScroller();

function initThumbScroller(targetBtn:MovieClip, workCategoryID:String){
var counter:Number = 0;
for(var j:Number=0;j<20;j++){
var thumb = MainTL.thumb.duplicateMovieClip("thumb"+counter,counter);
thumb.thumb_title_mc._visible = false;
if (j==0){
xbase = 5;
ybase = 5;
thumb._x=xbase;
thumb._y=ybase;
} else {
if (xbase == 505){
xbase = 5;
ybase = ybase + 110;
thumb._x=xbase;
thumb._y=ybase;
} else {
xbase = xbase+ 125;
thumb._x=xbase;
thumb._y=ybase;
}
}

thumb.ID = counter;
thumb.title = _root.datacontainer.items[j].nome;
thumb.pictureURL = _root.datacontainer.items[j].nomeFoto;
counter++;

thumb.titleInitializing = true;
thumb.title_mc._visible = true;
thumb.title_mc._width = thumbWidth;
thumb.title_mc.theTitle.multiline = true;
thumb.title_mc.theTitle.wordWrap = true;
thumb.title_mc.theTitle.autoSize = true;
thumb.title_mc.theTitle.text = _root.datacontainer.items[j].nome;
thumb.title_mc._x = 0+Math.round((thumb.holder._width-thumb.title_mc._width)/2);

var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
thumbMCLoader.loadClip(_root.datacontainer.items[j].nomeFoto,thumb.holder.thumb);

listener.onLoadComplete = function(target:MovieClip){
target._parent.preloader._visible = false;
}
listener.onLoadInit = function(target:MovieClip){
target._width = thumbWidth;
target._height = thumbHeight;

var tempMC = target._parent._parent.createEmptyMovieClip("tempSwapMC",target._parent._parent.getNextHighestDepth());
target._parent._parent.title_mc.swapDepths(tempMC);
}

thumb.holder.onRollOver = Delegate.create(MainTL,onThumbnailOver,thumb);
thumb.holder.onRollOut = thumb.holder.onDragOut = Delegate.create(MainTL,onThumbnailOut,thumb);
thumb.holder.onRelease = Delegate.create(MainTL,onThumbnailClick,thumb);

thumbs.push(thumb);
}
MainTL.thumb._visible = false;
}

function onThumbnailOver(thumb:MovieClip){
setSelectedThumb(thumb);
}

function onThumbnailClick(thumb:MovieClip){
//if( site_xml.firstChild.childNodes[thumb.ID].attributes.link != undefined ){
//_global.mcwidth = site_xml.firstChild.childNodes[thumb.ID].attributes.mcwidth;
//_global.mcheight = site_xml.firstChild.childNodes[thumb.ID].attributes.mcheight;
//_global.picname = site_xml.firstChild.childNodes[thumb.ID].attributes.link;
//win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
//win.title=" Azienda Agricola Baldi Paolo";
//win.contentPath=('showpic.swf');
//win.setSize(mcwidth,mcheight);
//var alto:Number = ((Stage.width-mcwidth)/2);
//var destra:Number = ((Stage.height-mcheight)/2);
//win._x = alto;
//win._y = destra;
//lo = new Object();
//lo.click = function(){
//win.deletePopUp();
//}
//win.addEventListener("click", lo)
//}
}

function setSelectedThumb(thumb:MovieClip):Void{
selected_thumb = thumb;
}
function getSelectedThumb():MovieClip{
return selected_thumb;
}

DataSet Not Storing Any Data?
Maybe I am a bit dense, but I have been trying to make this work all day and I can't get it to, so I would kindly request some assistance.
Basically what I am trying to do is to read data from a database containing a number of products and showing them on the stage.
Of course it is a work in progress and I have a lot of lines commented for later implementations, still the problem I am facing here that the data loaded in the first part of the code fails to show up later when I try to retrieve it via the _root.datacontainer.items[j].xxx method. All I get is a number of "undefined" on the screen.
Where am I going wrong? Any help is appreciated.







Attach Code

directory="public/";
lista=new LoadVars();
lista.load("http://www.agricolabaldi.com/tuttiProdotti.php");
lista.onLoad=function(success){
function carica(){
i = 0;
var totale=lista.t;
var elenco:Array=new Array();
for (i=0; i<(lista.t); i++){
elenco.push({
id:lista["id"+i],
nome:lista["nome"+i],
descrizione:lista["descrizione"+i],
nomeFoto:directory+lista["nomeFoto"+i],
novita:lista["novita"+i],
tipologia:lista["tipologia"+i],
confezionamento:lista["confezionamento"+i]
});
}
_root.datacontainer.dataProvider=elenco;
}
carica();
}
var thumbWidth:Number = 120;
var thumbHeight:Number = 75;
var MainTL:MovieClip = this;
var selected_thumb:MovieClip;
var thumbs:Array = new Array();
var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
initThumbScroller();

function initThumbScroller(targetBtn:MovieClip, workCategoryID:String){
var counter:Number = 0;
for(var j:Number=0;j<20;j++){
var thumb = MainTL.thumb.duplicateMovieClip("thumb"+counter,counter);
thumb.thumb_title_mc._visible = false;
if (j==0){
xbase = 5;
ybase = 5;
thumb._x=xbase;
thumb._y=ybase;
} else {
if (xbase == 505){
xbase = 5;
ybase = ybase + 110;
thumb._x=xbase;
thumb._y=ybase;
} else {
xbase = xbase+ 125;
thumb._x=xbase;
thumb._y=ybase;
}
}

thumb.ID = counter;
thumb.title = _root.datacontainer.items[j].nome;
thumb.pictureURL = _root.datacontainer.items[j].nomeFoto;
counter++;

thumb.titleInitializing = true;
thumb.title_mc._visible = true;
thumb.title_mc._width = thumbWidth;
thumb.title_mc.theTitle.multiline = true;
thumb.title_mc.theTitle.wordWrap = true;
thumb.title_mc.theTitle.autoSize = true;
thumb.title_mc.theTitle.text = _root.datacontainer.items[j].nome;
thumb.title_mc._x = 0+Math.round((thumb.holder._width-thumb.title_mc._width)/2);

var thumbMCLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
thumbMCLoader.addListener(listener);
thumbMCLoader.loadClip(_root.datacontainer.items[j].nomeFoto,thumb.holder.thumb);

listener.onLoadComplete = function(target:MovieClip){
target._parent.preloader._visible = false;
}
listener.onLoadInit = function(target:MovieClip){
target._width = thumbWidth;
target._height = thumbHeight;

var tempMC = target._parent._parent.createEmptyMovieClip("tempSwapMC",target._parent._parent.getNextHighestDepth());
target._parent._parent.title_mc.swapDepths(tempMC);
}

thumb.holder.onRollOver = Delegate.create(MainTL,onThumbnailOver,thumb);
thumb.holder.onRollOut = thumb.holder.onDragOut = Delegate.create(MainTL,onThumbnailOut,thumb);
thumb.holder.onRelease = Delegate.create(MainTL,onThumbnailClick,thumb);

thumbs.push(thumb);
}
MainTL.thumb._visible = false;
}

function onThumbnailOver(thumb:MovieClip){
setSelectedThumb(thumb);
}

function onThumbnailClick(thumb:MovieClip){
//if( site_xml.firstChild.childNodes[thumb.ID].attributes.link != undefined ){
//_global.mcwidth = site_xml.firstChild.childNodes[thumb.ID].attributes.mcwidth;
//_global.mcheight = site_xml.firstChild.childNodes[thumb.ID].attributes.mcheight;
//_global.picname = site_xml.firstChild.childNodes[thumb.ID].attributes.link;
//win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
//win.title=" Azienda Agricola Baldi Paolo";
//win.contentPath=('showpic.swf');
//win.setSize(mcwidth,mcheight);
//var alto:Number = ((Stage.width-mcwidth)/2);
//var destra:Number = ((Stage.height-mcheight)/2);
//win._x = alto;
//win._y = destra;
//lo = new Object();
//lo.click = function(){
//win.deletePopUp();
//}
//win.addEventListener("click", lo)
//}
}

function setSelectedThumb(thumb:MovieClip):Void{
selected_thumb = thumb;
}
function getSelectedThumb():MovieClip{
return selected_thumb;
}

Storing And Using Data From PHP In Movieclips
Heya guys,

I'm currently having abit of problem with splitting some data and inserting it correctly.

What I'm trying to do:

On screen I am going to have 3 movieclips (with a dynTextfield already placed inside them).

Using data imported from PHP I plan to put the project names of the returned results inside the movieclips. The problem with this is if the results are more than 3 then there aren't enough movieclips. To over come that I was thinking of using a 'more' button where the project names would get pushed out of the movieclips and the new set loaded in/along.

At the present moment I can split the data (received from PHP) and trace it accurately, although I'm not sure how to go about storing it now. I was going to use and Array and store to store the info and call it in the buttons, however I haven't used arrays before.

Code

ActionScript Code:
function fetchInfo(){    //Query DB for existing projects:    fetchProjects = new LoadVars();    fetchProjects.userID = _global.UserID;    fetchProjects.sendAndLoad("./php/fetchProjects.php",fetchProjects,"POST");    fetchProjects.onLoad = function(){        var dbResult = fetchProjects.numrows;        for (i=1; i<=dbResult; i++) {            trace(fetchProjects["projectID" + i]);            trace(fetchProjects["projectName" + i]);            trace("-----------");        }        //FOR TESTING PURPOSES, REMOVE LATER:        projTest.projTitle.text = fetchProjects["projectName1"];    }//end onLoad function}//end fetchInfo()  
At the moment in my test there are 2 results that are returned, I'm just looking for abit of assistance on the matter and be pointed in the right direction.

Hopefully I've done a good enough job explaining and I hope I've managed to get the right section, I felt this prob was more actionscript than PHP based.
Steve

Storing Data In The Swf File
is there aany way for save files that data could be stored within the swf file, i got the idea after getting something for acounter which gets the amount of times the swf has been opened (i think)

ActionScript Code:
onClipEvent(load) {
    local = SharedObject.getLocal("visits");
    local.data.amount++;
    visited=local.data.amount;
    local.flush();
}

iw as wondering if there were a way to set your own thingy in the swf files which could store the data for a savefile maybe something along the lines of

ActionScript Code:
savefile = new Object(12);
SharedObject.storeLocal(savefile);


that probably is completely wrong but ive tried referencing the getLocal and SharedObject but nothing comes up just

The topic "SharedObject" was not found in any of the reference materials currently installed.

neither does it for flush

i was wondering how and if you could do this and if so where could i find a tutorial for it (unless its just wuite simple)

Basic Data Storing
What's the BASIC way to store data inputted by a user into an input field?

LIke if I have a box and "please input your name" next to it and someone types "Johnny Fairplay" and presses enter, what's the code to take that name and hold on to it for later (where I will send it via PHP but I have that part down already)?

Storing Data From Flash Offline
I'm building a presentation to go into a kiosk offline.
The users will be able to add their personal information.
Flash will then store the info (phone, email, name etc.) in a text file.

What's the best way to do this?
I'm thinking about creating an XML file, and using the:
XML.createTextNode()Method
But that can't create new siblings... Or can it?

Anyone have an idea of how to have Flash add information to an text file??
Here's an example of the info I need to store:
<AddressBook>
<Person>
<FirstName></FirstName>
<LastName></LastName>
<Email></Email>
<Address></Address>
<Address2></Address2>
<City></City>
<State></State>
<Zip></Zip>
</Person>
</AddressBook>

In this example, I would like Flash to create a new person and save it in
the XML document.

Appreciate any input.
-Patrik-

? Outputing Data And Storing Online ?
I've build a kind of hit counter for my website... which keeps track of which parts of my site users visit ..... The results/stats can then be seen via a small invisible btn on my site. The problem is each time I visit my site the infomation resets to zero...

I need to somehow output the data collected and store it online somehow... then when I go to my site and checkout the hidden stats it will display all the activity/hits to the different areas of my site.

How is this possible ??

Any help would be extremely useful.

[F8] Storing Data In A List And Getting It Back Out
Hello,

Don't know why I can't figure this out: I've got an array of data that I'm storing in a list (called LB) on a button click. Problem is I can't seem to get the data back out of the list. This has gotta be a simple fix. Help!

Thanks

for(i=0;i<=3;i++) {
ArrayX[i]=somestuff;
}
for(i=0;i<=3;i++) {
_root.LB.addItem(ArrayX[i]);
}
//That all works fine

//But I can't figure out how to get the data back:
for(i=0;i<=3;i++) {
ArrayX[i]=_root.LB.Items[i];
}
//That doesn't work so well

Problem Storing Xml Data In Object
Hi there
i am trying to make a new section with news titles and news briefs and when you click on a title the full content is displayed. I have manged to read in the data from xml but am having great difficulty in storing the data in a n object not to mention the fact that the last record it the only onle that seems to be displayed on the screen. Am so disillusioned at the point and not sure how am gonna get myself outta this mess. Any help at all woul dbe great. Have attached a zip below.

Storing External Text Data
I'm wanting to create a game that can save the "user's" name and then at the end of the game post their results under their name.

I'm not sure how clear that was...

Thank you to whomever is reading this!
-M

Storing Data...no Server Connection
I'm creating a kiosk for a tradeshow that people can walk by and use. The kiosk will be stored locally on that computer. At the end it asks for their name and email address. I need to somehow store that data somewhere, but I don't think I'll be able to have an internet connection where I can access a server. I know that you need access to some kind of database/php, asp....etc to write to a flat text file or an xml file, correct? I've also looked into sharedObject(), but am not sure if it can accomplish this. Does anybody know the best way that this can be accomplished? Thanks!

Storing/retrieving Color Data.. Php
okay, so i have a basic drawing app based on http://jerryscript.hostrocket.com/fl...wing2JPEG.html which looks something like this:

Quote:




drawing = false;
data = '';
_global.linethickness = "2";
_global.linergb = "0xFF0023";
_global.linealpha = "80";

with(_root){

onMouseDown=function(){
if(_root.board.hitTest(_root._xmouse,_root._ymouse )){
drawing=true;
xposition=_xmouse;
yposition=_ymouse;
moveTo(xposition,yposition);
}
};

onMouseUp=function(){
drawing=false;
};

onMouseMove=function(){
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);

if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
_root.data+=xposition+'_'+yposition+'_'+_xmouse+'_ '+_ymouse+'-';
xposition=_xmouse;
yposition=_ymouse;
}
updateAfterEvent();
};

}}
send.onRelease = function ()
{
getURL('create-swf.php', '_blank', 'POST');
};




when 'send' is pressed, it loads a php script which retrieves the line data and redraws it thanks to MING like:

Quote:




$data=$HTTP_POST_VARS["data"];

$movie=new SWFMovie();
$movie->setDimension(500,300);
$movie->setBackground(255,255,255);

$s=new SWFShape();
$s->setLine(1,0,0,0,255);

$lines=explode("-",$data);

for($l=0;$l<count($lines)-1;$l++){

$lineData=explode("_",$lines[$l]);
$s->movePenTo($lineData[0],$lineData[1]);
$s->drawLineTo($lineData[2],$lineData[3]);

}




works fine.
problem is, i can change the colour and tha alpha and the linethickness in the flash bit (changing the 'line...' variables) but i cant figure out how to store the different info and then bring it back in the php file..

anyone help?
stuck.

Storing Data...no Server Connection
I'm creating a kiosk for a tradeshow that people can walk by and use. The kiosk will be stored locally on that computer. At the end it asks for their name and email address. I need to somehow store that data somewhere, but I don't think I'll be able to have an internet connection where I can access a server. I know that you need access to some kind of database/php, asp....etc to write to a flat text file or an xml file, correct? I've also looked into sharedObject(), but am not sure if it can accomplish this. Does anybody know the best way that this can be accomplished? Thanks!

Problems With Storing CSV Data In Arrays
Hello.

I recently used a script I found on the net: The script allows CSV data to be taken and be stored in an array. The problem I am having is that it used the LoadVars() thing, I don't really understand what this does. The whole process looks like it works within a function, which is called upon loading of a file. The data is successfully transferred into an array, but I can't use that same array at some later point in the program. Here's the basic script:

var record_arr = [];
var fieldnames_arr = [];
var pos_arr = [];
var loader = new LoadVars();
var n = [];

/*** load the file ***/
loader.load(fileload);
/*** functions ***/
// use onData because text file is not of the form var=value&...
loader.onData = function(dat) {
// split on
for files on windows server
var input_arr = dat.split('
');
// split on
for files on linux servers
if (input_arr.length == 1) {
input_arr = dat.split('
');
}
fieldnames_arr = input_arr[0].split(',');
p = 0;
for (var i = 1; i<input_arr.length; i++) {
var fields_arr = input_arr[i].split(',');
record_arr.push({});
for (var j = 0; j<fields_arr.length; j++) {
record_arr[i-1][fieldnames_arr[j]] = fields_arr[j];
n[p] = record_arr[i-1][fieldnames_arr[j]];

}
}
[ here would be some maths that deal with the data in n[p]. I can only do the maths here and not outside this function]

};

As you can see, i've bolded out the important bit here. n[p] is the array where I store the data. At the moment If I were try try and access n[p] outside this function (say in scene 1, frame 20) then I wouldn't get anything returned. I can only do anything usefull within the function. Which means having to reload the same frame, taking all the data again, and doing a slightly different operation on data which hasn't changed (since I want a 1 sec delay I am jumping 12 frames then coming back).

What I wanted to know, is if there is a way to permanantly store this information so that I can access it anywhere without having to continously run the same resourse taking script over and over again?

Cheers,
Joe

Storing/retrieving Color Data.. Php
okay, so i have a basic drawing app based on http://jerryscript.hostrocket.com/fl...wing2JPEG.html which looks something like this:

ActionScript Code:
drawing = false;
data = '';
_global.linethickness = "2";
_global.linergb = "0xFF0023";
_global.linealpha = "80";
 
with(_root){
 
onMouseDown=function(){
    if(_root.board.hitTest(_root._xmouse,_root._ymouse)){
drawing=true;
xposition=_xmouse;
yposition=_ymouse;
moveTo(xposition,yposition);
    }
};
 
onMouseUp=function(){
drawing=false;
};
 
onMouseMove=function(){
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
 
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
_root.data+=xposition+'_'+yposition+'_'+_xmouse+'_'+_ymouse+'-';
xposition=_xmouse;
yposition=_ymouse;
}
updateAfterEvent();
};
 
}}
send.onRelease = function ()
{
    getURL('create-swf.php', '_blank', 'POST');
};

when 'send' is pressed, it loads a php script which retrieves the line data and redraws it thanks to MING like:

PHP Code:



$data=$HTTP_POST_VARS["data"];

$movie=new SWFMovie();
$movie->setDimension(500,300);
$movie->setBackground(255,255,255);

$s=new SWFShape();
$s->setLine(1,0,0,0,255);

$lines=explode("-",$data);

for($l=0;$l<count($lines)-1;$l++){

$lineData=explode("_",$lines[$l]);
  $s->movePenTo($lineData[0],$lineData[1]);
  $s->drawLineTo($lineData[2],$lineData[3]);






works fine.
problem is, i can change the colour and tha alpha and the linethickness in the flash bit (changing the 'line...' variables) but i cant figure out how to store the different info and then bring it back in the php file..

anyone help?
stuck.

Storing User Input Data For Cart
Hi, All,

I'm having a little actionscript problem I can't seem to get my mind
around. I hope someone here can help me out. It's a little complicated.
Bear with me.

Here's the situation: On _level0 are the navigation buttons/links
which, when selected, load the appropriate movie into _level1. That part
I've got. Now, one of the movies (let's call it "itemsForSale.swf") is a
movie which dynamically loads various other movies into an empty
placeholder that is in 'itemsForSale.swf'; the user navigates through
these "items for sale" using basic "next" and "back" buttons. that part
I've got. Now, each of these "items for sale" movies has an "add to
cart" button that, when released, needs to store a variable name for
that particular item. So, for instance, let's say there are 5
items/movies from which to choose: shoe; shirt; tie; sock; belt. Let's
say the user clicks the "add to cart" button for only the shirt, shoe,
and sock. The user then clicks "checkout" and the "itemsForSale.swf" on
_level1 is replaced with a new movie called "viewCart.swf" Here, the
items the user has added to his/her cart are displayed in text fields:

1. Shirt
2. Shoe
3. Sock

My question is this: how do I store the user's selections in the _root
or _level0 for later retrieval when the user is ready to "checkout." You
see, the user does not necessarily need to "checkout" after they've made
their selections; they may want to read "company news" or read "about
us," both of which, in this example, are movies loaded into _level1 from
the navigation on _level0, so even though "itemsForSale.swf" is
unloaded, the user's selections need to be stored for retrieval when the
"viewCart.swf" is loaded.

I hope this makes sense, and someone can help.

Thanks,
DavidQ

Storing Data From Flash To MS Access ..offline..?
Guys,

im creating a small application which will be run at a conference booth in laptops, for users to come and access it. This app is a cost calulator performing various calculations based on user inputs. I have done all the calculation using Flash Action Script inside flash file itself. Now i need to store the final data to a MS Access database (that's what my company needs). All this process should be done offline and there will be no internet connections to the laptops at the booth. PLEASE PLEASE tell me how should i store the data to a MS Access file, offline. I need to just store the data.. that's it.. It would be great if you could post me a tutorial of same sort.. storing data offline from flash to MS ACCESS....thanks

i can however setup IIS or any offline servers at the laptops...

Jeswin

Help Storing Data In Flash For Later Use, Maybe Regarding Arrays Or Object
I got a bunch of data off an XML file, player node with name, score etc

I need to store these data so I can manipulate it so I can re-write the XML file.

I can think of one way of doing it,simply create a bunch of duplicate movieclips, one for each player with variables appended to it, one for score, one for name etc.

However I am sure there must be a way of doing this without using movieclips. Basically what I need is the data to be accessible something like this:

player1.name = rob
player1.score = 200
player2.name = robert
player2.score = 100

I thought Array or Object would do the trick, but I have not used either before and they don't seem to do anything this straight forward, most likely because I am doing something wrong.

Can anybody help me?

[F8] Storing Input Text Field Data?
Hi, im creating a form in flash (AS2). But I want it to store the data temporary until all fields are filled and sent to php.

How can I store the data?

normally I'd use

instancename.txt but since its input field I have to use the var.

lets say my input text field var is name

I cant do,

on(release) {
name.txt = name.txt
nextFrame();
}

I want to store, cause I will have a back button in a multiple pages form. I want users to be able to go back and check what they have typed. is this possible?

Storing Data/layouts For Board Game...xml? Txt?
Hello,

I'm implementing a board game and I was thinking it would be nice to store all the game data outside of the flash file.
Different elements for each board layout woud be information like

difficult (easy,med,hard)
level (1,2,3...,7)
layout_start (0,3,5,0,0,7,0,3,0) an array
layout_solution (1,3,5,5,4,7,6,3,3) an array


I've loaded information from a text file in flash before but never anything too structured.
Would it appropraite way to store the board information via xml? Because xml is new to me and i'm not sure it makes sense in this scenario.

Also, does it make sense to load everything at once(size wise it won't be very large so that's not a concern), or just load on a as needed basis?

Does it make sense to create an appropriate as 2.0 class to store this information as well?
Could someone give me a quick example for the above situation or any ideas?

And lastly are there two dimentional arrays in flash?
Right now i am using a one dementional to store the 2D board...
like this:
1 2 3
4 5 6
7 8 9
vs.
11 12 13
21 22 23
31 32 33

I know it's a barage of quesitons...Any imput would be greatly appreciated !!!
Thanks

Storing And Retrieving Data From A Flash Form.
After spending most of the morning reading through previous threads on this topic, i have yet to find one which will help me out.

I have been asked to make an application for a mate that will store user input data and also retrieve it. I consider myself an above average flash user but when it comes to server side scripting i have no idea where to start. I know that to accomplish this i need to use either ASP or PHP etc and intergrate that with a database ? if i'm going off track please correct me.

So say i have 4 fields for the user to input data into:

ID Number:

Client:

Description:

CD Number:

Once done this info is saved to the database.

Then if the user wants to retrieve this info again, he/she enters data into either of the 4 options above and then the rest of the info is brought up from the database. Is this possible to do using Flash ASP/PHP and an access database or am i going totally off track ?

Storing Selected Radio Button's Data In Variable...
What is the best way to store a selected radio buttons data into a variable?

I've tried various things, but I cannot figure it out. If I do a...

var varMyButtonData = myButtonName.data

It works....But, that would require me to know which button was pressed. So, I need a...

var varMyButtonData = myButtonGroup.SelectedButton.Data

Or something. =) Not sure if this is available or if there is a good way to do this. Basically, I will have about 10 radio buttons, each with numerical values for the data field.

I need to store the selected one in a variable on click of a submit button, which will then take the variable and multiply it by a previously stored variable and then output to a label.

=) Any one help?

Storing Lots Of Data At A Time. Has Anyone Tested The Effects?
Has anyone tested the effects on performance / responsiveness of an application by storing large amounts of data in variables throughout the movie?

Lets say you loaded 50 images, stored all their bitmapdata in an array.

Would you or when would you start to see performance knocks , if ever ?

Storing A Data Object In Native Type To MySQL
I have an object which stores data for a user-editable dictionary, the format for which is as follows:

var dictOb:Object = {word0: "Hello",
word0Value: 78,
word1: "World",
word1Value: 83,
etc...

I'd like to be able to send this straight to the database as one chunk of data without having to convert it all to a string (& then have to convert it back later) to store in just one field in the database on the same row as my other user data (username, password, etc). I've read that you can do this with the AMF format and I've looked into amfphp but I can't find any helpful examples of how I might achieve this.

Has anyone done this before? Could you give me a good old nudge in the direction I wanna be going?

Goowaaan

Storing MovieClips In An Array And Using Them That Way.
Being a PHP user I am having a real hard time understanding some basic object concepts in ActionScript. Actually...I am having a hard time understanding ActionScript at all...expect many posts.

in PHP I can do this:

PHP Code:



<?php

$object_ids = array(1, 2, 3);
$objects = array();

foreach($object_ids as $id){

      $objects[] = new objectClass($id);
}

foreach($objects as $object){

      echo $object->some_variable.'<br>';
      //or just do something with them, whatever that is.

}

?>




Everything else aside, what I want to do is put MovieClip objects into an array and be able to loop through it to change values or run functions or something. The things I have tried just don't do anything. What I am doing is duplicating a MovieClip and I want to store all these MovieClips into an array to better organize and modify them. I know there must be a way to do this. Please help if you can, I appreciate all positive comments. Thanks.

Storing Dynamic Mc's In An Array
i am trying to create a menu which is 100% on the fly. the menu item names are stored in a multidimensional array with attatched sub menu items/names. i am trying to create a mc and a txt field for each item in the top menu. i am trying to also store the newly created mc's and txt fields in an array or their own so i can manage the menu motions/tweens better. however, i get several errors, why wont this work?


// ed@goelegant.com
// http://www.goelegant.com
// menu.fla


// Do not allow scaling, stop the movie
Stage.scaleMode = "noScale";
Stage.showMenu = false;


//Global TimeLine Reference
_global.gTml = this;


//-----------------------------------------------------------
// these are the variables for the menu, change and expect wonders

// colors to use in the menu, lets keep it pretty
_global.myMenuText1 = 10000536;
_global.myMenuText2 = 6875903;
_global.myMenuText3 = 6865663;

_global.myX = 100;
_global.myY = 100;

// font for menu and whether or not menu items from arrays will be converted to uppercase or not, boolean
_global.menuFont = "atlantis_shared";
_global.menuFontSize = 8;


//-----------------------------------------------------------
// heres the data we will use to populate the menus nodes


// items in the parent menu
_global.parentMenuItems = new Array("Portfolio", "Services", "About", "Contact");


// define each child (sub-menu)
_global.Portfolio = ["goelegant.com", "openformats.com", "networkprodigy.com"];
_global.Services = ["Branding", "Site Design", "CMS", "Custom Web Application", "Identity"];
_global.About = ["Team"];
_global.Contact = ["Call Me", "Contact Form", "Contact Info"];


// array to hold the movieclips in
_global.topMenuMCs = new Array();
_global.topMenuTXTs = new Array();


//-----------------------------------------------------------
// prototypes to use for tweening, motion, etc


// prototype for tweening an object into its designated space with a lil' bit of style
MovieClip.prototype.moveIn = function() {
boxTweenX = new mx.transitions.Tween(this, "_x", mx.transitions.easing.Bounce.easeIn, -500, this._x, 3, true);
boxTweenX.cont_mc = this;
boxTweenX.onMotionFinished = function() {
//boxTweenXScale = new mx.transitions.Tween(this.cont_mc, "_alpha", mx.transitions.easing.Strong.easeOut, 99, 50, 1, true);
//boxTweenXScale.onMotionFinished = this.yoyo();
}
}

//-----------------------------------------------------------


// text formating for the menu
gTml.menu_fmt = new TextFormat();
with (menu_fmt) {
font = menuFont
size = menuFontSize
color = myTextLight;
}


//-----------------------------------------------------------

// function to draw the top menu
function drawMenu() {
for(i = 0; i < parentMenuItems.length; i ++) {
topMenuMCs[i] = eval(parentMenuItems[i] + "_mc");
topMenuTXTs[i] = eval(parentMenuItems[i] + "_txt");
gTml.createEmptyMovieClip(topMenuMCs[i], gTml.getNextHighestDepth());
topMenuMCs[i].createTextField(topMenuTXTs[i], gTml.getNextHighestDepth(), myX, myY, 60, 20);
with (gTml.topMenuMCs[i].topMenuTXTs[i]) {
border = false;
autoSize = false;
_alpha = "99";
selectable = false;
html = false;
embedFonts = true;
}
gTml.topMenuMCs[i].topMenuTXTs[i].text = parentMenuItems[i];
gTml.topMenuMCs[i].topMenuTXTs[i].setTextFormat(menu_fmt);
myY = myY + 30;
}
}


//-----------------------------------------------------------
// lets call functions to start drawing out the stage and moving the mc's in

// draw the menu
drawMenu();

Storing X And Y Coordinates In Array
Hi

I have a few items on the stage with different types of item.
cube_0 ++
square_0 ++
triangle_0 ++
and so forth

I have this scroll bar to rotate each item. When a user click outside of it, it will close down(removeMovieClip)
I want to store the last x and y coordinates of [let's say] cube_0 's scroll bar.. so that when a user re-opens the scrollbar, it will be at the last coordinate when they close it.

I'm thinking to do an array, but I don't know how to do it.
Any help would be greatly appreciated.

v

Copyright © 2005-08 www.BigResource.com, All rights reserved