Many thanks for your correction of my code. It works fine, but i tried
to do some modifications, which will not work.
My problem is, that i also need the passed datestarty property to set
the size of my rectangle inside the createChildren() function. But
inside this function, the datestarty variable is still in its initial
value. The createChildren() function calls now a new function to
compute the length of the rectangle:
override protected function createChildren():void {
super.createChildren();
var mySprite:Sprite = new Sprite();
mySprite.graphics.beginFill(0xcccc00);
mySprite.graphics.drawRect(0,0,getTimePeriod(datestarty,dateendy),20);
label = new TextField();
mySprite.addChild(label);
addChild(mySprite);
}
public function getTimePeriod(startDate:Number, endDate:Number):Number
{
if (!endDate || (startDate == endDate) ) dateLength = 10;
else dateLength = endDate-startDate;
return dateLength;
}
I looked at the livedocs into the "implementing the component"
section, but there was only mentioned that commitProperties() will be
called when the display has to be updated. But how can i commit the
variable to its new value before it is used to set the size of the
rectangle?
Frank
--
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/