Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-30-2010, 01:19 PM   PM User | #1
nikos101
Senior Coder

 
nikos101's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 1,004
Thanks: 58
Thanked 10 Times in 10 Posts
nikos101 is an unknown quantity at this point
Question item renderer in List

I'm trying to create a list that contains an item renderer with a label. I know to change its background color depending on a number eg


Code:
                              
       override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                             {
                                 
                                 super.updateDisplayList(unscaledWidth, unscaledHeight);
                            if (oldData)
                             {
                                 var g:Graphics=ask.graphics;
                                 // g = graphics;
                                 g.clear();
                                 if (oldData <  data.Ask)
                                 {
                                     //unmatched
                                     g.beginFill(0x00ff00);
                                     g.drawRect(ask.x, 0, ask.width, unscaledHeight);
                                     g.endFill();
                                 }
                                 else if (oldData >  data.Ask)
                                 {
                                     //matched
                                     g.beginFill(0xff0000);
                                     g.drawRect(ask.x, 0, ask.width, unscaledHeight);
                                     g.endFill();
                                 }else{
                                 //     g.beginFill(0xffffff);
                                    // g.drawRect(ask.x, 0, ask.width, unscaledHeight);
                                //     g.endFill();
                                 }
                             }
But what I don't know what to do is remember the previous number shown in the label and change the background colour
__________________

nikos101 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:46 AM.


Advertisement
Log in to turn off these ads.