tags:

views:

44

answers:

5

Hey guys,

I want to use a SuperAccordion GUI component. I.e. an accordion, where sereval windows can be opened simultaneously.

I found this: http://www.adobe.com/devnet/flex/tourdeflex/web/#sampleId=19370;illustIndex=0;docIndex=1

However, I can get the code... Flex does not know about a component 'SuperAccordion".

Please help.

Thanks

+1  A: 

Your link contains all the code you need... SuperAccordion is composite component defined in this very example.

Edit: Actually, no. There is a library used: ws.tink.flex.containers, hosted at: http://tink.googlecode.com/svn-history/r49/trunk/ws/tink/flex/containers/

You can use svn to get it: svn checkout http://tink.googlecode.com/svn-history/r49/trunk/ws/tink/flex/containers/ [folder to store it]

Edit: or even simpler: http://code.google.com/p/tink/downloads/list

alxx
He already has a SuperAccordion see:<containers:SuperAccordion id="accordion" color="0x323232" width="100%" height="100%"> bla bla , some code ( see link)</containers:SuperAccordion>He already has it in the `components`, I do not. Thus he uses it. I want to get the code for one of these....
Yura
I downloaded the file SuperAccordionHeader.as for here: http://tink.googlecode.com/svn-history/r49/trunk/ws/tink/flex/containers/superAccordion/SuperAccordionHeader.as but it has errors and can not be compiled.... line: "import ws.tink.flex.containers.SuperAccordion;" flex can not import this.... If I could have use it, then there would be no need for all of this. I would have just used the SuperAccordion from ws.tink.flex.containers.SuperAccordion
Yura
what is this: http://code.google.com/p/tink/downloads/list ? This is some kind of swc file.... ?
Yura
yes, download swc and plug to your project.
alxx
Ok, I downloaded the swc. How do I plug it to my code and use it? thanks
Yura
get swc into "libs" folder in your project (or anywhere, but it is better to keep things in place). Open menu Project/Properties/Flex Build Path/Add SWC.
alxx
Ok, my /lib directory is already in the "library path", great! :) Now how do I use this SWC and the SuperAccordion?
Yura
Does your mxml example work now?
alxx
Nope :( How do I prompt Flex to a container "SuperAccordion" ? p.s. I restarted my Eclipse to reload the swc
Yura
In mxml, you can start typing <SuperAcco... then use autocomplete. In ActionScript: var acc:SuperAcco... (it should show class name, if swc is imported correctly)
alxx
Hmm... nope. This probably means I did not import correctly... How to check it? I go to Prohect->Properties->FlexBuilderPath->LibraryPath->AddSWCIf I expand the TinkSpark, it shows the TinkSpark.swc but it also shows Source attachment(none), Link Type merged into code, Auto extract swc (n/a)
Yura
p.s. Alxx, Thanks a lot for helping me!
Yura
Spark? If you are using Flex 3 framework, you need TinkMX.swc. TinkSpark is for Flex 4.
alxx
Ok, it seems to work, however, I have some strange compilation err, I can not over come ( see my answer below)I also tried inserting in some other code and the err is still there...
Yura
@Alxx, I guess the problem is somewhere else, I check it out now...
Yura
[ERROR] Failed to execute goal net.israfil.mojo:maven-flex2-plugin:1.3:compile-swf (default) on project redaction-review-tool: Result of flex2.tools.Compiler execution is: '1'. -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Yura
This is something that got to do with the swc files... Have you seen such an err?
Yura
No, I'm using FlexBuilder (and assumed you are too). You had to point out your environment and Flex version details...
alxx
A: 

I have tried this code:

    <containers:SuperAccordion>
        <mx:VBox label="Accordion Button for Panel 1">
            <mx:Label text="Accordion container panel 1"/>
        </mx:VBox>

        <mx:ViewStack>

            <mx:VBox label="Accordion Button for Panel 2.1">
                <mx:Label text="Accordion container panel 2.1"/>
            </mx:VBox>

            <mx:VBox label="Accordion Button for Panel 2.2">
                <mx:Label text="Accordion container panel 2.2"/>
            </mx:VBox>

        </mx:ViewStack>

        <mx:VBox label="Accordion Button for Panel 3">
            <mx:Label text="Accordion container panel 3"/>
        </mx:VBox>

    </containers:SuperAccordion>

However, it has an err: "Could not resolve to a component implementation"

Yura
please show the complete code. Where do you import the swc and define the namespace?
hering
A: 

xmlns:components="lib.components.*" xmlns:containers="ws.tink.mx.containers.*">

<mx:Panel title="SuperAccordion Container" layout="vertical" color="0xffffff" borderAlpha="0.15" width="500" height="246"
     paddingTop="2" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center">

    <mx:Label width="100%" color="0x323232"
        text="Select/deselect a SuperAccordion navigator button to change the panel."/>

    <containers:SuperAccordion id="accordion" color="0x323232" width="100%" height="100%">

        <mx:VBox label="Accordion Button for Panel 1">
            <mx:Label text="Accordion container panel 1"/>
        </mx:VBox>

        <mx:ViewStack>

            <mx:VBox label="Accordion Button for Panel 2.1">
                <mx:Label text="Accordion container panel 2.1"/>
            </mx:VBox>

            <mx:VBox label="Accordion Button for Panel 2.2">
                <mx:Label text="Accordion container panel 2.2"/>
            </mx:VBox>

        </mx:ViewStack>

        <mx:VBox label="Accordion Button for Panel 3">
            <mx:Label text="Accordion container panel 3"/>
        </mx:VBox>

    </containers:SuperAccordion>

</mx:Panel>

adds some strange err "{ expected" ??

Yura
Is there a line number for this error? And this Panel - is it inside your application or in another file?
alxx
Ok, I got it. The err was that both Spark and MX were imported and all got mixed up. Ok, it is compiled successfully now.
Yura
A: 

Alex,, ok, I succeeded to run, thanks. Now, when I run I get this exception:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at ws.tink.mx.containers::SuperAccordion/measure()[/Users/tinktink/Documents/tink/libraries/Tink Google Code/ws/tink/mx/containers/SuperAccordion.as:1255] at mx.core::UIComponent/measureSizes()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5956] at mx.core::UIComponent/validateSize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5902] at mx.core::Container/validateSize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2659] at mx.managers::LayoutManager/validateClient()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:837] at mx.controls::List/makeRowsAndColumns()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\List.as:1303] at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1360] at mx.controls.listClasses::ListBase/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3658] at mx.controls::List/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\List.as:1005] at mx.controls.listClasses::ListBase/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3280] at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:677] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]

Any ideas?

Thanks again!

Yura
Hmm... some misconfiguration like wrong parent or something... If I'd needed SuperAccordion that badly, I would pull its sources via svn, plugged them instead of swc. Then I could debug what is that null ref...
alxx
OMG, and I thought and hoped it is about to be over...:P
Yura
Is this all from example code? Application in a single mxml file, like in your link in question?
alxx
I am trying a simplier example now, my enviroment got stuck a bit...
Yura
A: 

@Alxx, everything is working 100% now, thank you very much for your help! :))

Yura