mmm...i have no idea about overriding methods...but makes me so scared just to
listen it :S
i will post the code...
if it's difficult i think i will better make a bitmap that looks like a
panel...or something easier...
this is the part of code, with the panel and the icon:
<mx:State name="recipe" basedOn="main">
<mx:AddChild relativeTo="{maincontent}" position="lastChild"
creationPolicy="queued">
<mx:Panel id="rdata_title" title="{rXML.info.thainame}"
width="100%" height="150"
layout="absolute" styleName="recipedataPanel"
creationPolicy="queued" cacheAsBitmap="true"
creationComplete="{setChildIndex(rdata_title,150)}">
<mx:Canvas left="10" right="10" top="5" bottom="5">
<mx:VRule x="220" y="0" height="82"/>
<mx:Text id="rdata_by" x="241" y="0" text="by
{rXML.info.author.name}" width="178" fontFamily="petitab" fontSize="14"
enabled="true" selectable="false"/>
<mx:Text id="rdata_date" x="241" y="19"
text="{rXML.info.date}" fontFamily="petitab" fontSize="12" />
<mx:Text id="rdata_serves" x="0" y="64" text="serves:
{rXML.info.serves}" fontFamily="petitab" fontSize="12" color="#000000"/>
<mx:Text id="rdata_cooktime" x="0" y="49" text="Cooking
time: {rXML.info.cooktime}" fontFamily="petitab" fontSize="12" color="#000000"/>
<mx:Text id="rdata_preptime" x="0" y="33"
text="Preparation time: {rXML.info.preptime}" fontFamily="petitab"
fontSize="12" color="#000000"/>
<mx:LinkButton x="240" y="49" label="Email this recipe"
styleName="bluelink" height="17" fontWeight="normal"/>
<mx:LinkButton x="240" y="68" label="More recipes from
this chef" styleName="bluelink" height="17" fontWeight="normal"/>
<mx:Text id="rdata_transname" x="0" y="0"
text="{rXML.info.transname}" width="233" color="#0099CC" fontFamily="petitab"
fontSize="14"/>
</mx:Canvas>
<mx:Image id="rdata_chefphoto" scaleContent="false"
autoLoad="true" right="10" top="10"
source="pics/chefs/chef_{rXML.info.author.code}.jpg" themeColor="#000000"/>
</mx:Panel>
</mx:AddChild>
<mx:AddChild relativeTo="{rdata_title}" position="lastChild"
creationPolicy="queued">
<mx:Canvas x="441" y="-17" width="53" height="43">
<mx:Image x="10" y="6" source="pics/icon_recipes.swf"
scaleContent="false" autoLoad="true" id="icon_recipe"
creationComplete="{setChildIndex(icon_recipe,100)}"/>
</mx:Canvas>
</mx:AddChild>
----- Mensaje original ----
De: Sherif Abdou <[EMAIL PROTECTED]>
Para: [email protected]
Enviado: domingo, 31 de agosto, 2008 2:35:20
Asunto: Re: [flexcoders] Image over a panel title?
ok try doing this or you can post some code. So
override the layoutchrome method call the super function on it and in that
method positon your icon and do the setChildIndex( icon, int). Now About the
icon
being the lastChild like you said, it depends where you created the icon. Did
you override the createChildren( ) and do it there or did you just create it in
the constructor.
----- Original Message -----
From: David Pariente
To: [EMAIL PROTECTED] ups.com
Sent: Saturday, August 30, 2008 7:28 PM
Subject: Re: [flexcoders] Image over a panel title?
Oh sorry, it took me a while to find information on that method...
Actually, if i add the icon child after the panel child, the icon should be
already have a higher child number, right?? because i allways add them at the
"laschild" position.
So the icon should already be on the last child position.
now i don't know what does updateDisplayList or layoutChrome mean...i guess it
just updates the displays list (obvious), but, as mi icon was, since created,
the last child, i don't know if updating the display list should make any
difference.. .
I'm sorry my knowledge in flex is quite basic :(
----- Mensaje original ----
De: Sherif Abdou <[EMAIL PROTECTED] com>
Para: [EMAIL PROTECTED] ups.com
Enviado: domingo, 31 de agosto, 2008 1:56:09
Asunto: Re: [flexcoders] Image over a panel title?
ya to bring it to the top just do setChildIndex( nameOfIcon, numChildren- 1);
and do it somewhere so it is always up top like updateDisplayList or
layoutChrome
----- Original Message -----
From: David Pariente
To: [EMAIL PROTECTED] ups.com
Sent: Saturday, August 30, 2008 6:53 PM
Subject: Re: [flexcoders] Image over a panel title?
oh, didn't know something like that existed...
...i thought that was a tab index...not a depth index...
i will try :) thnx a lot
----- Mensaje original ----
De: Sherif Abdou <[EMAIL PROTECTED] com>
Para: [EMAIL PROTECTED] ups.com
Enviado: domingo, 31 de agosto, 2008 1:33:39
Asunto: Re: [flexcoders] Image over a panel title?
Have you tried bringing the index up of the Icon, so doing setChildIndex(
name,int)
----- Original Message -----
From: David Pariente
To: flexcoders
Sent: Saturday, August 30, 2008 5:51 PM
Subject: [flexcoders] Image over a panel title?
Hi all,
I wanna put an icon over a panel title, on the right side.
I tried and tried, but it seems like the panel title allways get over my icon,
even i put icon inside a canvas, add it from outside the panel element...seems
nothing i try brings my icon over it :(
If is impossible to do so...I feel is so strange, because is quite normal to
make an app where u can move panel over eachother, like they where windows.
Anyone knows an easy way to put the icon where i wan it?
(note: i'm not adding it as a "panel title icon", i'm just addding it directy
over, or inside a canvas).
Thnx a lot.
____________ _________ _________ _________ _________ __
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo. yahoo.es
____________ _________ _________ _________ _________ __
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo. yahoo.es
____________ _________ _________ _________ _________ __
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo. yahoo.es
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.es