Knowledge Base


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

Accordion Panel V3

(views: 12965)

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: 1414)

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();
 }
 



Login to post your comment login to post your comment

Other questions in this item:

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


Back

Knowledge Base Search

Enter keywords below:
Advanced Search
FlashEff 2.0
Create professional flash photo slideshows online

FREE Flash Stuff

Check out these free, fully functional AS3.0 Flash components by Jumpeye:

FlashEff 2.0 Free
(free for non-commercial use)

JC Panorama
(free for non-commercial use)

JC Play List
(fully free)

Basic Menu Pack V3
(free AS3 version)

MCTE V3
(free AS3 version)

JC Player
(free for non-commercial use)

JC Flash Map
(free for non-commercial use)

Flash Bookmarks
(fully free)

ActionScript Bridge AS2-AS3
(fully free)

JS Charts
(free for non-commercial use)

Free Trial Versions

The trial versions do have a major limitation. They will ONLY run into debugger flash player versions, such as the Flash IDE player and the activeX FP used by developers.

Switch from Free Trial version to Full version.

You can switch from Trial to Full versions in a blink of an eye.
See this tutorial in order to find out how.

We accept Google Checkout

Google Checkout Acceptance Mark

Secured by VeriSign