Solved

Use Custom Controls with Flex

Posted on 2011-02-26
3
378 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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

9 Experts available now in Live!

Get 1:1 Help Now