[Flex] flex SDK 4 (gumbo) more convenient custom styles, custom sparkskin (III)

Source: Internet
Author: User
See http://www.k-zone.cn/zblog/post/flash-builder-gumbo-customer-sparkskin-3.html for details
Through the last two articles, we can draw a conclusion: it is very easy to set the skin of spark components using sparkskin and skin. If the same effect is set in flex SDK 3, it will be very troublesome.
Flex SDK 4 (gumbo) is known to have two sets of components: the spark component and the halo component. Since skin settings in the spark component are very easy, what about Halo? Can it be as convenient as SPARK components?

Answer: Yes, of course.
The reason is that the sparkskin and skin components are still used for Custom Skin.

First, let's recall the method for customizing the skin in the spark component:
1,
Button {
Skinclass: classreference ("com. rianote. Flex. Skin. kbutton ");
}
2. <button skinclass = "com. rianote. Flex. Skin. kbutton"/>
3. mybutton. setstyle ("skinclass", class (kbutton ));

In Spark, we use the skinclass attribute to set skin for it. In the halo package, how should we define this skin?

See the following code:
<FX: style>
. Sparkbuttonstyle {
Skin: classreference ("com. rianote. Flex. Skin. kbutton ");
}
</FX: style>
<Mx: button label = "I Am a halo component" stylename = "sparkbuttonstyle"/>

Is it easy? The above code is no stranger to programmers who are familiar with developing flex SDK 3.
Let's compare the spark component writing:

<FX: style>
Button {
Skinclass: classreference ("com. rianote. Flex. Skin. kbutton ");
}
</FX: style>
<S: button label = "I Am a spark component" skinclass = "com. rianote. Flex. Skin. kbutton"/>

In fact, we only get some information from spark and halo sharing a set of custom skins:
Although flex SDK 4 (gumbo) is not particularly compatible with the version, it can be seen from the method of public custom skin, adobe Flex team has made great efforts in compatibility.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.