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




Retrieving Data From A Datagrid



I have a form that users will fill in and a datagrid will be created using this info.I need to send this data to the site owner. I've read its not possible to email data direct from a datagrid. Has anyone come across a relatively simple solution?Maybe save this grid to another page where the site owner can browse them?Write the data to a database? or to an XML sheet and mail that?Any ideas or good tutorial pages?



KirupaForum > Flash > ActionScript 3.0
Posted on: 06-23-2008, 11:48 AM


View Complete Forum Thread with Replies

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

Retrieving Data
Hi,
I am trying to create a movie where it will take up a text from a location (say some other Text File) and display with animation.
1> How do I link the external file and create this movie?
2> What changes are required if I have to make the text animation same with the text changes? That is, in case I modify the text, how will that affect the animation in the text...

Please help me with this..
Thank you
Wishy

Retrieving Data
ive tried searching and using tutorials but they dont seem to work. i just want to get one line of data into the flash file.
ie. my shout.php will echo out 'myVar = abracadara' into a dynamic text which has turned into a symbol. its instance name is word and the variable is myVar.

for some reason, nothing is being read. is there some actionscript i need to use to update the symbol?


Code:
loadVariables("login.php", 0, "POST");
gotoAndPlay(2);
word =this.myVar;
my php is working perfectly, im working with flash mx 2004

thanks,
gg

Retrieving Data
I'm still having trouble with a simple bit of coe, I'm pretty sure that its down to my stupidity more than anything else but he goes:

I have an array with data in it, its a multidimensional array with unknown dimenstions, the data I want is in the 1st element. The data should call a function once rearranged here is what i have so far


ActionScript Code:
var tempObj=new object
tempObj.name=this.arr[0].shift //separates the name of function to passing data
tempObj.args=this.arr[0]//passes the arguments over
this[tempObj.name](tempObj.args]


alas it doesn't and I cannot find a viable workaround either... any ideas?


Zen

Retrieving Data From A Function
Hi all,


this is from kirupa.


additionator = function (answer) {
total = Math.round((Math.random()*10)+1);
return total;
};
final_answer = additionator(answer);
trace(final_answer);

Like all of my past learning and even now, i have no idea how to use functions like this.

I see that final_answer = math.random()*10+1

However, whats the purpose of answer.

See i know its a argument yeah, but had the function been:


additionator = function () {
total = Math.round((Math.random()*10)+1);
return total;
};
final_answer = additionator();
trace(final_answer);

why would that make No difference in my mind?

Can someone explain arguments to me?

Is this correct:


smoke = function (x, y, z){
total = x + y + z;
return total;
}

smoke (1,1,1);

would be smoke = 3;

?

If thats right, why cant i understand why answer would be relevant and more to the case what happened if

smoke (1,1);

because i missed an argument, what does that mean to flash?

thanks !!!!!!

Ronson

XML Class Not Retrieving Data
This is a class I wrote with the help of a book, which I'm using to try to retrieve some data from a basic xml file which has 3 root nodes and those having 3 child nodes. It is showing all attributes as undefined. I am new to actionScript2 so your guidence on this would really help. Thanks!


Code:
class XMLStats extends XML{
//create an array to pass back
public var statList:Array;
//create refernce to calling object
public var parent:Object;


public function XMLStats(XMLFileName:String, parent:Object){
super();

this.parent = parent;
//instantiate menu array
this.statList = new Array();
this.load(XMLFileName);

}
public function onLoad(success){
if (success){
trace("file loaded");
//access root nodes
var itemList:Object = this.childNodes;
//access child nodes
var itemListLen:Number = itemList.length;
trace("itemList attribute: "+ this.firstChild.attributes.CARTEXT);
for (var i = 0 ; i < itemListLen; i++){
var subList:Object = itemList[i].childNodes;
var subItemLen:Number = subList.length;
var itemObj:Object = {};

//create sub menu array
itemObj.sub = [];
itemObj.CARTEXT = itemList[i].attributes.CARTEXT;
//itemObj.statistic = itemList[i].attributes.STATISTIC; not needed yet
//iterate through current items child nodes
for (var j = 0; j < subItemLen; j++){
//create sub menu object
var subItemObj:Object = {};
subItemObj.OPTION = subList[j].attributes.OPTION;
//populate sub Item list array
itemObj.sub.push(subItemObj);
}
this.statList.push(itemObj);
trace("statList: "+ this.statList);
}
//parent.loadStats.push(this.statList); //will use this to display items
}else{
trace("Content failed to load");
//handle file load error
}

}

}

Retrieving Data From An XML File
I have a problem to view the “date” attribute in my flash project
Please help !!!




Code:

<?xml version="1.0"?>
<comments>
<item date='343434'>flash flash flash


<p> </p>
</item>
<item date='121212'>test test

<p> </p>
</item>
</comments>



ActionScript:

Code:

var theXML:XML = new XML();
theXML.ignoreWhite = true;
my_txt = "";

theXML.onLoad = function() {
var nodes:Array = theXML.firstChild.childNodes;
for(i=0; i<nodes.length; i++) {

my_txt3 = nodes[i].firstChild.attributes.date + "

"

my_txt4 = nodes[i].firstChild.nodeValue + "
";

my_txt4 = my_txt4.split("
").join("");
my_txt += my_txt3 + my_txt4;


}

my_txt2.text = my_txt;

}
theXML.load("con_flash4.php")

Retrieving Data From A Sharedobject...
Hi guys,
im new to this sharedobject lark..
I have some code so far which i believe puts a bunch of variables into a sharedobject for safe keeping on the press of a button.


Code:
testb.onPress = function() {
trace("bosh")
so = SharedObject.getLocal("test");
so.data.test1 = 12;
so.data.test2 = 13
so.data.test3 = 14
so.flush();

};
I just dont no how to get them back.
is their away of getting them to display in say a dynamic text field direct from the shared object?

thanks for any help

cheers
aidan.

[8] Troubles Retrieving Data From XML - Again
Hi guys

Can somebody tell me, why trace(oXml.childNodes.length) benieth keeps returing undefined? I can tell, that the Flash loads the data fine, when I debugging my movie. I'm can't seem to figur it out ..


Quote:




var sXml :String='content.xml'
var sXml:String
var oData :classes.DataClass
var oListener:Object
var oXml:XMLNode


function getXML ( sXmlUrl ){
sXml = sXmlUrl
oData =new classes.DataClass( sXml );
oListener=new Object;

oListener.done = function( oEvent ) {
oXml =oData.getXML();
}
oData.addEventListener( 'done', oListener );
}
getXML ( sXml )


function init(){
trace(oXml.childNodes.length)
}

init()

Retrieving Data From Radiobuttons
Hey everyone!

I'm new here and I tried to search for an answer for my problem, but couldn't find it..

So,

I'm creating a quiz with ten questions. I have everything setup the way I want it and the idea is to have the user click through all of the questions and then move on to the frame where his/her total score will be announced.

Basically I have 10 frames with the questions and each of these frames contains 4 radiobuttons, belonging to radioGroup1-10. I have given each of these buttons in each of the frames a data value, ranging from 1-4.

Now the question is, how do I retrieve the total value (from questions 1-10) in the last frame? I have tried to use the TextArea-component with no luck. I also searched the Flash help, but couldn't find the answer I was looking for. I'm using Flash 8. I guess I need to add some ActionScript somewhere, but can't really figure it out..

If anyone can help me, that'd be really great!

Retrieving Data From An XML File
I having some difficulties to retrieve a variable from an XML file

I have a problem to view the “date” attribute in my flash project
I am using this line in the acrionscript but I is not working

Code:
my_txt3 = nodes[i].firstChild.attributes.date + "

"
If you have any idea Please help
Thank You


XML:


Code:

<?xml version="1.0"?>
<comments>
<item date='343434'>flash flash flash


<p> </p>
</item>
<item date='121212'>test test

<p> </p>
</item>
</comments>



ActionScript:

Code:

var theXML:XML = new XML();
theXML.ignoreWhite = true;
my_txt = "";

theXML.onLoad = function() {
var nodes:Array = theXML.firstChild.childNodes;
for(i=0; i<nodes.length; i++) {

my_txt3 = nodes[i].firstChild.attributes.date + "

"

my_txt4 = nodes[i].firstChild.nodeValue + "
";

my_txt4 = my_txt4.split("
").join("");
my_txt += my_txt3 + my_txt4;


}

my_txt2.text = my_txt;

}
theXML.load("con_flash4.php")

Retrieving Data From PHP Into Flash
Argh, I have spent a mindless hour or two working on finishing touches for my ava creator for my site. The good news is that it saves your changes and it overall looks alright. The bad news is I can't get it to view your ava properly...

I have the loadvariables thing to get the variables, so that should be all good and well, but I'm not sure how to get it to recognize the variables from the PHP file. :/ I've been looking around at all sorts of tutorials to try and get it working, but it just won't work...so any help would be appreciated. ^^()

For example, I want it to display their username under their ava, but when I try it is always says "undefined" instead. :/

EDIT: nevermind, I finally found the solution! *dramatic happy music* I mistyped one of the variable names when printing it *sweatdrop*

Retrieving Data For A Cookie
I've just started out working with cookies in flash and looked at the poms tutorials http://www.kirupa.com/developer/mx/sharedobjects.htm

I think its quite kool how flash can see what OS the user has and want to know what other similar things it can do?

Is there a list of commands that could get the users browser software etc for example?

Retrieving Data From PHP Into Flash
Argh, I have spent a mindless hour or two working on finishing touches for my ava creator for my site. The good news is that it saves your changes and it overall looks alright. The bad news is I can't get it to view your ava properly...

I have the loadvariables thing to get the variables, so that should be all good and well, but I'm not sure how to get it to recognize the variables from the PHP file. :/ I've been looking around at all sorts of tutorials to try and get it working, but it just won't work...so any help would be appreciated. ^^()

For example, I want it to display their username under their ava, but when I try it is always says "undefined" instead. :/

EDIT: nevermind, I finally found the solution! *dramatic happy music* I mistyped one of the variable names when printing it *sweatdrop*

Saving Data To Database And Retrieving It
does anyone know of a tutorial that explains how to save variables from flash to any database and the retrieving it using ASP or PHP scrips? i really need a very detailed tutorial since i dont know nothining of php or asp or flash action scrip that deals with sending and receiving variables.. maybe a tutorial on how to use the new flash communication thing?

Retrieving XML Data In Actionscript For Placement. Help
Here's my xml code that I want to retrieve.
I can get to this layer and display it in the output window, but I want to check the position(1,2,3...) and determine which holder my movie, jpeg, or text should be placed in. Could someone give me assistance on this topic.
I'm just getting the hang of xml with actionscript, so bare with me.

<xml>
.
.
.
<position id = "1">
.
.
</position>
<position id = "2">
.
</position>
</xml>


<as>
if(level3.nodeName == "position")
{
trace("we have a winner");
for(attr in level3.attributes)
{
trace("level3PosAttr = " + level3.attributes[attr] + " = " +attr)
}
if(level3.attributes[attr] == 1)
{
trace("another winner");
}
}
else{trace("we lost him");
}
</as>

Help Writing To And Retrieving Data From Txt File
Hi folks,

I have a game that works the same way like hangman. I would like our faculty to be able to customize it, so I created an input form where they can enter the words and hints they would like to use, hit the save button and that saves sinkorsail.txt so when they start the game itself, it pulls the new data from sinkorsail.txt. For some reason (probably my A.S. skill level :-) I can't get this thing to work.

Due to size limitations, I'm sending only the input form together with the txt file. If anyone is interested, I can email the game itself (the zipped file is about 600 kb)

Any help or suggestions on this will be tremendously appreciated.

Sawy

Retrieving And Saving Data Into Database
Goodday to all Flash users,

I am currently using Flash MX to create a simple e-Book. One of the function is Bookmark. This function will bring up a box that contains a listbox, one "Add" button and one "Delete" button.

For example when a user is in Chapter 5, then click on "Bookmark" in the menu, that box pops up. When he/she clicks on the "Add" button, "Chapter 5" would be displayed in the listbox.

I need to save this info into a database so that when user opens the e-Book, the data should be retrieved from the database and store into the Flash e-Book.

Can somebody show me the code to do this please? Or maybe a link to a tutorial on this perhaps? I had went thru the Macromedia Flash Support Center on Creating Forms with UI components tutorial, but it doesn't teach me how to save/retrieve data into/from database.

Would appreciate it very much if anyone could help me on this, thanks a bunch!

Retrieving Data From Radio Button
I'm using Flash to create a form. The form submits and process through a PHP file, which then sends me an e-mail.

In my form, I have 2 sets of radio buttons...one set asking a persons age range (3 radio buttons) and the other set of radio buttons asking for the persons sex (2 radio buttons)

How can I get the data from the RadioButton component?

In my text fields where they type their information, I have it set up like so:

text field with instance name of "name"

the send button has this AS on it:


Code:
on(release){
member_name = _parent.name.text
}

and then of course it goes through and processes member_name in the php file and sends me the e-mail. It works just fine...but now i need to figure out how to get my radio button data to submit too

Thanks!

Trouble Retrieving Loaded XML Data.
I'm not sure what is happening, but when I Debug the code the traces happen in the following order

AshlyTipton
XMLLoader
getXMLData
completeListener

which I think is resulting in a null value being returned by xmlLoader.getXMLData();. Any ideas why getXMLData is being executed before completeListener?


//AshlyTipton.as
package {
import flash.display.*;
import main.*;

public class AshlyTipton extends Sprite {
private var xmlLoader:XMLLoader;

public function AshlyTipton () {
trace("AshlyTipton");
xmlLoader = new XMLLoader();
xmlLoader.getXMLData();
}
}
}

//XMLLoader.as
package main {
import flash.display.*;
import flash.events.*;
import flash.net.*;

public class XMLLoader {
private var xmlData:XML;
private var urlLoader:URLLoader;

public function XMLLoader () {
trace("XMLLoader");
var urlRequest:URLRequest = new URLRequest("data.xml");
urlLoader = new URLLoader;
urlLoader.addEventListener(Event.COMPLETE, completeListener);
urlLoader.load(urlRequest);
}

public function completeListener (e:Event):void {
trace("completeListener");
xmlData = new XML(urlLoader.data);
}


public function getXMLData () {
trace("getXMLData");
return xmlData;
}
}
}

[F8] Retrieving Data From Database Into Flash
I only just figured out how to implement a login system into flash using PHP to connect to the database. But now I need to know how to call data from the database into flash, so that once a user logs in, they have access to their exclusive account and such.

For example, I have a field in the database called "name" and I need firstly a button so that when I click on it, it sends a query to the MySQL database, and inputs a new name into the "name" field for their specfic account.

If anyone has a tutorial that might be helpful, or knows how to do something along these lines, I would much appreciate any information that is shared.

If you know how to do something similar, please post instructions because I can have a fiddle with the code to try and change it to my needs.

Thanks in advance!

Retrieving Data From $_POST With Flash.
I've seen plenty of examples of sending data to to server side scripts via the $_POST array. Is it possible to go the other way and pull data FROM the $_POST array into Flash?

Thanks,

Matt

Problems With Retrieving Data When Uploaded To IIS
I have created a very simple SWF file which connects to an XML source using the XMLConnector and simply retrieves the value and outputs it to a Label.

This all works fine when the SWF is run locally (on any machine) but when it gets transfered to an IIS server and a connection is made via IE, the data never gets populated.

Any ideas?

Thanks.

Network Settings Retrieving XML Data
Hi,

I'm finalizing a project that needs to retrieve weather information to display.

There's a main movie, that loads another movie (wich is local). This last one gets xml information, from an external site. Localy this works fine, but when I put in a website, the network security warning appears.

I tried to publish with network access, and local. I also changed that in the main movie. Triel allowdomain and it seems that it can't work.

Any suggestions?

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.

[AS3] Retrieving Variables URLLoader.data
hey, im back with another as3 question

i've been setting up a high score table in my game, and everything is working, but i cant work out how to get variables from the URLLoader.data that im retrieving

if i trace loadedScores.data, i get this
&name1=matt&score1=323250&name2=1234567890123456.. . and so on

i've tried passing it to a URLVariables constructor, but it says the string doesnt contain the correct name/variable pairs or something, and loadedScores.data.name1 doesnt work...

thanks for your help, cant work this one out for the life of me
cheers

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.

(as) Displaying/Retrieving Data From A Variable
There must be someone who can help me with this!

I have an input field that sends the input data to a dynamic text field.. (variable) pretty simple...

But, how do i, from another part of the flash movie, display/retrieve whats been stored in that variable and/or put it into a text box????

Please any help!

In appreciation and admiration...

Retrieving Data Though Excel Sheet In Flash
Hi,

Can anyone help me by guiding how shd i retrieve data from a excell sheet in flash movie.

For instance: i have a text field and a "go" button. Now once i enter word "xyz" then it shd retrieve data of mr. xyz from a excel sheet which we have probably maped with this movie.

I dont not whether this is possible or not, but if possible can some one please help me by sending me the code.

Regards,

Nisar

Retrieving Data From Access Database From Flash
Hi

Can anyone please tell me how to do the following:

Iv got asp code which retrieves data from the access database, but for the time being i have been using a normal html page, now i want to replace the html page for a flash page. On this flash page there would be one button which when the user clicks should perform the asp action. I think this has got something to do with action scripting but im not sure!!!

Any help would be great..

Many Thanks

Retrieving Data From Aspx And Displaying It In Flash
hi all

how to retrieve data from aspx and display it in flash

i have username variable and value nite in aspx

how to display the value nite in dynamic textfield in flash

pls help urgent need
thanks

Error #1010 By Retrieving Data (AMFPHP)
Hello,
I’m trying to display data from my MySQL database with AMFPHP. That works fine and I see the text, but I still get an error:

TypeError: Error #1010: A term is undefined and has no properties.
at index_fla::chart_42/onResultaat()


Code:
function onResultaat(responds:Object):void {
var t:Array = responds.serverInfo.initialData;
for(var i:uint = 0; i < 5; i++) {
var q:Charttext = new Charttext();
addChild(q);
q.chart_txt.text = t[i][1];
}
}
If I replace it with this, I don’t get the error. I hope someone can help me.

Code:
q.chart_txt.text ="Test";
Thanks

Retrieving Data From Access Database From Flash
Hi

Can anyone please tell me how to do the following:

Iv got asp code which retrieves data from the access database, but for the time being i have been using a normal html page, now i want to replace the html page for a flash page. On this flash page there would be one button which when the user clicks should perform the asp action. I think this has got something to do with action scripting but im not sure!!!

Any help would be great..

Many 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 ?

Retrieving Mysql Data With LoadVars Object
retrieving mysql data with loadVars object
im trying to retrieve mysql data using the loadVars object.
having a bit of trouble though, it seems i can only access the data that gets loaded into the object from inside the object

ie)


ActionScript Code:
// create new load vars object
listVars = new LoadVars();
 
// send + load vars
listVars.sendAndLoad("get_emails.php", listVars, "POST");
 
listVars.onLoad = function (success) {
        if (success) {
                myArray = new Array();
                myArray = this.emails.split(",");
                _root.test.text = myArray;
        } else {
                gotoAndStop ("noemails");
        }
}


_root.test.text = myArray will print the array values in the text box on root...but i where to write that line outside the object like so:

_root.test.text = listVars.myArray;

it would print nothing.

i am confused about the targeting of the variables from within the loadVars object. it would be really handy if i could access those variables from any timeline but right now it seems as though it is impossible.

Retrieving Array Data From Sharedobject - Elements Are 'undefined'
I think that I am saving it correctly because i have traced the array just before i use .flush() to save the sharedobject.

However when I load the swf again, I trace the array - it finds it but all 8 elements are retrieved as undefined. Can anybody help to see why?

Here is my flash file:

http://www.nottingham.ac.uk/home/ccz...llRenderer.fla


Thanks

DATAGRID+data's
Hi everyone,
Anyone pls help me in this issue.I am really going mad with this for a week time.pls someone help.

I have to create dynamic datagrid for this project .I know how to create that.
My probelem is i am using AMFPHP using this i am retreiving records from the database and i am doing some calculation in flash to make it display in the datagrid.What is happening is i can't able to embed the data in all the datagrids.onlythe first is getting the values.I really don't know how to use datagrids but i tried many from this forum but gone in vain.I am about to attach the files but there is a server error so i am pasting the coding.pls take a look.


CODE:

ActionScript Code:
#include "NetDebug.as"
#include "NetServices.as"

NetServices.setDefaultGatewayUrl("http://192.168.5.229/newscriptorium/Radhi/0.5.1ver/DashBoard/dash_gateway.php");
conn = NetServices.createGatewayConnection();
var servD = conn.getService("second",this);

_root.show.text = "PROJECT INFO";
_root.show.backgroundColor = "0x3399CC";
_root.show.textColor = "0xFFFFFF";

 servD.CntrlName();//retreives control names
 servD.ProjectName();//retreives project name
 servD.ProjectDescr();
 servD.ProjectLevelName();//retreives level name
 

 
var StoreHeadVal = new Array();
var StoreVal = new Array();
var ProjectDesc = new Array();
var ProjectTime = new Array();
var extra;

var ItemLen = new Array();
var ItemLenVal = new Array();
var testLen=0;
var testLenVal=0;

var Store= 0;
var Initial=0;

 function CntrlName_Result(result_rs)
 {
    //trace(result_rs);
    var i,j,z,z1,len;
    var newLen;
    var controlid,controlid1,Swap;
    var Control = new Array();
             var CNames= new Array();
    var ConCat= new Array();
    var SubLen;
    var totalLen = result_rs.length;
   
     for(i=0;i<totalLen;i++)
     {
        len = result_rs.getItemAt(i).length;
        //trace("Len :"+ len);
           
         for(j=0;j<len;j++)
         {
         controlid = result_rs.getItemAt(i).items.getItemAt(j).controlid;
         controlid1 = result_rs.getItemAt(i+1).items.getItemAt(j).controlid;
       
        if(controlid != controlid1)
         {
            // trace(i+"jjj "+ j);
             newLen = i;
             Control.push( result_rs.getItemAt(i).items.getItemAt(j).controlname);
            //trace("new  "+Control[j] +"j "+j);
           

           
         }
        
         }
         //trace("new  "+Control);
       
         Swap = newLen;
         //trace("IVAL "+i+"swap "+ Swap);
         ConCat.push(Control.splice(0,len));
         //trace(ConCat);

         if(i==Swap)
         {
       
                 CNames.push(ConCat[Swap]);
         //trace(CNames[0])//IMP
          testLen=testLen+len;
          ItemLen.push(testLen);
          trace("TTT "+ ItemLen);
          testLenVal = ConCat.length;
          ItemLenVal.push(testLenVal);
          //trace("NEW "+ ItemLenVal);
          
         }
                
     }
    
    //trace("new  "+Control);
   //trace(CNames.length)
 
    ///////////////////////////DATAGRID DUPLICATION SHOULD BE DONE HERE////////////////////////
     for(z=0;z<CNames.length;z++)
     {
        
         SubLen = CNames[z].length
        //trace( SubLen );
         for(z1=0;z1<SubLen;z1++)
         {
             if(z1<SubLen)
             {
                StoreHeadVal.push(CNames[z][z1]);
                //trace("SS  "+StoreHeadVal);
               
             }
           
             // trace("SS  "+StoreHeadVal+"Z "+ z +"Z!!!!! "+ z1);
            
         }
       
       
    }
        
 }
 
  function ProjectName_Result(result_rs)
 {
     var ProjectTitle = new Array();
     var bound = result_rs.length;
     var setTitle,k,m,n;
     var Descr,Time;
    
    // trace("PRNAME "+result_rs.getItemAt(0).description);
   
     for(k=0;k<bound;k++)
     {
         //trace(result_rs.getItemAt(k+1).projecttitle);
         //trace(bound[k]);
         //trace("NEW "+ result_rs.getItemAt(k).projecttitle);
         var FirstTitle = result_rs.getItemAt(k).projecttitle;
         var SecondTitle = result_rs.getItemAt(k+1).projecttitle;
        
         Descr = result_rs.getItemAt(k).description;
         Time = result_rs.getItemAt(k).TimeCreated;
         ProjectDesc.push(Descr);
         ProjectTime.push(Time);
         if(FirstTitle!=SecondTitle)
         {
            ProjectTitle.push(FirstTitle);
           
         }
                               
     }
        
           
        for(m=0;m<ProjectTitle.length;m++)
            {
         _root["project"+m].text = "PROJECT :"+ ProjectTitle[m];
            }
        
 }

 function ProjectLevelName_Result(result_rs)
 {
     //trace(result_rs);
    var LevelName;
    var LenVal = result_rs.length;
    var SubArrLen,SubItemLen;
    var p,q,r,r1;
    var CharVal,IntVal,DateVal,BoolVal;
    var TotVal = new Array();
    var HoldArr = new Array();
    //var StoreVal = new Array();
   
    //trace(result_rs.length);
     for(p=0;p<LenVal;p++)
     {
         SubArrLen = result_rs.getItemAt(p).length;
        // trace("SUB "+ SubArrLen);

         for(q=0;q<SubArrLen;q++)
         {
            LevelName = result_rs.getItemAt(p).items.getItemAt(q).levelname;
            //trace("test "+ result_rs.getItemAt(p).items.getItemAt(q).levelname);//+"P  "+p+"Q "+q);
            CharVal = result_rs.getItemAt(p).items.getItemAt(q).fld_varchar;
            // trace("test "+ result_rs.getItemAt(p).items.getItemAt(q).fld_varchar);//+"P  "+p+"Q "+q);
            IntVal = result_rs.getItemAt(p).items.getItemAt(q).fld_int;
            //trace("test "+ result_rs.getItemAt(p).items.getItemAt(q).fld_int);//+"P  "+p+"Q "+q);
            DateVal = result_rs.getItemAt(p).items.getItemAt(q).fld_date;
            // trace("test "+ result_rs.getItemAt(p).items.getItemAt(q).fld_date);//+"P  "+p+"Q "+q)
            BoolVal = result_rs.getItemAt(p).items.getItemAt(q).fld_bool;
            //trace("test "+ result_rs.getItemAt(p).items.getItemAt(q).fld_bool);//+"P  "+p+"Q "+q)
            if(CharVal != "")
            {
                TotVal.push(CharVal);
            }
            if(IntVal!= "")
            {
                TotVal.push(IntVal);
            }
            if(DateVal!= "")
            {
                TotVal.push(DateVal);
            }
            if(BoolVal!= "")
            {
                TotVal.push(BoolVal);
            }
            if(CharVal == "" && IntVal == "" && DateVal == "" && BoolVal == "")
            {
                TotVal.push("");
            }
            //trace("TOT " + TotVal);
           
         }
        //trace("LEVEL "+ TotVal+"QQQQQ "+q);
        //trace("TOT " + TotVal.splice(0,SubArrLen));
        HoldArr.push(TotVal.splice(0,SubArrLen));
        //trace("LEVEL "+ HoldArr.length+"QQQQQ "+q);
     }
        //trace("TOT " + TotVal.splice(0,SubArrLen));
        //trace(HoldArr);
       
   
    for(r=0;r<HoldArr.length;r++)
    {
        SubItemLen = HoldArr[r].length;
        //trace(SubItemLen);
       
        for(r1=SubItemLen;r1>=0;r1--)
        {
           
            if(r1<SubItemLen)
            {
            //StoreVal = HoldArr[r][r1];
            StoreVal.push(HoldArr[r][r1]);
            //trace(StoreVal);
            }
           
        }
        _root["title"+r].text  = "FORM NAME :"+LevelName;
    }
       
      // trace(StoreVal);
          
     var TestArr = new Array();
     //trace("TEST ---LEN "+StoreVal.length);
     var val =StoreVal.length;
     var SubItemVal;
     var item1,z,Test,i;
   
    
     //trace("TTT "+ ItemLenVal);
     for(i=0;i<ItemLenVal.length;i++)
     {
         SubItemVal = ItemLenVal[i];//*4;
         var HeadVal = ItemLen[i];
         trace( SubItemVal+"HEAD "+HeadVal);

         for(z=Initial;z<SubItemVal;z++)
         {
                                 
           // var HeadVal = ItemLen[i];      
            for(Test=0;Test<HeadVal;Test++)
            {
             TestArr.push(StoreVal[Test]);
             //trace("TESTAR "+ TestArr);
             item1 = TestArr;
            //trace("IITTT----- "+ Initial+"z**** "+SubItemVal);
            
            }
           myGrid0.addItem(item1);
                    
         }
           Initial=SubItemVal;
         //myGrid0.addItem(item1);
       
        // trace("TESTARR "+ TestArr);
          
     }
    // trace("TESTARR "+ TestArr);
    //myGrid0.addItem(item1);
      // _root["myGrid"+i].addItem(item1);
       trace(item1);

    //myGrid0.dataProvider = TestArr;
    
    
        
    //}
   
    trace(item1);
     //trace("TTT "+ ItemLen);
    //trace("TESTAR "+ TestArr);
    //trace(StoreVal);
    //trace("HHH "+StoreHeadVal);
   
       
        var myVar;
        var IncVar
        for(var j=0;j<ItemLen.length;j++)
        {
        //trace(ItemLen.length);
        var item;
        var Store1 = ItemLen[j];
        for(myVar=Store;myVar<Store1;myVar++)
        {
        //trace("STORE "+ Store +"STORE! "+ Store1);
        //trace("MY "+ myVar);
        if(myVar<Store1)
        {
        item = StoreHeadVal.getItemAt(myVar);
        //trace("ITEM :"+item);
         //_root["myGrid"+j].getColumnAt(myVar).headerText = item;
        }
       
         // _root["myGrid"+j].getColumnAt(myVar).headerText = item;
           _root["myGrid"+j].addColumn(item);
        
                        
        }
        //trace("JJ "+j);
       _root["myGrid"+j].addColumn("Description");
       _root["myGrid"+j].addColumn("Time");
        trace("DESCR "+ ProjectDesc);
        for(n=0;n<ProjectDesc.length;n++)
                {
                                           
                  _root["myGrid"+n].editField(n,"Description",ProjectDesc[n]);
                  _root["myGrid"+n].editField(n,"Time",ProjectTime[n]);     
                }
       
        Store= Store1 ;
        
        }
        
         /* myGrid0.getColumnAt(4).headerText = "Description";
          myGrid0.getColumnAt(5).headerText = "Time";*/
          
    /////////////////////////////SINGLE GRID           
                /*myGrid0.addColumn("Description");
                myGrid0.addColumn("Time");*/
               
            //trace("DESCR "+ ProjectDesc);
            //trace("DESCR "+ ProjectTime);
            for(n=0;n<ProjectDesc.length;n++)
                {               
                    /////////////////////////////SINGLE GRID           
                    /*myGrid0.editField(n,"Description",ProjectDesc[n]);
                    myGrid0.editField(n,"Time",ProjectTime[n]);*/
                   
                }
               
               
 }
 
 
 
 function ProjectDescr_Result(result_rs)
{
    //trace(result_rs);//PROJECT NAME
    var descr = result_rs.getLength();
    //trace(descr);

    for(var j=0;j<descr-28;j++)
    {
        var descrVal = result_rs.getItemAt(j).description;
        //myGrid.setDataProvider(descrVal);
        //trace(descrVal);
        //var vvv = myGrid.editField(4,'Description',descrVal);
    }
}
So pls some one help me.
Thanks in advance.

Get The Data Out Of A Datagrid
I would like to get the data that is in the datagrid. Not the index or the columnName, but the actual data that is held in the cells.

Such as, the column ProjectName, contains a list of all the different project names (projectA, projectB).

LMK

Thanks,

Ken M.

How Do I Specify A Data Value For Row In Datagrid
I would like to assign a value to element into a datagrid row without the value being displayed in the grid.

Thanks

Loading Data Into Datagrid, Please Help Me
How I put these arrays into the datagrid component?

header_array = ["id", "text"];
id_array = ['1', '2', '3', '4'];
text_array = ['asdasd', 'asdasdas', 'asdasd', 'asdasd'];

My problem here its that the headers change on request so I cant do this:


item [0] = {id : "1", text:"asdasd"}
item [1]= {id : "1", text:"asdasd"}
item [2]= {id : "1", text:"asdasd"}

grid.addItem(item);

Is there any other way to do this?

thankz

Extracting DataGrid Data
Ok, now I'm losing my head.

I've got my array from my database, I've rebuilt the array as label:data pairs, and I've put that into a dataGrid component with no problem.

Now, after the user edits the data I would like to grab that data back out of the grid.

As a test, I've tried things like this:


Quote:




_root.testString = this.reportGrid.getItemAt(3).data;

and

_root.testString = this.reportGrid.getItemAt(3, Pretest).data;

and

_root.testString = this.reportGrid.getItemAt(3, "Pretest").data;




I must be missing something obvious....I've also tried snagging the dataProvider array data with no luck.

Anyone have a clue about this? I've looked everywhere online without any success.

Thanks,

Hollow Planet

Fill Datagrid With Xml Data
Hi,
i have a xml-file with some meeting-data in it.

I need two datagrid.
1. Meeting in Progress
2. Next/Upcoming Meetings

How do i make this the fast and easiest way?

i dont have a lot experice with Flash Components.

Thx

How To Reset Datagrid Data?
I can successfully populate a datagrid with the results of a sendAndLoad using the following code. However, when I issue a new sendAndLoad (from a listbox) the resulting data is added to the end of the existing data in the datagrid.

I want the new data to replace the old data, but cannot figure out how to do this.

(lv_receive2 is the result of a sendAndLoad)
(detailgrid is my datagrid)

Any help or advice greatly appreciated.

Thanks in advance,

Marsbar101



detailsArray = new Array();
detailsArray = lv_receive2.details.split("£");
len = detailsArray.length;

for (i = 0; i < len; i++) {
detailline = detailsArray[i];
detdetail = detailline.split('!!');
myDp3 = { lname:detdetail[2], fname:detdetail[1], note:detdetail[5], phonework:detdetail[3], phonehome:detdetail[4] };
detailgrid.addItem(myDp3);
}

How To Retrieve Data From Datagrid?
Hi

To add the data to DataGrid i used the following code:


Code:
var my_dg:mx.controls.DataGrid;
my_dg.addColumn("name");
my_dg.addColumn("score");
//
myData="name1,35,name2,50,name3,75,name4,100,name5,125,name6,150,name7,175,name8,200,name9,225,name10,250"

var myDP_array:Array = new Array();

function addData():Void {

var my_array:Array = myData.split(",");
for (var i = 0; i<my_array.length; i++) {
myDP_array.push({name:my_array[i], score:parseInt(my_array[i+1])});
i++;
}
my_dg.dataProvider = myDP_array;
}

//
addData()


If i click on button i want to retrieve the data from data grid. The retrieved data should be the same order the data i have provided to the DataGrid.

Can any one help
Thanks in advance

Datagrid & Data Retrieval
I am using Flash CS3 and I am currently working on redesigning an order form which uses some buttons to set variables and a few input text boxes. There is a confirm button that takes the strings set in the variable and what the user has typed in the input boxes and adds each item to a datagrid in seperate columns. What I'm trying to find out is if there is a way, once the user has finished adding items to his order, taking the information from the datagrid and extracting/retrieving it so I can put it into a long string and email it. Alternatively if there is a better way of displaying the ordered items, I would happily not use a datagrid. I have searched the web and maybe I didn't search for the right thing, but I can't seem to find any answers about the possibility of extracting data from datagrids. Any help would be greatly appreciated.

[F8] Using Data From ComboBox And DataGrid
Hi there!

I have a ComboBox (CBBUY) and a DataGrid (DGBUY).
In the ComboBox, user choose Items Issues of a magazine).
In the DataGrid appear as Objects all the chosen Items on three columns:
Item number (nber_dgc), kind (kind_dgc) and quantity (qty_dgc), default value = 1 (qty_dgc is editable so user can modify it).
kind_dgc commands the prices to pay as there is single and double Items.


Questions:

How do I pull out the data contained in DGBUY with updated quantities and then calculate for each row the price to pay depending of the kind_dgc parameter?
Should I turn Objects in DGBUY to Strings?
And how I extract the quantity from each Object in DGBUY?

In the future:
I wish to use a DataGrid with CellRenderer.
Where can I find a GOOD Tutorial for this task?

Thank you very much in advance for your answers!

Best regards,
Gerry

Data FROM Datagrid To MySQL
I have no problems populating a datagrid from both the database and user entry. What I am confused is how to then go back to the datbase! I have been unable to find any examples of how to insert/update values in a database (mysql) with values from a datagrid.

I can use amfphp or PHPObject to talk to php and then mysql. I just don't understand the best method (best meaning easiest ) to do this.

TIA for any pointers

Loading XML Data Into A DataGrid
hi
i am new to AS3. As I was going thru live docs, i was able to load data from an xml file into a DataGrid, I want to know how to make it clickable - on clicking i want a specific data of a column display in a TextArea
Here is my xml
<sites>
<urls link="

Filtering Data In DataGrid
hi
i am new to AS3. As I was going thru live docs, i was able to load data from an xml file into a DataGrid, I want to know how to make it clickable - on clicking i want a specific data of a column display in a TextArea
Here is my xml
<sites>
<urls link="

Data Change In Datagrid
Is it possible to know if the user has changed any data in the cells in Datagrid?
I know I can copy the whole grid into a temporary array and compare finally but is there any other way out?

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