Flex Bug - Programmatic Skinning!

I believe I found a Programmatic Skinning bug in Flex.
Whenever I set the "borderSkin" property to a custom skin
class, the flash player hangs in all browsers, the CPU peaks around
95% and memory is consumed rapidly.
After waiting for about 10 minutes I get the following...
[SWF] C:\Documents and Settings\Chris.Simeone\My
Documents\Flex Builder 2\Skinning-Lessons\bin\gridBorders-debug.swf
- 408,071 bytes after decompression
undefined
at
mx.core::UIComponent/getClassStyleDeclarations()[C:\dev\GMC\sdk\frameworks\mx\core\UIComp onent.as:6810]
at
mx.styles::StyleProtoChain$/mx.styles:StyleProtoChain::addProperties()[C:\dev\GMC\sdk\fra meworks\mx\styles\StyleProtoChain.as:142]
at
mx.styles::StyleProtoChain$/mx.styles:StyleProtoChain::addProperties()[C:\dev\GMC\sdk\fra meworks\mx\styles\StyleProtoChain.as:173]
(FYI: The previous error line is repeated 191 times)
I tried tracing my custom skin class (by setting breakpoints)
but none of the code ever fires - the debugger never goes into the
code.
When I remove this line from my CSS file -
borderSkin:ClassReference('GridBorders'); - the application
runs fine.
To test this further I grabbed the example on the bottom of
this
page
and the same exact error occurs. Note it the "borderSkin" property
is set on the VBox tag.
I tested other programmatic skinning examples that use
upSkin, downSkin, etc and they all work fine. I only have this
problem when assigning a skin class to the "borderSkin" property.
Would someone please confirm this is bug? I followed the
Programmatic skins recipe to the letter.
Thanks
Chris Simeone

I found the problem. It's in my CSS file. If there's a
"borderStyle"
property as defined below the application hangs. Take out the
"borderStyle" property and the app runs.
See my test code below (FYI: it does not do much. My first
attempt at
border skinning using code)...
GRIDBORDERS.CSS » HERE'S THE PROBLEM
Application
background-color: #FFFAC7;
GridItem
borderStyle: solid;
borderSkin: ClassReference('GridBorders');
GRIDBORDERS.MXML
<?xml version="1.0"?>
<mx:Application pageTitle="Grid Borders"
xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Style source="GridBorders.css"/>
<mx:Grid height="640" width="940">
<mx:GridRow width="100%" height="66%">
<mx:GridItem width="66%" height="100%" >
</mx:GridItem>
<mx:GridItem width="33%" height="100%" >
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="33%" >
<mx:GridItem colSpan="2" width="100%" height="100%" >
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</mx:Application>
GRIDBORDERS.AS
package
import mx.skins.*;
import mx.containers.Grid;
import flash.display.*;
import flash.utils.*;
public class GridBorders extends Border
public function GridBorders()
super();
override protected function updateDisplayList( w:Number,
h:Number
):void
graphics.lineStyle( 15, 0xFFFF00, 0 );
graphics.beginFill( 0xFFFF00, 1.0 );
graphics.drawRect( 0, 0, 10, height );
graphics.endFill();
private var _borderMetrics:EdgeMetrics = new EdgeMetrics(1,
1, 1, 1);
override public function get borderMetrics():EdgeMetrics
return _borderMetrics;

Similar Messages

  • How do I apply programmatic skins for completely custom drawn components of a Flex library project?

    Hello folks,
    I am looking for best practices advice when (1) creating
    custom components and (2) styling and skinning.
    I already know how to skin a component part of the Flex
    framework. I can make a class extending ProgrammaticSkin and have
    my component skinned using CSS to link the component with the
    reference to my custom class.
    However what about those cases when you are completely
    creating a component from scratch?
    Imagine a "Freehand Drawing Canvas" component that allows the
    user to draw on it and has some buttons to set color styles, line
    styles, etc., or imagine a "Screen Flow Gallery" component that
    displays visual objects in a fashion similar to Cover Flow in the
    Mac.
    In many components I am aware you may reuse other components
    part of the Flex framework but I am trying to picture an scenario
    where you would need to draw everything yourself because there just
    isn't something to base it upon so you will end up drawing it from
    scratch.
    To learn how instead of building one of those components I
    mentioned previously I decided to start with something simple that
    would illustrate this like a LiteButton component that will behave
    just like the Flex mx.controls.Button but will extend UIComponent
    and be completely custom drawn.
    The component will have a default look and will also be
    style-able and skin-able. I will provide styles for users of the
    component to modify and regarding skinning anyone can create a
    custom ProgrammaticSkin adding its own drawing logic and link it to
    the component via CSS with the ClassReference applied to the skin
    selector.
    So far so good and it's clear what I want to achieve. I
    actually know how to do most of the stuff here but I have one
    single problem.
    Here is my question, where should I put my custom drawing
    logic? If I do it in the updateDisplayList inside the class
    extending UIComponent it works, however I thought that it would be
    a better practice to do it using programmatic skins, that way I
    could provide different skin themes for my component set.
    The problem is that I can't make the programmatic work in
    this scenario. I tried instantiating the custom programmatic skin
    during the updateDisplayList of the LiteButton component and adding
    it to my display object via addChild but that didn't do anything. I
    also tried creating a "default.css" stylesheet and tried to use
    ClassReference as I would normally do to skin an already existing
    component (or composite component as well) but that didn't do
    anything either.
    So how do I apply programmatic skins for completely custom
    drawn components of my Flex library project?
    I could do it inside the updateDisplayList of the LiteButton
    class extending UIComponent but again I would like to provide
    different theme sets for my components so it makes sense using
    programmatic skins.

    "jbucaran" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hello folks,
    >
    > I am looking for best practices advice when (1) creating
    custom components
    > and
    > (2) styling and skinning.
    >
    > I already know how to skin a component part of the Flex
    framework. I can
    > make
    > a class extending ProgrammaticSkin and have my component
    skinned using CSS
    > to
    > link the component with the reference to my custom
    class.
    >
    > However what about those cases when you are completely
    creating a
    > component
    > from scratch?
    >
    > Imagine a "Freehand Drawing Canvas" component that
    allows the user to draw
    > on
    > it and has some buttons to set color styles, line
    styles, etc., or imagine
    > a
    > "Screen Flow Gallery" component that displays visual
    objects in a fashion
    > similar to Cover Flow in the Mac.
    >
    > In many components I am aware you may reuse other
    components part of the
    > Flex
    > framework but I am trying to picture an scenario where
    you would need to
    > draw
    > everything yourself because there just isn't something
    to base it upon so
    > you
    > will end up drawing it from scratch.
    This may help with that
    http://livedocs.adobe.com/flex/3/html/help.html?content=skinstyle_3.html
    > To learn how instead of building one of those components
    I mentioned
    > previously I decided to start with something simple that
    would illustrate
    > this
    > like a LiteButton component that will behave just like
    the Flex
    > mx.controls.Button but will extend UIComponent and be
    completely custom
    > drawn.
    >
    > The component will have a default look and will also be
    style-able and
    > skin-able. I will provide styles for users of the
    component to modify and
    > regarding skinning anyone can create a custom
    ProgrammaticSkin adding its
    > own
    > drawing logic and link it to the component via CSS with
    the ClassReference
    > applied to the skin selector.
    >
    > So far so good and it's clear what I want to achieve.
    Actually after
    > playing
    > with the weekend and today I know how to do most of the
    stuff but I have
    > one
    > single problem. So here is my question, where should I
    provide my custom
    > drawing logic? If I do it in the updateDisplayList
    inside the class
    > extending
    > UIComponent it works, however I thought that it would be
    a better practice
    > to
    > do it using programmatic skins, that way I could provide
    different skin
    > themes
    > for my component set.
    These aren't mutually exclusive. When you provide a skin with
    a
    TypeSelector, you have to add it to the display list
    somewhere, and this is
    typically done in updateDisplayList or addChildren. I prefer
    to do it in
    updateDisplayList, because you can then change it if the
    style changes.
    > The problem is that I can't make the programmatic work
    in this scenario. I
    > tried instantiating the custom programmatic skin during
    the
    > updateDisplayList
    > of the LiteButton component and adding it to my display
    object via
    > addChild but
    > that didn't do anything.
    Exactly what did you do?
    > I also tried creating a "default.css" stylesheet and
    > tried to use ClassReference as I would normally do to
    skin an already
    > existing
    > component (or composite component as well) but that
    didn't do anything
    > either.
    I've never had any problem using an approach similar to
    this...but I will
    say that I couldn't see any advantage in creating a
    default.css style sheet,
    since it's not really default in the way that the one that
    comes with Flex
    is. It's much more obvious to anyone using your component
    what's going on
    there if you create a style sheet where they're likely to
    spot it.
    > So how do I apply programmatic skins with the default
    look for custom
    > drawn
    > components?
    It seems like your approach is fine, but maybe you've made a
    mistake in your
    implementation.
    > I could do it inside the updateDisplayList of the
    LiteButton class
    > extending
    > UIComponent but again I would like to provide different
    theme sets for my
    > components so it makes sense using programmatic skins.
    You might want to consider also adding an instance of
    HaloBorder to your
    component. That brings a lot of functionality with it.
    HTH;
    Amy

  • Flex Builder Design View  programmatic skinning

    I am writing programmatic skins, by extending
    ProgrammaticSkin class. If i apply these skins to mx:Button, i can
    see the skin in Flex Builder design view. But when i style my
    custom component with programmatic skins, Flex Builder design view
    does not show the skin, though the skin is applied when i run the
    application. Is there a way for me to write my custom classes
    (class Node extends UIComponent), and apply skins, so that i can
    see the skins in Flex Builder design view.

    Actually I found the answer to my question. You can find it
    in my blog.
    programmatic
    skinning in Flex Builder Design view

  • Programmatic skinning?

    I would like to do programmatic skinning, i.e. depending on
    users preferences a skin will be selected along with images which
    are part of the skin. Is it possible with Flex 2?

    I found the problem. It's in my CSS file. If there's a
    "borderStyle"
    property as defined below the application hangs. Take out the
    "borderStyle" property and the app runs.
    See my test code below (FYI: it does not do much. My first
    attempt at
    border skinning using code)...
    GRIDBORDERS.CSS » HERE'S THE PROBLEM
    Application
    background-color: #FFFAC7;
    GridItem
    borderStyle: solid;
    borderSkin: ClassReference('GridBorders');
    GRIDBORDERS.MXML
    <?xml version="1.0"?>
    <mx:Application pageTitle="Grid Borders"
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Style source="GridBorders.css"/>
    <mx:Grid height="640" width="940">
    <mx:GridRow width="100%" height="66%">
    <mx:GridItem width="66%" height="100%" >
    </mx:GridItem>
    <mx:GridItem width="33%" height="100%" >
    </mx:GridItem>
    </mx:GridRow>
    <mx:GridRow width="100%" height="33%" >
    <mx:GridItem colSpan="2" width="100%" height="100%" >
    </mx:GridItem>
    </mx:GridRow>
    </mx:Grid>
    </mx:Application>
    GRIDBORDERS.AS
    package
    import mx.skins.*;
    import mx.containers.Grid;
    import flash.display.*;
    import flash.utils.*;
    public class GridBorders extends Border
    public function GridBorders()
    super();
    override protected function updateDisplayList( w:Number,
    h:Number
    ):void
    graphics.lineStyle( 15, 0xFFFF00, 0 );
    graphics.beginFill( 0xFFFF00, 1.0 );
    graphics.drawRect( 0, 0, 10, height );
    graphics.endFill();
    private var _borderMetrics:EdgeMetrics = new EdgeMetrics(1,
    1, 1, 1);
    override public function get borderMetrics():EdgeMetrics
    return _borderMetrics;

  • [svn:fx-trunk] 5259: Flex Slider Wireframe skin updates

    Revision: 5259
    Author: [email protected]
    Date: 2009-03-11 15:49:11 -0700 (Wed, 11 Mar 2009)
    Log Message:
    Flex Slider Wireframe skin updates
    SDK-19590 The thumb of an FxHSlider using the Wireframe skin is not centerred on the track.
    Update the wireframe skins to more closely match the XD comps. Added constraint support for dimension changes.
    QE Notes: n/a
    Doc Notes: n/a
    Bugs: SDK-19590
    Reviewer: Glenn
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19590
    http://bugs.adobe.com/jira/browse/SDK-19590
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxHSliderSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxHSliderThumbSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxHSliderTrackSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxVSliderSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxVSliderThumbSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxVSliderTrackSkin.mxml

  • [svn:osmf:] 12276: Integrating Flex bug - 226

    Revision: 12276
    Revision: 12276
    Author:   [email protected]
    Date:     2009-11-30 09:28:54 -0800 (Mon, 30 Nov 2009)
    Log Message:
    Integrating Flex bug - 226
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/media/LoadableMediaElement.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/media/TestMediaPlayer.as

  • [svn:osmf:] 12213: Integrating Flex bug - 207

    Revision: 12213
    Revision: 12213
    Author:   [email protected]
    Date:     2009-11-25 14:26:06 -0800 (Wed, 25 Nov 2009)
    Log Message:
    Integrating Flex bug - 207
    Modified Paths:
        osmf/branches/flex4/framework/MediaFramework/org/osmf/media/MediaPlayer.as
        osmf/branches/flex4/framework/MediaFrameworkFlexTest/org/osmf/media/TestMediaPlayer.as

  • [svn:osmf:] 12212: Flex bug - 207

    Revision: 12212
    Revision: 12212
    Author:   [email protected]
    Date:     2009-11-25 14:16:26 -0800 (Wed, 25 Nov 2009)
    Log Message:
    Flex bug - 207
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/media/MediaPlayer.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/media/TestMediaPlayer.as

  • [svn:osmf:] 12210: Flex bug - 232

    Revision: 12210
    Revision: 12210
    Author:   [email protected]
    Date:     2009-11-25 13:31:08 -0800 (Wed, 25 Nov 2009)
    Log Message:
    Flex bug - 232
    Modified Paths:
        osmf/branches/flex4/framework/MediaFramework/org/osmf/media/MediaPlayer.as
        osmf/branches/flex4/framework/MediaFramework/org/osmf/utils/MediaFrameworkStrings.as

  • DataGridColumn.visible property:  Why always true?  Flex bug?

    Can anyone tell me why when I have a DataGrid with many
    columns that requires scrolling, for even the DataGridColumns that
    are offscreen, visible always returns true? I would have expected
    it to return false if the column is offscreen. Is this a Flex bug?
    Best regards,
    Jason

    Install Flex 2.0.1 SDK and then ! a hotfix
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=kb401224
    Should help.

  • [svn:osmf:] 12278: Integrating Flex bug - 226

    Revision: 12278
    Revision: 12278
    Author:   [email protected]
    Date:     2009-11-30 09:32:46 -0800 (Mon, 30 Nov 2009)
    Log Message:
    Integrating Flex bug - 226
    Modified Paths:
        osmf/branches/flex4/framework/MediaFramework/org/osmf/media/LoadableMediaElement.as
        osmf/branches/flex4/framework/MediaFrameworkFlexTest/org/osmf/media/TestMediaPlayer.as

  • Flex Bug Quash - Round 2 Indy Style

    Want to help improve the quality of Flex for yourself and others? Have a bug that you’re dying to have fixed? Come join the Flex Bug Quash on Sunday May 17th. You can participate either in person at the 360|Flex event in Indianapolis or remotely via Adobe Connect. We recently hosted the first Flex Bug Quash in Seattle and had quite the turn out with 180 participants, 2/3rds of which were remote. Prior to this event, in the 13 months that Flex has been open source, we had received 111 patches, in the Seattle Bug Quash alone we got another 57 patches from the community, bring us up 168 patches submitted. This event was a definite success and we hope to have an even better event in Indianapolis! This is a great opportunity to share your knowledge of Flex, learn from other leet Flex developers, and contribute to making Flex a better product. For more information check out bugquash.com.

    alexj wrote:I love it too
    Thanks.
    Labello wrote:any chance of a fitting openbox-theme to evolve?
    Sure. It's easy to make em. Keep your eyes open.
    Foucault wrote:
    Very sweet theme, I really like it. I would like to point out something though. I don't know if it's only for me but the hover effect on comboboxes makes the text illegible.
    Example
    http://i.imgur.com/0FPMR.png Mouse off
    http://i.imgur.com/qmiFa.png Mouse on
    I've corrected that now and I'll upload version 2.0.1 in a moment.
    Edit: Seemse like I have a few reuests about more colors. I'll fix that to and upload a new version in the morning instead. I'm really tired and need some sleep.
    Last edited by Hund (2010-09-14 06:32:34)

  • Flex bug in global error handling

    My application's global error handler (uncaught error handler) works mostly, but I found a case where it doesn't work, but should.  Before I filed an official bug report I wanted to post the issue here.
    Here is the issue: in a module, ErrorEvents that are not listened for  and are dispatched by a Flex component are never caught in the application's uncaught error handler. 
    I have a sample project that demonstrates this.  Here is the module in my test case:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
        <![CDATA[
            private function onClickSparkDispatch():void {
                dispatchEvent( new ErrorEvent( ErrorEvent.ERROR, false, false, "test" ) );   // this isn't caught in the uncaught error handler
            private function onClickNonSparkDispatch():void {
                var nonSparkDispatcher:EventDispatcher = new EventDispatcher();
                nonSparkDispatcher.dispatchEvent( new ErrorEvent( ErrorEvent.ERROR, false, false, "test" ) );  // this is caught in the uncaught error handler
        ]]>
    </fx:Script>   
        <s:HGroup>
            <s:Button label="Module Spark Dispatch (broken)" click="onClickSparkDispatch()" />
            <s:Button label="Module Non-Spark Dispatch" click="onClickNonSparkDispatch()" />
        </s:HGroup>
    </s:Module>
    Using Flex 4.6
    My application statically links in the Flex SDK ("merged into code" in Flash Builder).
    My applications works around these two exsiting bugs:
         https://bugs.adobe.com/jira/browse/SDK-28018
         http://blogs.adobe.com/aharui/2011/04/catching-uncaughterror-in-flex-modules.html
    Is this a bug?
    Thanks,
    Rick

    It’s been reported.  Here is more information and a workaround. http://blogs.adobe.com/aharui/2011/04/catching-uncaughterror-in-flex-modules.html

  • Flex 4 Migration: skinning, and Actionscript

    Hello,
    I've been researching about this topic, but I wasn't able to find any  examples on "how to skin in flex4" using actionscript. I'm trying to  make a simple test, just load an image inside a container and set the  borderSides properties. This property, and many others, are missing from  flex 4 "by default", now I have to create/define a skin and code it  using Line graphics components, is that correct?
    anyways, my "real" (probably not the smartest but...) I've been struggling around  this problem for a couple days:
       - How do I migrate from Flex 3 (css styles and other stuff) to Flex 4 (skins), BUT I don't want to use mxml files, I'd like to keep everything written in actionscript in my application. It has to be feasible but I couldn't figure out how.
    Thanks in advance
    Renan

    Thanks for the help, we managed to do a skin in actionscript.
    Can you help me with two other issues, I'm still not comfortable with this Flex4 transition:
    Is it possible to load/add an image to a group from the container (in actionscritpt), or you can only do that using skins?
    Can I inherit skins like other classes? For instance: I have a skin to draw borders and another to draw an image, can I extend it to "merge" these two behaviors, border+image.
    Thanks
    renan

  • Restarting A Flex Application Programmatically

    Howdy folks,
    I have just created a database driven user management system
    which works wonders, but I'm having a problem with logging out a
    user. By far the easiest, sure fire way of doing this would be to
    clear the users login in the database (not really relevant to the
    problem) then restart the application programmatically (as if the
    user pressed the refresh button in thier browser) which would bring
    them back to the login screen at the start of the application. Is
    re-initialising the application possible to do in actionscript?
    If not it would involve clearing user specific variables,
    resending http requests which relate to the login, removing
    permissions based controls and all this over many modules... just a
    hell of a lot of what may be unesscessary work, especially if all
    that really needs to happen is the application to re-initialise.
    Any help on this would be amazing!
    Many thanks

    quote:
    Originally posted by:
    mattyb1515
    My initial suggestion is to wrap your flex application in a
    PHP web page and let PHP do the authentication/deauthentication. To
    logout the user you can create a PHP function that destroys the
    session variable and then refresh/redirect to the login/home page
    of your application.
    Thanks for the reply but I'm afraid it isn't as easy as that.
    I'm a php guru and I do use PHP and FlashVars for use with
    authentication but only to 'remember' user information when the
    user opens up a different application (basically if they log into
    one application, theyre logged into the rest). Using 'out of
    application' authentication is of no use when it comes to a
    permissions based user system and applying dynamic permissions
    (such as "this user can see this menu", "this user cant press this
    button") to a flex application. It's clearing these permission
    variables I'd prefer not to do if the application can be
    programmatically re-initialised which would have the same
    effect.

Maybe you are looking for

  • Windows 7 with bootcamp on Imac 27 mid-2010 impossible

    I have purchased an IMAC 27 mod 2010 and I would like to install Windows 7 with Bootcamp. I've tried everything from all sources infos. Impossible to install. After last screen on windows install, when desktop is created for first user and last boot

  • XMLStreamException while processing SOAPResponse

    Hi, I am facing the following issue. I have a third party provided jar which process a SOAPResponse XML, say within a method xyz(). When I use a test class(standalone) and call the xyz method from its main method, it works perfect. But when I call th

  • How can I change a green screen background?

    Today I downloaded a trial version of PSE. This means of course that I'm new to the game. I can follow a step-by-step guide though. Here's what I'd like to do: I've taken a dozen photos of an actor with a green screen as a background. Is there a way

  • Saving filled out for saves ip address causing problems

    I have an application that users use from within the company network and from outside. A web page opens an adobe form that the users fill out and save back to the server, in the form of an FDF. Some change in Adobe versions has started to save the ip

  • Run MAX,message'Initialization of C:\WINNT\System32\nipalu.dll failed. Why?

    The problem is that Max will not open correctly, therefore rendering Labview useless as it can not use any of the PCI Cards in the PC. When MAX is run, the program opens as normal, i.e. it presents the MAX explorer screen. Approximately 2 seconds lat