both flex1.5 and 2.
The flex 1.5 version does exactly what i want.
myTextInput.mxml - flex 1.5
----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.macromedia.com/2003/mxml"
initialize="createButton()">
<mx:Script>
<![CDATA[
private var btn1:Object;
private function createButton():Void
{
var oObj = new Object();
oObj.label = "x";
oObj.width = 20;
oObj.borderThickness = 0;
oObj.cornerRadius = 0;
createClassObject(mx.controls.Button, "btn1", 19,
oObj);
}
]]>
</mx:Script>
</mx:TextInput>
testApp.mxml
------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns="*">
<myTextInput/>
</mx:Application>
heres the flex2
myTextInput.mxml
----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="createButton()">
<mx:Script>
<![CDATA[
import mx.controls.Button;
private var btn1:Button;
private function createButton():void
{
btn1 = new Button();
btn1.label = "x";
btn1.width = 20;
this.addChild(btn1);
}
]]>
</mx:Script>
</mx:TextInput>
testApp.mxml
------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
<myTextInput />
</mx:Application>
--- In flexcoders@yahoogroups.com, "bhaq1972" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to add a button to a textinput as follows
>
> myTextInput.mxml
> ----------------
> <mx:TextInput initialize='startUp()'/>
> <mx:Script>
> public btn1:Button;
>
> private function startUp():void
> {
> btn1 = new Button();
> btn1.label = "xx";
> btn1.width = 20;
> btn1.visible = true;
> addChild(btn1);
> }
>
> My problem is, btn1 isn't visible visible.
>
> Any ideas why ? (wasn't a problem in flex 1.5)
>
> TIA
> bod
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
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.