RE: [Flashcoders] Generate a list with xml
Sure - that's what I like about doing it that way - each row is a movie clip, so you can size each row however you like - the next row's position is based on the previous row's _y + _height - so they are positioned correctly. May not be the best solution as far as processor requirements, but it does the job and offers more flexibility in my opinion. Jason Merrill | E-Learning Solutions | icfconsulting.com >>-Original Message- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of Stan Sainte-Rose >>Sent: Friday, December 16, 2005 11:51 AM >>To: Flashcoders mailing list >>Subject: Re: [Flashcoders] Generate a list with xml >> >>Jason, >> >>I think it's the idea... I will think about it. >>A stupid question, do you think using this concept, I ll be able to have row >>with different heights ? >> >>Thanks.. >>Stan >> >> >>2005/12/16, Merrill, Jason <[EMAIL PROTECTED]>: >>> >>> >>Ok, but a stupid question do u know how to distribute each MovieClip >>> object >>> >>to get a list appearance ? >>> >>> Been frustrated with DataGrid in a past project, been leary of it ever >>> since - I'm probably a wuss, but instead I made my own data grid using >>> Movie Clips and a scroll pane and it's been working great. This is a >>> working draft - not finished - and you'll need to click through some >>> javascript dialog boxes first, but see the grid in the "planner" tab: >>> >>> http://cmt.icfconsulting.com/CDRH/DiscoveryPortal%20Source%20Code/Flash/ >>> version4/DiscoveryPortal.html >>> >>> Here's part of the script that creates and positions the rows - based >>> on XML data (XPath): >>> >>> function createPlannerGrid(target_mc:MovieClip, title:String, x:Number, >>> y:Number, width:Number, height:Number):Array { >>>var Rows:Array = new Array(); >>>target_mc.attachMovie("rowTitles_mc", "rowTitles_mc", 1); >>>target_mc.rowTitles_mc._x = >>> parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], >>> "config/planner/[EMAIL PROTECTED]")); >>>target_mc.rowTitles_mc._y = >>> parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], >>> "config/planner/[EMAIL PROTECTED]")); >>>target_mc.createClassObject(mx.containers.ScrollPane, >>> "items_sp", 10); >>>target_mc.items_sp.contentPath = "blank_mc"; >>>var numRows:Number = >>> XPath.selectNodes(session.data.xmlFiles["tasks_xml"], >>> "tasks/task").length; >>>for (var i:Number = 0; i>>var thisRow:MovieClip = >>> target_mc.items_sp.content.attachMovie("plannerRow_mc", "row"+i+"_mc", >>> i+11); >>>Rows.push(thisRow); >>>if (i>0) { >>>thisRow._y = Rows[i-1]._y+20; //position the >>> rows >>>} >>>if (i%2 == 0) { >>>thisRow.gotoAndStop(2); //alternate the row >>> colors >>>} >>>} >>>target_mc.items_sp.move(x, y); >>>target_mc.items_sp.setSize(width, height); >>>return Rows; >>> } >>> >>> Jason Merrill | E-Learning Solutions | icfconsulting.com >>> >>> >>> >>> >>> >>> >>> >>> NOTICE: >>> This message is for the designated recipient only and may contain >>> privileged or confidential information. If you have received it in error, >>> please notify the sender immediately and delete the original. Any other use >>> of this e-mail by you is prohibited. >>> ___ >>> Flashcoders mailing list >>> Flashcoders@chattyfig.figleaf.com >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>> >>___ >>Flashcoders mailing list >>Flashcoders@chattyfig.figleaf.com >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Generate a list with xml
Jason, I think it's the idea... I will think about it. A stupid question, do you think using this concept, I ll be able to have row with different heights ? Thanks.. Stan 2005/12/16, Merrill, Jason <[EMAIL PROTECTED]>: > > >>Ok, but a stupid question do u know how to distribute each MovieClip > object > >>to get a list appearance ? > > Been frustrated with DataGrid in a past project, been leary of it ever > since - I'm probably a wuss, but instead I made my own data grid using > Movie Clips and a scroll pane and it's been working great. This is a > working draft - not finished - and you'll need to click through some > javascript dialog boxes first, but see the grid in the "planner" tab: > > http://cmt.icfconsulting.com/CDRH/DiscoveryPortal%20Source%20Code/Flash/ > version4/DiscoveryPortal.html > > Here's part of the script that creates and positions the rows - based > on XML data (XPath): > > function createPlannerGrid(target_mc:MovieClip, title:String, x:Number, > y:Number, width:Number, height:Number):Array { >var Rows:Array = new Array(); >target_mc.attachMovie("rowTitles_mc", "rowTitles_mc", 1); >target_mc.rowTitles_mc._x = > parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], > "config/planner/[EMAIL PROTECTED]")); >target_mc.rowTitles_mc._y = > parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], > "config/planner/[EMAIL PROTECTED]")); >target_mc.createClassObject(mx.containers.ScrollPane, > "items_sp", 10); >target_mc.items_sp.contentPath = "blank_mc"; >var numRows:Number = > XPath.selectNodes(session.data.xmlFiles["tasks_xml"], > "tasks/task").length; >for (var i:Number = 0; ivar thisRow:MovieClip = > target_mc.items_sp.content.attachMovie("plannerRow_mc", "row"+i+"_mc", > i+11); >Rows.push(thisRow); >if (i>0) { >thisRow._y = Rows[i-1]._y+20; //position the > rows >} >if (i%2 == 0) { >thisRow.gotoAndStop(2); //alternate the row > colors >} >} >target_mc.items_sp.move(x, y); >target_mc.items_sp.setSize(width, height); >return Rows; > } > > Jason Merrill | E-Learning Solutions | icfconsulting.com > > > > > > > > NOTICE: > This message is for the designated recipient only and may contain > privileged or confidential information. If you have received it in error, > please notify the sender immediately and delete the original. Any other use > of this e-mail by you is prohibited. > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Generate a list with xml
>>Ok, but a stupid question do u know how to distribute each MovieClip object >>to get a list appearance ? Been frustrated with DataGrid in a past project, been leary of it ever since - I'm probably a wuss, but instead I made my own data grid using Movie Clips and a scroll pane and it's been working great. This is a working draft - not finished - and you'll need to click through some javascript dialog boxes first, but see the grid in the "planner" tab: http://cmt.icfconsulting.com/CDRH/DiscoveryPortal%20Source%20Code/Flash/ version4/DiscoveryPortal.html Here's part of the script that creates and positions the rows - based on XML data (XPath): function createPlannerGrid(target_mc:MovieClip, title:String, x:Number, y:Number, width:Number, height:Number):Array { var Rows:Array = new Array(); target_mc.attachMovie("rowTitles_mc", "rowTitles_mc", 1); target_mc.rowTitles_mc._x = parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], "config/planner/[EMAIL PROTECTED]")); target_mc.rowTitles_mc._y = parseInt(XPath.selectNodes(session.data.xmlFiles["config_xml"], "config/planner/[EMAIL PROTECTED]")); target_mc.createClassObject(mx.containers.ScrollPane, "items_sp", 10); target_mc.items_sp.contentPath = "blank_mc"; var numRows:Number = XPath.selectNodes(session.data.xmlFiles["tasks_xml"], "tasks/task").length; for (var i:Number = 0; i0) { thisRow._y = Rows[i-1]._y+20; //position the rows } if (i%2 == 0) { thisRow.gotoAndStop(2); //alternate the row colors } } target_mc.items_sp.move(x, y); target_mc.items_sp.setSize(width, height); return Rows; } Jason Merrill | E-Learning Solutions | icfconsulting.com NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Generate a list with xml
Ok, but a stupid question do u know how to distribute each MovieClip object to get a list appearance ? Stan 2005/12/16, Nick Weekes <[EMAIL PROTECTED]>: > > Ah ok. In that case you could either create your own MovieClip object > that > creates TextArea + Image clips for two rows, or you could use TextArea in > the DataGrid cellRenderer. > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Stan > Sainte-Rose > Sent: 16 December 2005 10:45 > To: Flashcoders mailing list > Subject: Re: [Flashcoders] Generate a list with xml > > Hi Nick, > I thank you for the link.. but it's not really what I want.. > It looks like that. > > Each record has to be displayed in two parts > The first part with a background color has a Text data and a Picture on > the > right > The second part (that comes after the first part) with another background > color displays text (this text can have different numbers of lines). > > The list is the sum of each record. > > I m not sure It can be done with the datagrid component or if it can, I > dont > know who to do it... > > In fact, I suppose (not sure) I have to use a MovieClip that will be > duplicate for each record. > > Stan > > > > > > > 2005/12/16, Nick Weekes <[EMAIL PROTECTED]>: > > > > Dude, whats wrong with the DataGrid? Seems to be exactly what you want. > > > > Check out this link for a DataGrid with Images sample: > > > > > > > > http://www.actionscript.com/index.php/fw/1/displaying-images-in-a-datagrid-u > > tilizing-a-cell-renderer > > > > If that isn't what you want, feel free to say why and we'll help > further. > > > > Cheers, > > > > Nick > > > > > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Stan > > Sainte-Rose > > Sent: 16 December 2005 10:20 > > To: flashcoders@chattyfig.figleaf.com > > Subject: [Flashcoders] Generate a list with xml > > > > Hi, > > > > I need to generate a list from an xml file. > > I put an example of my need at http://www.netsunset.com/alist.png > > (this example has 2 rows). > > Each rows has 2 parts (the first part has a Data and Pic part and the > > second > > has only text) > > I ve tried to use the datagrid component but It doesn't work like I > want. > > I do not have problem with the xml part, but just want to know how can I > > generate this kind of list. > > > > I thank you in advance for your help. > > > > Stan > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Generate a list with xml
Ah ok. In that case you could either create your own MovieClip object that creates TextArea + Image clips for two rows, or you could use TextArea in the DataGrid cellRenderer. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stan Sainte-Rose Sent: 16 December 2005 10:45 To: Flashcoders mailing list Subject: Re: [Flashcoders] Generate a list with xml Hi Nick, I thank you for the link.. but it's not really what I want.. It looks like that. Each record has to be displayed in two parts The first part with a background color has a Text data and a Picture on the right The second part (that comes after the first part) with another background color displays text (this text can have different numbers of lines). The list is the sum of each record. I m not sure It can be done with the datagrid component or if it can, I dont know who to do it... In fact, I suppose (not sure) I have to use a MovieClip that will be duplicate for each record. Stan 2005/12/16, Nick Weekes <[EMAIL PROTECTED]>: > > Dude, whats wrong with the DataGrid? Seems to be exactly what you want. > > Check out this link for a DataGrid with Images sample: > > > http://www.actionscript.com/index.php/fw/1/displaying-images-in-a-datagrid-u > tilizing-a-cell-renderer > > If that isn't what you want, feel free to say why and we'll help further. > > Cheers, > > Nick > > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Stan > Sainte-Rose > Sent: 16 December 2005 10:20 > To: flashcoders@chattyfig.figleaf.com > Subject: [Flashcoders] Generate a list with xml > > Hi, > > I need to generate a list from an xml file. > I put an example of my need at http://www.netsunset.com/alist.png > (this example has 2 rows). > Each rows has 2 parts (the first part has a Data and Pic part and the > second > has only text) > I ve tried to use the datagrid component but It doesn't work like I want. > I do not have problem with the xml part, but just want to know how can I > generate this kind of list. > > I thank you in advance for your help. > > Stan > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Generate a list with xml
Hi Nick, I thank you for the link.. but it's not really what I want.. It looks like that. Each record has to be displayed in two parts The first part with a background color has a Text data and a Picture on the right The second part (that comes after the first part) with another background color displays text (this text can have different numbers of lines). The list is the sum of each record. I m not sure It can be done with the datagrid component or if it can, I dont know who to do it... In fact, I suppose (not sure) I have to use a MovieClip that will be duplicate for each record. Stan 2005/12/16, Nick Weekes <[EMAIL PROTECTED]>: > > Dude, whats wrong with the DataGrid? Seems to be exactly what you want. > > Check out this link for a DataGrid with Images sample: > > > http://www.actionscript.com/index.php/fw/1/displaying-images-in-a-datagrid-u > tilizing-a-cell-renderer > > If that isn't what you want, feel free to say why and we'll help further. > > Cheers, > > Nick > > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Stan > Sainte-Rose > Sent: 16 December 2005 10:20 > To: flashcoders@chattyfig.figleaf.com > Subject: [Flashcoders] Generate a list with xml > > Hi, > > I need to generate a list from an xml file. > I put an example of my need at http://www.netsunset.com/alist.png > (this example has 2 rows). > Each rows has 2 parts (the first part has a Data and Pic part and the > second > has only text) > I ve tried to use the datagrid component but It doesn't work like I want. > I do not have problem with the xml part, but just want to know how can I > generate this kind of list. > > I thank you in advance for your help. > > Stan > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Generate a list with xml
Dude, whats wrong with the DataGrid? Seems to be exactly what you want. Check out this link for a DataGrid with Images sample: http://www.actionscript.com/index.php/fw/1/displaying-images-in-a-datagrid-u tilizing-a-cell-renderer If that isn't what you want, feel free to say why and we'll help further. Cheers, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stan Sainte-Rose Sent: 16 December 2005 10:20 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Generate a list with xml Hi, I need to generate a list from an xml file. I put an example of my need at http://www.netsunset.com/alist.png (this example has 2 rows). Each rows has 2 parts (the first part has a Data and Pic part and the second has only text) I ve tried to use the datagrid component but It doesn't work like I want. I do not have problem with the xml part, but just want to know how can I generate this kind of list. I thank you in advance for your help. Stan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders