Knowledge Base |
Accordion Panel V3
(views: 18962)
Accordion Panel V3 is a professional accordion component that loads movies and movieclips and supports both horizontal and vertical orientation, it supports customized tweens, states and visual styles. Here are all known issues for Accordion Panel V3. If you have any questions that you think we should discuss here please let us know.
Use the Accordion Panel without external XML file
(2007-11-27 - views: 6522)
Q: How can I add the xml file from Flash using actionscript. I don't want to have an external XML file on my server.
A: The Accordion Panel V3 needs the xml file to load the content of its panels. Also inside the XML file you define styles for the panel. If you want to insert the XML file inside your actionscript, you can use the setXML() method in order to add the xml file inside your actionscript.
See the code below:
var oXML:XML = new XML();
oXML.ignoreWhite = true;
oXML.parseXML("<?xml version='1.0' encoding='UTF-8'?>" +
"<component name='Accordion Panel V3'>" +
"<data >" +
"<item contentSize='180' enabled='true' expanded='false' title='My First Panel' contentEvents='true' contentPath='images/img5.jpg' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Second Panel' contentEvents='true' contentPath='images/img6.jpg' headerSize='20' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Third Panel' contentPath='images/img7.jpg' headerSize='20' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Third Panel' contentPath='images/img8.jpg' headerSize='20' />" +
"</data>" +
"</component>");
//accordionPanel is the instance name of your Accordion Panel component on stage.
accordionPanel.setXML(oXML);
You can also download the attached files in order to see a working example.
Files: AccPanel_XMLObject.zip
See the code below:
var oXML:XML = new XML();
oXML.ignoreWhite = true;
oXML.parseXML("<?xml version='1.0' encoding='UTF-8'?>" +
"<component name='Accordion Panel V3'>" +
"<data >" +
"<item contentSize='180' enabled='true' expanded='false' title='My First Panel' contentEvents='true' contentPath='images/img5.jpg' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Second Panel' contentEvents='true' contentPath='images/img6.jpg' headerSize='20' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Third Panel' contentPath='images/img7.jpg' headerSize='20' />" +
"<item contentSize='180' enabled='true' expanded='false' title='My Third Panel' contentPath='images/img8.jpg' headerSize='20' />" +
"</data>" +
"</component>");
//accordionPanel is the instance name of your Accordion Panel component on stage.
accordionPanel.setXML(oXML);
You can also download the attached files in order to see a working example.
Files: AccPanel_XMLObject.zip
User Comments
accordian panel v2
posted by freeroz on 2008-07-11
can we add text instead of pics, and if yes then how?
text instead of pics
posted by negush on 2008-07-14
Yes, you can display text instead of pictures. The solution for you would be to create movie clips that contain text fields with the text you want and place them in the Library (don't leave them on stage), giving them linkage ids (AS2) or class names (AS3). Then, you can specify those linkage ids or class names in the .xml file (or XML data created by code) as values of the contentPath (AS2) or source (AS3) attribute.
How to achieve text instead of pics
posted by epiraces on 2008-11-09
I guess I'm not so savy when it comes to AS2 and AS3. How to add the text from an xml file? I bought it but still can't manage to do it. Thanks!
How to achieve text instead of pics
You need to create a movie clip in the Library, containing only a text field. Then you would have to load the movie clip in all the panels you want to display text. After all the panels have been loaded and displayed (listen for the onDrawComplete (AS2) or AccordionPanelEvents.DRAW (AS3) event) and then assign the desired text all of the panel contents (access the text field inside the content). You have to write quite some code for that.
posted by negush on 2008-11-10
The solution is not so simple. The Accordion Panel component does not display text (besides the header title). It has to load content (images or movie clips) in the panels. You need to create a movie clip in the Library, containing only a text field. Then you would have to load the movie clip in all the panels you want to display text. After all the panels have been loaded and displayed (listen for the onDrawComplete (AS2) or AccordionPanelEvents.DRAW (AS3) event) and then assign the desired text all of the panel contents (access the text field inside the content). You have to write quite some code for that.
Use the Accordion Panel without external XML file
posted by lazerickl on 2009-08-06
How do you define styles for the panel using the XML within AS3?
Use the Accordion Panel without external XML file
The styles must be defined in the same way even if the xml is added inside the fla file by Action Script. Please click the link below in order to see an advanced xml example where a style is defined.
http://www.jumpeyecomponents.com/public/prod_pages/40/props.xml
http://www.jumpeyecomponents.com/Flash-Components/User-Interface/Accordion-Panel-V3-40/xml.htm
posted by florodebat on 2009-08-11
The styles must be defined in the same way even if the xml is added inside the fla file by Action Script. Please click the link below in order to see an advanced xml example where a style is defined.
http://www.jumpeyecomponents.com/public/prod_pages/40/props.xml
http://www.jumpeyecomponents.com/Flash-Components/User-Interface/Accordion-Panel-V3-40/xml.htm
Login to post your comment









