Dear Flex users,

I need your help to update my Flex 4.6 air desktop application app.

Indeed, now, I work with Apache Flex 4.16.1 and Air 33 and I have some problems with windows skin.

When I launch my application in debug mode an error appear who says : CloseButtonSkinM is undifined !


<s:SparkSkin xmlns:fx = "http://ns.adobe.com/mxml/2009"
             xmlns:s = "library://ns.adobe.com/flex/spark"
             xmlns:fb = "http://ns.adobe.com/flashbuilder/2009" xmlns:Layout = "skin.Layout.*"
             alpha.disabledGroup = "0.5" creationComplete = "sparkskin1_creationCompleteHandler(event)">

    <fx:Metadata>
        [HostComponent("fr.mycompagny.ui.windowSkin.wCustomWindow")]
    </fx:Metadata>


    <fx:Script>
        <![CDATA[
            import fr.mycompagny.command.AddMenuImp;
            import fr.mycompagny.util.WindowManager;
            
            import mx.core.FlexGlobals;
            import mx.events.FlexEvent;
            import mx.events.StateChangeEvent;
            
            //skin Mac
            import assets.skin.components.MaximizeButtonSkinM;
            import assets.skin.components.MinimizeButtonSkinM;
            import assets.skin.components.CloseButtonSkinM;
            import spark.components.Button;


            private var btMaximize:Button;
            
            private var btMinimize:Button;
            private var closeButton:Button;
            
          
          
            
           
            protected function sparkskin1_creationCompleteHandler( event:FlexEvent ):void
            {
                this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
                
                btMaximize=new Button();
                btMaximize.buttonMode=true;
                btMaximize.verticalCenter=0;
                
                btMinimize=new Button();
                btMinimize.buttonMode=true;
                btMinimize.verticalCenter=0;
                
                closeButton=new Button();
                closeButton.buttonMode=true;
                closeButton.verticalCenter=0;
                
                btMinimize.addEventListener( MouseEvent.CLICK , minimizeW );
                btMaximize.addEventListener( MouseEvent.CLICK , maximizeW );
                closeButton.addEventListener( MouseEvent.CLICK , closeWindow );
                
                this.addEventListener( StateChangeEvent.CURRENT_STATE_CHANGE , onEnterState );
                
                if ( NativeApplication.supportsDockIcon )
                {
                    
                    buttonArea.addElement( closeButton );
                    buttonArea.addElement( btMinimize );
                    buttonArea.addElement( btMaximize );

                    closeButton.setStyle( "skinClass", CloseButtonSkinM);
                    btMaximize.setStyle( "skinClass" , MaximizeButtonSkinM );
                    btMinimize.setStyle( "skinClass" , MinimizeButtonSkinM );
                    buttonArea.left=12;
                    titleDisplay.left=this.width / 2;
                    icon.right=5;
                    
                }
                else
                {
                    
                    buttonArea.addElement( btMinimize );
                    buttonArea.addElement( btMaximize );
                    buttonArea.addElement( closeButton );
                    closeButton.setStyle( "skinClass" , CloseButtonSkin );
                    btMaximize.setStyle( "skinClass" , skin.components.MaximizeButtonSkin );
                    btMinimize.setStyle( "skinClass" , skin.components.MinimizeButtonSkin );
                    buttonArea.right=12;
                    titleDisplay.left=60;
                    icon.left=5;
                    
                }
            
            }
            
            
          
        ]]>
    </fx:Script>


    <s:states>
        <s:State name = "disabledAndInactive" stateGroups = "disabledGroup, inactiveGroup"/>
        <s:State name = "maximizedGroup"/>
        <s:State name = "normal"/>
        <s:State name = "disabled" stateGroups = "disabledGroup"/>
        <s:State name = "normalAndInactive" stateGroups = "inactiveGroup"/>
        <s:State name = "supportsDockIcon"/>
        <s:State name = "supportsSystemTray"/>
    </s:states>

    <s:Rect id = "backgroundRect" left = "0" right = "0" top = "0" bottom = "0" alpha = "0">
        <s:fill>
            <s:SolidColor alpha = "0"/>
        </s:fill>
    </s:Rect>

    <s:Group bottom = "0" left = "0" right = "0" top = "0">
        <!--Fond de la fenetre-->
        <s:Rect bottom = "0" left = "0" right = "0" top = "0" radiusX = "8" radiusY = "8">
            <s:fill>
                <s:SolidColor color = "#656565" alpha = ".7"/>
            </s:fill>
            <s:stroke>
                <s:SolidColorStroke color = "#666666"/>
            </s:stroke>
        </s:Rect>

        <s:Group height = "38" id = "moveArea" left = "0" right = "0">

            <!--Barre bleu avec filet-->
            <s:Rect height = "25" left = "10" right = "10" top = "10">
                <s:fill>
                    <s:SolidColor color = "#055a90"/>
                </s:fill>
                <s:stroke>
                    <s:SolidColorStroke color = "#666666"/>
                </s:stroke>
            </s:Rect>


            <s:BitmapImage id = "icon" verticalCenter = "0"/>

            <s:Label id = "titleDisplay" styleName = "swindowTitle" top = "18" verticalAlign = "middle" horizontalCenter = "0"/>

            <!--Zone de bouton-->

            <s:HGroup id = "buttonArea" verticalCenter = "0">

                <!--<s:Button id="btMinimize" buttonMode="true"
                         verticalCenter="0"/>

                <s:Button id="btMaximize" buttonMode="true"
                          verticalCenter="0"/>

                <s:Button id="closeButton" buttonMode="true"
                          verticalCenter="0"/>-->

            </s:HGroup>

        </s:Group>

        <!--Fond de la zone principale-->

        <s:Rect id = "background" left = "10" top = "35" right = "10" bottom = "10">
            <s:fill>
                <s:LinearGradient rotation = "-90">
                    <s:GradientEntry color = "#edf0f7"/>
                    <s:GradientEntry color = "#fcfbfb"/>
                </s:LinearGradient>
            </s:fill>
            <s:stroke>
                <s:SolidColorStroke color = "#666666"/>
            </s:stroke>
        </s:Rect>

        <!--Zone dans laquelle les elements vont se positionner-->


        <s:Group id = "contentGroup" left = "15" right = "15" top = "43" bottom = "15" minWidth = "0" minHeight = "0" width = "100%" height = "100%">

        </s:Group>



    </s:Group>
    <s:Button height = "15" id = "btResize" width = "15" bottom = "0" right = "0" skinClass = "spark.skins.spark.windowChrome.GripperSkin" mouseDown = "btResize_mouseDownHandler(event)"
              buttonMode = "true"/>

</s:SparkSkin>

--

Isabelle LOYER








Reply via email to