[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Use Custom Controls with Flex

Posted on 2011-02-26
3
Medium Priority
?
417 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 2000 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

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

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

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…
Tech giants such as Amazon and Google have sold Alexa and Echo to such an extent that they have become household names. And soon they are expected to be used by commoners in their homes, ordering takeout, picking out a song, answering trivia questio…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

830 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