4 Replies Latest reply on Feb 18, 2010 3:15 AM by Rodrigo Pena

    How I insert a SparkButton in a ns:Accordion?

    Rodrigo Pena

      Hi guys, i have some problem to insert a SparkButton in a ns:Accordion because I can not set a Skin. When I use mx:button all run fine, when I use s:button appears a error message about "skin error". I used NavigationContent in the Accordion, and my version of SDK of Flash Builder 4 is the build 13963.

      Someone have a problem like this?

        • 1. Re: How I insert a SparkButton in a ns:Accordion?
          FTQuest Level 3

          It's strange. Here is the code that works for me (beta2 14173):

           

          <?xml version="1.0" encoding="utf-8"?>

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

             xmlns:s="library://ns.adobe.com/flex/spark"

             xmlns:mx="library://ns.adobe.com/flex/mx"

             minWidth="1024" minHeight="768">

           

          <fx:Script>

          <![CDATA[

          import spark.components.Button;

          private function addButton():void

          {

          var secondBtn:Button = new Button();

          secondBtn.label = "I'm second";

          secondBtn.top= 20;

          secondBtn.left = 120;

          pnl.addElement(secondBtn);

          }

          ]]>

          </fx:Script>

          <mx:Accordion x="10" y="10" width="240" >

          <s:NavigatorContent id="pnl" label="Incorporate s:Button" >

          <s:Button left="20" top="20" bottom="20" label="I'm fine" click="addButton()" />

          </s:NavigatorContent>

          </mx:Accordion>

           

          </s:Application>

          1 person found this helpful
          • 2. Re: How I insert a SparkButton in a ns:Accordion?
            Rodrigo Pena Level 1

            That's my code.

             

            <?xml version="1.0" encoding="utf-8"?>

             

            <s:Application

             

            xmlns:fx="http://ns.adobe.com/mxml/2009"

             

            xmlns:s="library://ns.adobe.com/flex/spark"

             

             

            xmlns:mx="library://ns.adobe.com/flex/halo"

             

            minWidth="1024" minHeight="768" xmlns:mx1="library://ns.adobe.com/flex/mx">

             

            <fx:Declarations>

             

            <!-- Place non-visual elements (e.g., services, value objects) here -->

             

            </fx:Declarations>

             

            <mx1:Accordion x="69" y="65" width="200" height="200">

             

            <s:NavigatorContent label="Accordion Pane 1" width="100%" height="100%">

             

            <s:Button x="47" y="75" label="Button"/>

             

            </s:NavigatorContent>

             

            <s:NavigatorContent label="Teste" width="100%" height="100%">

             

            <s:Button x="48" y="77" label="Button"/>

             

            </s:NavigatorContent>

             

            <s:NavigatorContent label="Teste" width="100%" height="100%">

             

            <s:Button x="28" y="42" label="Button"/>

             

            </s:NavigatorContent>

             

            </mx1:Accordion>

             

            </s:Application>

             

            The error message:

            VerifyError:  Error #1014: Class spark.skins::SparkSkin could not be found.

            • 3. Re: How I insert a SparkButton in a ns:Accordion?
              FTQuest Level 3

              This error - I believe - refers to your project settings rather than to particular application.

              Look at the instructions at the top of this forum window; specifically, 'merge into code'.

              • 4. Re: How I insert a SparkButton in a ns:Accordion?
                Rodrigo Pena Level 1

                Thank you very much, worked fine!