Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-26-2008, 02:21 AM   #1
ModernMerlin
Registered User
 
Join Date: Jul 2008
Posts: 40
Default [AS2] Datagrid populating issue

I have been at this most of the day and no matter what I do I cant seem to get the datagrid to populate from the database through PHP.

I know the PHP works because I built a test page and passed the same value to it. It pulled up the long flash array it was supposed to with the echo.

Here is the ActionScript 2.0

ActionScript Code:
stop(); // define global styles and easing equations for the problems_cb ComboBox _global.style.setStyle("themeColor", "red"); _global.style.setStyle("fontFamily", "Verdana"); _global.style.setStyle("fontSize", 10); _global.style.setStyle("openEasing", mx.transitions.easing.Bounce.easeOut); //Getting the stuff for the datagrid var lvSend:LoadVars = new LoadVars(); var lvReceive:LoadVars = new LoadVars(); lvSend.tCityWhack = tCityWhack.getValue(); trace(lvSend.tCityWhack); lvSend.sendAndLoad("http://www.wizeguyzgamez.com/attack.php", lvReceive, "POST"); lvReceive.onLoad = function(success) { if (success) {             for (var i:Number=0; i < this.varNum; i++) {       attack.push(       {online:this["varOnline"+i], mobster:this["varName"+i],        button:this["dButton"+i], crew:this["dCrew"+i], net:this["varNet"+i]       });     } } }; dgMobster.setSize(470, 300); // set dataProvider for datagrid dgMobster.dataProvider = attack; // Add columns to grid and add data. dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); // Make DataGrid non-editable. dgMobster.editable = false;     // set formatting of online column     // auto-sort will work fine for this column          dgMobster.getColumnAt(0).width = 45;          dgMobster.getColumnAt(0).headerText = "Online";     // set formatting of mobster column          dgMobster.getColumnAt(1).width = 125;     // trap header click event to sort case-insensitive on this field          //dgMobster.getColumnAt(2).sortOnHeaderRelease = false;     // this property will keep track of whether sort is ascending or descending          dgMobster.getColumnAt(1).sortedUp = false;          dgMobster.getColumnAt(1).headerText = "Mobster";     // set formatting of button column          dgMobster.getColumnAt(2).width = 75;     // trap header click event to sort numerically          dgMobster.getColumnAt(2).sortOnHeaderRelease = false;          //dgMobster.getColumnAt(3).sortedUp = false;          dgMobster.getColumnAt(2).headerText = "Button Men";     // set formatting of crew column          dgMobster.getColumnAt(3).width = 75;     // trap header click event to sort numerically          //dgMobster.getColumnAt(4).sortOnHeaderRelease = false;          //dgMobster.getColumnAt(4).sortedUp = false;          dgMobster.getColumnAt(3).headerText = "Crew";     // set formatting of net column          dgMobster.getColumnAt(4).width = 75;     // trap header click event to sort numerically          //dgMobster.getColumnAt(5).sortOnHeaderRelease = false;          //dgMobster.getColumnAt(5).sortedUp = false;         dgMobster.getColumnAt(4).headerText = "Networth";

Any help would be great! Thanks!

MM
ModernMerlin is offline   Reply With Quote
Old 07-28-2008, 06:36 PM   #2
ModernMerlin
Registered User
 
Join Date: Jul 2008
Posts: 40
Question [AS2] Datagrid population...

I am trying to populate a datagrid using AS 2.0 and MySQL by way of PHP The Actionsript goes to the php and pulls the data from the database (I have tested it both with PHP and trace once it comes back to flash). The use is in populating the datagrid from the array. Not sure what I am doing wrong here but if someone could look at my code and give me a hint that would be great!
Thanks!

MM

ActionScript Code:
stop(); // define global styles and easing equations for the problems_cb ComboBox _global.style.setStyle("themeColor", "red"); _global.style.setStyle("fontFamily", "Verdana"); _global.style.setStyle("fontSize", 10); _global.style.setStyle("openEasing", mx.transitions.easing.Bounce.easeOut); //Getting the stuff for the datagrid var lvSend:LoadVars = new LoadVars(); var lvReceive:LoadVars = new LoadVars(); lvSend.tCityWhack = tCityWhack.getValue(); trace(lvSend.tCityWhack); lvSend.sendAndLoad("http://www.mydomain.com/attack.php", lvReceive, "POST"); lvReceive.onLoad = function(success) { trace(this.varNum); }; dgMobster.setSize(470, 300); // Add columns to grid and add data. dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); dgMobster.addColumn("title"); // Make DataGrid non-editable. dgMobster.editable = false; // set formatting of online column // auto-sort will work fine for this column dgMobster.getColumnAt(0).width = 45; dgMobster.getColumnAt(0).headerText = "Online"; // set formatting of mobster column dgMobster.getColumnAt(1).width = 125; // trap header click event to sort case-insensitive on this field //dgMobster.getColumnAt(2).sortOnHeaderRelease = false; // this property will keep track of whether sort is ascending or descending dgMobster.getColumnAt(1).sortedUp = false; dgMobster.getColumnAt(1).headerText = "Mobster"; // set formatting of button column dgMobster.getColumnAt(2).width = 75; // trap header click event to sort numerically dgMobster.getColumnAt(2).sortOnHeaderRelease = false; //dgMobster.getColumnAt(3).sortedUp = false; dgMobster.getColumnAt(2).headerText = "Button Men"; // set formatting of crew column dgMobster.getColumnAt(3).width = 75; // trap header click event to sort numerically //dgMobster.getColumnAt(4).sortOnHeaderRelease = false; //dgMobster.getColumnAt(4).sortedUp = false; dgMobster.getColumnAt(3).headerText = "Crew"; // set formatting of net column dgMobster.getColumnAt(4).width = 75; // trap header click event to sort numerically //dgMobster.getColumnAt(5).sortOnHeaderRelease = false; //dgMobster.getColumnAt(5).sortedUp = false; dgMobster.getColumnAt(4).headerText = "Networth"; if (success) { for (var i:Number=0; i < this.varNum; i++) { dgMobster.addItem({Online:this.varOnline, Mobster:this.varName, Button:this.dbutton, Crew:this.dcrew, Networth:this.varNet}); } }
ModernMerlin is offline   Reply With Quote
Old 07-28-2008, 07:18 PM   #3
ModernMerlin
Registered User
 
Join Date: Jul 2008
Posts: 40
Default

Ok after 5 days of looking at it crossed eyed and getting some sleep LOL I figured it out. I needed to assign my variables before trying to put them into the grid... UGH!
ModernMerlin is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue: Scrollable and Editable datagrid jumps rows while editing the cell values rlella Components 2 09-25-2009 02:22 PM
popup datagrid not populating data from xml jgoods Components 6 05-09-2008 05:59 PM
Datagrid sort issue with paging haleh Components 0 06-02-2006 06:34 PM
Datagrid scrolling issue Quigster Components 0 09-13-2005 02:36 PM
DataGrid Scroll Performance Issue AFO Components 0 02-18-2005 02:41 PM


All times are GMT. The time now is 01:09 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.