Solved

Use Custom Controls with Flex

Posted on 2011-02-26
3
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

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…
Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

689 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