Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Use Custom Controls with Flex

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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

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…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 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