Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF127CE7F for ; Tue, 16 Dec 2014 09:07:13 +0000 (UTC) Received: (qmail 39978 invoked by uid 500); 16 Dec 2014 09:07:13 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 39830 invoked by uid 500); 16 Dec 2014 09:07:13 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 39722 invoked by uid 99); 16 Dec 2014 09:07:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2014 09:07:13 +0000 Date: Tue, 16 Dec 2014 09:07:13 +0000 (UTC) From: "DarkStone (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FLEX-34689) By setting the styleName property to change SkinnableComponent's skin does not work in certain circumstances MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-34689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] DarkStone updated FLEX-34689: ----------------------------- Attachment: TestStyle.css TestComponentBSkin.mxml TestComponentASkin.mxml TestComponent.as Put those attachment files in the src/test folder when you test this issue. The main Application.mxml source code is not uploaded, cuz I've already posted it to the Description section of this JIRA. > By setting the styleName property to change SkinnableComponent's skin does not work in certain circumstances > ------------------------------------------------------------------------------------------------------------ > > Key: FLEX-34689 > URL: https://issues.apache.org/jira/browse/FLEX-34689 > Project: Apache Flex > Issue Type: Bug > Components: Spark: SkinnableComponent > Affects Versions: Apache Flex 4.13.0 > Reporter: DarkStone > Priority: Minor > Labels: easyfix, easytest > Attachments: TestComponent.as, TestComponentASkin.mxml, TestComponentBSkin.mxml, TestStyle.css > > Original Estimate: 0h > Remaining Estimate: 0h > > [Step to reproduce the bug] > 1. Create a subclass of SkinnableComponent named TestComponent. > package test > { > import spark.components.supportClasses.ButtonBase; > import spark.components.supportClasses.SkinnableComponent; > import spark.core.IDisplayText; > > public class TestComponent extends SkinnableComponent > { > [SkinPart] > public var textDisplay:IDisplayText; > > [SkinPart] > public var testButton:ButtonBase; > > public function TestComponent() > { > super(); > } > } > } > 2. Create 2 different skins for TestComponent: > TestComponentASkin.mxml (see the attachment) > TestComponentBSkin.mxml (see the attachment) > 3. Create a CSS file named TestStyle.css > @namespace s "library://ns.adobe.com/flex/spark"; > s|SkinnableComponent.testComponentB > { > skinClass: ClassReference("test.TestComponentBSkin"); > } > 4. In the main Application.mxml, do the following: > > > > > > > 5. Run the application, click the "Change Skin" button, then you'll see the bug, which is the TestComponent's skin won't change! > [Solution] > I have already solved this bug, it's very eazy to fix: > Just modify the source code of SkinnableComponent.as, and add the following code to the class: > override public function set styleName(value:Object):void > { > clearStyle("skinClass"); > super.styleName = value; > } > This will solve this bug, and I've tested it in different scenarios, it works correctly! > I have trouble connecting to the Flex Git, the network right now is very crappy, may someone review this, if passed, may he commit this change to the Git, that will be very nice : - ) > DarkStone > 2014-12-16 -- This message was sent by Atlassian JIRA (v6.3.4#6332)