Hello,
I'm trying to create a datagriditemrenderer using Actionscript.
I know I'm importing to much right now, it's for testing purposes ; )
Does anyone have some insight into this techniques ?
All I am seeing now is false in the cells of my datagrid.
Another question: I can't use addChildAt, but I want to
place some png files into the renderer. How do I do this ?
Thanks!
My code:
package{
import flash.display.*;
import flash.events.*;
import flash.util.*;
import mx.core.*;
import mx.controls.dataGridClasses.DataGridItemRenderer;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.Label;
public class Rating extends DataGridItemRenderer{
// embed the solid start
[Embed (source='assets/star.png')]
private var Star:Class;// embed the solid start
[Embed (source='assets/star_empty.png')]
private var StarEmpty:Class;
private var myListData:DataGridListData;
private var ratingLabel:Label;
public function Rating()
{
super();
var pic:Bitmap;
var i:int;
myListData = DataGridListData(listData);
for(i=0;i<data;i++)
{
if((i+1)<=data)
{
pic = new Star();
}else{
pic = new StarEmpty();
}
pic.x = i*25;
//this.addChildAt( pic,i );
}
ratingLabel = new Label();
ratingLabel.text = "data.rating";
}
}
}
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.