Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-27-2011, 11:30 PM   #1
dreadup
Registered User
 
Join Date: Apr 2011
Posts: 1
Default [AS2] datagrid value to button

Hi,

i have the following problem
i have a datagrid ,button ,dynamic text box and a xml script
the datagrid gets data from the xml file
one of the nodes of the xml is a url link
when the data is populated in the datagrid one row shows the url link
Code:
else if(node.nodeName == "url")
obj["ALBUM"] = node.firstChild.nodeValue;
when i click on the datagrid i can see the data of a certain cell displayed in the dynamic textfield
Code:
//Retrieve the cell Value in the CallType Category
			var cellVal:Object = eObj.target.selectedItem.TITLE;
			dtxtOutput.text = cellVal.toString();

what i am trying is 1=that the url links will not be displayed in the datagrid
2= after i click on one of the rows of the datagrid and then on the button the url link will be opened

i tried many things one of them is
Code:
on (release) {
	getURL(siteURL.toString());
}
but nothing worked i hope someone whould be kind to try to help me it would be very very appreciated

this is the full actionscript it is not mine it is one i found online and edited it a bit the only thing that works is the dynamic text box
thanks
Code:
dg.setStyle("fontFamily", "comics");
dg.setStyle("headerColor", "0x00FF00");
dg.setStyle("rollOverColor", "0x00FF00");
dg.setStyle("selectionColor", "0xFF0000");
dg.getColumnAt(1).setStyle("backgroundColor", "0xFFFF00");



var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = handleXML;
myXML.load("ARTIST.xml");

function handleXML(pSuccess:Boolean):Void
{
if(pSuccess)
{
var dp:Array = new Array();

var dinnerNode:XMLNode = myXML.firstChild;
var singerNodes:Array = dinnerNode.childNodes;
var singerLength:Number = singerNodes.length;

for(var i:Number = 0; i < singerLength; i++)
{
var singerNode:XMLNode = singerNodes[i];
var singerNodeArray:Array = singerNode.childNodes;
var singerNodeLength:Number = singerNodeArray.length;

var obj:Object = new Object();

for(var j:Number = 0; j < singerNodeLength; j++)
{
var node:XMLNode = singerNodeArray[j];
var nodes = this.firstChild.childNodes;
		
if(node.nodeName == "shout")
obj["MESSAGE"] = node.firstChild.nodeValue;
else if(node.nodeName == "name")
obj["NAME"] = node.firstChild.nodeValue;
else if(node.nodeName == "url")
obj["ALBUM"] = node.firstChild.nodeValue;
else if(node.nodeName == "client")
obj["TITLE"] = node.firstChild.nodeValue;
else if(node.nodeName == "name")
obj["ARTIST"] = node.firstChild.nodeValue;
if(node.nodeName == "anno")
obj["TES"] = node.firstChild.nodeValue;
}

dp.push(obj);
}

dg.dataProvider = dp;
}
}
//Let's create the event listener to our DataGrid object
		var dgListener:Object = new Object();
		
		dgListener.cellPress = function(eObj:Object) {
			if(eObj.columnIndex <> 0){
				var siteURL:Object = eObj.target.selectedItem.ALBUM;
				my_btn.onRelease (
					getURL(siteURL.toString());
				//Retrieve the cell Value in the CallType Category
			var cellVal:Object = eObj.target.selectedItem.NAME;
			dtxtOutput.text = cellVal.toString();
			
		}}
		//Let's add the event listener to our DataGrid object
		dg.addEventListener("cellPress",dgListener);
dreadup 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


All times are GMT. The time now is 06:34 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.