Hello Flash coders,
I'm trying to create a component representing a comic-like
chat bubble and while it mostly functions fine,
I have a problem, that the 2 parameters here are ignored
(full source code: http://preferans.de/flash/Bubble.as ):
class Bubble extends UIComponent {
...
private var __padding:Number = 8;
public var text_txt:TextField;
...
private function createChildren():Void {
...
text_txt = this.createTextField('text_txt',
this.getNextHighestDepth(), 0, 0, 200, 20);
with (text_txt) {
multiline = true;
autoSize = true;
//text = 'Only this works as default?';
}
size();
}
...
[Inspectable(defaultValue=8)]
function set padding(val:Number):Void {
__padding = val;
text_txt._x = text_txt._y = __padding / 2;
invalidate();
}
function get padding():Number {
return __padding;
}
[Inspectable(defaultValue='Set in Bubble.as')]
function set text(str:String):Void {
text_txt.text = str;
if (interval != 0)
clearInterval(interval);
interval = setInterval(this, 'hide', timeout * 1000);
_visible = true;
invalidate();
}
function get text():String {
return text_txt.text;
}
}
What I mean by "ignored" is that regardless of which
values I enter into the Component Inspector (Alt+F7)
for "padding" and "text" - only the values from Bubble.as
will be taken (please see above):
private var __padding:Number = 8;
//text = 'Only this works as default?';
Does anybody have an idea what am I doing wrong here?
All files are at http://preferans.de/flash/ Thank you.
Regards
Alex
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com