My account
Shopping cart
Knowledge base
Support

Knowledge Base

Important! All new questions are usually answered within the next business day.

Accordion Panel V3

(views: 25920)

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.



Load new content without XML

(2009-02-25 - views: 7634)
Q: Is there a way to load new content into a single panel, without having to refresh the entire accordion panel with a new xml ?
A: Yes, there is a workaround. This example contains a function that will load new content into the specified panel and also can set a new title and a new content size. This is the AS3 version of the AS2 example which was previously created.

So for this to work, all you have to do is set up the fla file with the accordion panel component and two buttons, just like the AS2 example (with the same instance names) and add the following AS3 code:

 loader0_btn.addEventListener(MouseEvent.CLICK, loadInPanel0);
 loader2_btn.addEventListener(MouseEvent.CLICK, loadInPanel2);
 
 function loadInPanel0(evt:MouseEvent):void {
     changePanelData(acPanel, 0, "New Title", "images/jmp01.jpg", 100);
 }
 
 function loadInPanel2(evt:MouseEvent):void {
     changePanelData(acPanel, 2, "New Image", "images/jmp03.jpg");
 }
 
 
 /*
 
 This function loads a new content in the specified panel and sets a new title and content size. 
 
 IMPORTANT:
 By using this function, it is possible that other attributes of the accordion panel component instance 
 (like size) will not get updated. This function can be used only for the specified actions. All other 
 attributes/properties of the component will probably remain in the state they had before applying this
 function.
 
 parameters:
 acpInstance - the reference to the AccordionPanelV3AS3 component, into which the new conten will load
 panelIndex:int - the 0 based index of the panel into which the new content will load
 newTitle:String - a new title for the panel header
 newContent:String - the url for the new content
 newContentSize:Number - the new size for tha panel. If there is a new size for the content, the panel
             will resize but the panel should be closed and then opened again to have the size of the
             accordion panel component updated
 
 */
 function changePanelData(acpInstance:AccordionPanelV3AS3, panelIndex:int, newTitle:String, newContent:String, newContentSize:Number = 0):void {
     if (acpInstance == null) return;
     if (isNaN(panelIndex)) return;
     if (panelIndex >= acpInstance.items.length) return;
     // set the new size for the panel
     if ((!isNaN(newContentSize)) && (newContentSize > 0)) {
         acpInstance.items[panelIndex].contentSize = newContentSize;
         acpInstance.items[panelIndex].setSize(newContentSize, "false");
     }
     // set the new title for the header
     if (newTitle != null) {
         acpInstance.items[panelIndex]._header.accText.text = newTitle;
         acpInstance.items[panelIndex]._header.changeTextFormat(acpInstance.items[panelIndex].styleObj.textFormat);
         acpInstance.items[panelIndex].title = newTitle;
     }
     // load the new content into the panel
     if (newContent != null) {
         acpInstance.items[panelIndex].load(newContent);
         //acpInstance.items[panelIndex].source = newContent;
     }
     
     acpInstance.invalidate();
 }
 



Other questions in this item

Non Latin characters Accordion Panel communicates with a loader Open the accordion panels automatically Vertical title for horizontal accordion panel Installing the Accordion Panel V3 Accordion Panel slide show the title isn't showing in the horizontal mode Stopping video content when changing the panel Use the Accordion Panel without external XML file Access header title and panel content Open the Accordion Panel upwards Auto open a panel on startup Load different kind of data into AccordionPanelV3 Use HandCursor on Accordion Panel's items Open panels upward for vertical accoirdion and to the left for horizontal accordion Get the size of panel's content Access accordion panel loaded with loadMovie inside container clip Dimensions Panel opens only after content is loaded, when loadExpandedItemsOnly is true Open panels from bottom to top and left to right Open URL from panel content, not from panel header Open URL from panel content, not from panel header Open Accordion panels automatically (slide show) Flv playback inside accordion Load new content without XML Panel opens only after content is loaded, when loadExpandedItemsOnly is true Rotate the direction of the text on horizontal Accordion Getting accurate accordion height Non Latin characters TEXTU appears in my file HyperLinking panels Accordion Panel communicates with a loader Acces accordion panel from content Acces accordion panel from content Graphics below the accordion panel Panels with different sizes Access header title and panel content Get selected panel and content

Back