please find the link to the skin file https://drive.google.com/file/d/0B_2mxcIbB40qeUZsQVJqZGR0aGs/edit?usp=sharing
On Wed, Dec 18, 2013 at 12:33 PM, Maurice Amsellem < [email protected]> wrote: > Attachments are stripped by mailing list. > Provide a public link, such as DropBox, or the like > > De : Sumudu Chinthaka [mailto:[email protected]] > Envoyé : mercredi 18 décembre 2013 00:46 > À : [email protected] > Objet : Re: Spark Button textAlign > > Really appreciate your advice but still i'm failing to get this done > > i have copied ButtonSkin class and created MyButtonSkin class which now > extends from ButtonSkinBase and remove super.createChildren call and > include ButtonSkinBase createChildren content inside MyButtonSkin > createChildren content > and set the textAlign property, but with no luck > > i am attaching my Skin class here please please tell me what am i doing > wrong > > Thanks > Sumudu > > On Wed, Dec 18, 2013 at 4:37 AM, Maurice Amsellem < > [email protected]<mailto:[email protected]>> wrote: > You can copy the default skin of course, like Evyatar suggests. That's > the preferred solution. > > Regarding your initial approach of setting the textAlign style of > labelDisplay, it didn't work because it was done too early in > createChildren. > > If you do it after the components have been created, and their properties > /styles set, > for example by overriding initialized() or by adding a handler to > creationComplete, then it will work. > > override public function set initialized(value: Boolean): void { > super.initialized = value; > UIComponent( labelDisplay).setStyle("textAlign", "left"); > } > > Maurice > > -----Message d'origine----- > De : Evyatar Ben Halevi-Arbib [mailto:[email protected]<mailto: > [email protected]>] > Envoyé : mardi 17 décembre 2013 21:14 > À : [email protected]<mailto:[email protected]> > Objet : Re: Spark Button textAlign > > When you create a new skin (at least in Flash Builder) you can start by > creating a copy of the default skin. > Just do that and on the Label MXML tag itself set the textAlign property > to left. > > Good luck, > Evyatar > > > On Tue, Dec 17, 2013 at 7:41 PM, Sumudu Chinthaka <[email protected] > <mailto:[email protected]>> wrote: > > > i have created a skin class that extends spark.skins.mobile.ButtonSkin > > and set textAlign to be left in createChildren method but it does not > > work > > > > package skins > > { > > import spark.skins.mobile.ButtonSkin; > > public class MyButtonSkin extends ButtonSkin { public function > > MyButtonSkin() { super(); } override protected function > > createChildren():void { super.createChildren(); > > labelDisplay.setStyle('textAlign','left'); > > } > > } > > } > > > > > > On Tue, Dec 17, 2013 at 7:31 PM, Maurice Amsellem < > > [email protected]<mailto:[email protected]>> wrote: > > > > > What do you mean by custom skin? > > > 1) Default skin customized through css styles (eg. textAlign)? > > > 2) Completely new skin class ? > > > > > > Maurice > > > > > > -----Message d'origine----- > > > De : Sumudu Chinthaka [mailto:[email protected]<mailto: > [email protected]>] Envoyé : mardi 17 > > > décembre 2013 14:45 À : [email protected]<mailto: > [email protected]> Objet : Spark Button > > > textAlign > > > > > > Hi All > > > > > > I want to crate a custom skin for a Spark button with textAlign to > > > be set to "left", but i found out there is a restriction set in > > > Button class > > that > > > prevent accepting textAlign values > > > > > > is there any way to override [Exclude(name="textAlign", > > > kind="style")] setting in Button subclass so that i can set this > > > through css > > > > > > or is there any alternative way to achieve this > > > > > > Thanks > > > Sumudu > > > > > > >
