Rob@ASF
03-28-2008, 07:23 PM
Hey all,
I've been trying to resolve this issue I am having but all I can find by googling is the same cookie-cutter examples.
What I am doing is simple, I am creating a custom dialog window that will sit inside of my application. The window draws a certain background and adds some title bar buttons, like close, maximize etc. (more specific than that, but just for examples sake).
This .as file is my 'basewindow' class which then gets extended by several different mxml files. These are implemented by my application. What I am finding is that any buttons, etc. that are populated in the original actionscript class showup in the component, but the new buttons I add to my mxml class do not. I am not sure if this is a layout issue, an in heritance issue, or what...
Anyone with advice? Code snippets follow....
APPLICATION:
<mx:Application .....>
...
..
<dw:TestWindow width="300" height="300" left="20" top="20" />
</mx:Application>
Where TestWindow is my mxml class that extends the .as baseclass.
This file is TestWindow.mxml:
<?xml version="1.0" encoding="utf-8"?>
<DraggableWindow xmlns="components.draggablewindow.*"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Button label="Test Label" x="0" y="0" width="100" height="25"/>
</DraggableWindow>
And finally the base class (drastically shortened for context):
package components.draggablewindow
{
//imports go here
public class DraggableWindow extends UIComponent
{
private var closeButton:Button;
override protected function createChildren(): void {
//add buttons - design dictates that the window will always
//have proper size to show them.
closeButton = new Button();
closeButton.move(this.width - 15, 1);
closeButton.width = 13;
closeButton.height = 13;
closeButton.setStyle("icon",closeIcon);
closeButton.addEventListener(MouseEvent.CLICK, onCloseButton);
addChild(closeButton);
super.createChildren();
}
//Usual overridden methods.
}
}
I am sure this is a basic conceptual issue that I am just not recognizing due to my lack of experience with Flex 2.0/AS 3.0, anyone able to spot my mistake? All i see when I run it, is the base DraggableWindow component shows up, without any of the additional button(s) I've added in my mxml class. I am just using inheritance improperly, or...?
Thanks in advance,
Rob
I've been trying to resolve this issue I am having but all I can find by googling is the same cookie-cutter examples.
What I am doing is simple, I am creating a custom dialog window that will sit inside of my application. The window draws a certain background and adds some title bar buttons, like close, maximize etc. (more specific than that, but just for examples sake).
This .as file is my 'basewindow' class which then gets extended by several different mxml files. These are implemented by my application. What I am finding is that any buttons, etc. that are populated in the original actionscript class showup in the component, but the new buttons I add to my mxml class do not. I am not sure if this is a layout issue, an in heritance issue, or what...
Anyone with advice? Code snippets follow....
APPLICATION:
<mx:Application .....>
...
..
<dw:TestWindow width="300" height="300" left="20" top="20" />
</mx:Application>
Where TestWindow is my mxml class that extends the .as baseclass.
This file is TestWindow.mxml:
<?xml version="1.0" encoding="utf-8"?>
<DraggableWindow xmlns="components.draggablewindow.*"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Button label="Test Label" x="0" y="0" width="100" height="25"/>
</DraggableWindow>
And finally the base class (drastically shortened for context):
package components.draggablewindow
{
//imports go here
public class DraggableWindow extends UIComponent
{
private var closeButton:Button;
override protected function createChildren(): void {
//add buttons - design dictates that the window will always
//have proper size to show them.
closeButton = new Button();
closeButton.move(this.width - 15, 1);
closeButton.width = 13;
closeButton.height = 13;
closeButton.setStyle("icon",closeIcon);
closeButton.addEventListener(MouseEvent.CLICK, onCloseButton);
addChild(closeButton);
super.createChildren();
}
//Usual overridden methods.
}
}
I am sure this is a basic conceptual issue that I am just not recognizing due to my lack of experience with Flex 2.0/AS 3.0, anyone able to spot my mistake? All i see when I run it, is the base DraggableWindow component shows up, without any of the additional button(s) I've added in my mxml class. I am just using inheritance improperly, or...?
Thanks in advance,
Rob