Solved

Use Custom Controls with Flex

Posted on 2011-02-26
3
374 Views
Last Modified: 2012-05-11
Hi,

I like to use different styles for different Buttons.
For sure I can use skinClass to asign a style to a Button.

But I like to do this with CSS, as I use it for the Spark Button:
s|Button
{
      skinClass: ClassReference("iskins.MainStyle");
}

So is it possible to make custom controls inherit from the main Spark Button and realize something like this:
S|otherButton
{
      skinClass: ClassReference("iskins.OtherStyle");
}

in XML:
<s:otherButton ..../>

No need for exact this way I just need diefferent Buttons in any way ...

Thanks,

Andre
0
Comment
Question by:andre72
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 34987310
If it's simply a differen Skin you want to have for different Buttons, there's an easier way to do it.
I would suggest to stick with the simple s:Button and to set differnt:

In my CSS I for example have:
s|Button {
    skinClass: ClassReference("spark.skins.spark.ButtonSkin");
}

s|Button.panelButton {
    skinClass: ClassReference("de.cware.cweb.projects.ee.skins.thesurface.buttons.ButtonSkin");
}

Open in new window


In my components I can use the styleName attribute to control which skin it will have.

This code will make the button get styled with the default Button skin;
<s:Button label="My Button"/>

Open in new window


And this one will use the alternate skin:
<s:Button label="My Button" styleName="panelButton"/>

Open in new window


Hope this was what you were looking for.


0
 

Author Comment

by:andre72
ID: 34987416
Thanks Christofer I think this is a good solution and as it's very simular to HTML/CSS I think is easy to handle for a novice ...
I'll give it a try
0
 

Author Closing Comment

by:andre72
ID: 34987492
Thanks works fine
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now