views:

1506

answers:

2

Anybody help me

How to insert the image on right top corner of panel using flex or action script . i used

-<mx:Panel x="38.5" y="28" titleIcon="@Embed('image/logo.png')" id="register" width="375" height="534" layout="absolute" title="Registration Form ">

titleIcon attributs but not use . so how to insert ?

A: 

Are you looking to display the image in the panel header or within the body of the panel itself?

In the panel header
+2  A: 

The trick is to subclass the Panel and add your button(s) in the createChildren() method:

protected override function createChildren():void
{
     super.createChildren();

     mybtn = new Button();
     mybtn.label = "I am a button";
     mybtn.visible = true;
     mybtn.includeInLayout = true;
     mybtn.addEventListener( MouseEvent.CLICK, buttonClickHandler );
     rawChildren.addChild( mybtn );
}

To make your extended panel more useful, add styles for the buttons and use getStyle() to get the icons to use.

Johan Öbrink
Johan Öbrink thank you very much . i will try ur code
Did it work? In that case, an upvote and an accepted answer would be nice.
Johan Öbrink