You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, August 29th 2010, 7:24pm

Tree Menu

the problem is to link the krpano xml to the tree menu...

On a normal menu (botton) the code then we apply is:

function loadpano2a_clicked(mouseevent:MouseEvent):void
{
// hide the loadfirstpano button
// this.button_loadfirstpano.visible = false;

// a example with following actions
// - each action, with a single call
krpano.call("loadpano(datafile/03.xml,null,KEEPALL,BLEND(2));");
krpano.call("4");
krpano.call("lookat(0,0,10);");
krpano.set("view.camroll","180");
krpano.call("wait(blend);");
krpano.call("lookto(0,0,130,smooth(100,20,50));");
}
this.loadpano1a.addEventListener(MouseEvent.CLICK, loadpano1a_clicked);


Unfortunately on a tree menu we cant link the XML code of krpano.

You have a solution????

thanks *cry* *cry* *cry* *cry* *cry*

2

Sunday, August 29th 2010, 8:10pm

that is the code for the tree



//import the menubar
import com.yahoo.astra.fl.controls.MenuBar;

//import the required data class
import com.yahoo.astra.fl.data.XMLDataProvider;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

//create an xml object
var menus:XML =
<menus>
<menu label="colors">
<menuitem label="red" />
<menuitem label="orange" />
<menuitem label="yellow" />
<menuitem label="green" />
<menuitem label="blue" />
<menuitem label="purple" />
</menu>
<menu label="cars">
<menuitem label="american">
<menuitem label="cadillac" />
<menuitem label="buick" />
<menuitem label="pontiac" />
<menuitem label="chevrolet" />
<menuitem label="ford" />
</menuitem>
<menuitem label="japanese">
<menuitem label="toyota" />
<menuitem label="honda" />
<menuitem label="nissan" />
</menuitem>
</menu>
<menu label="apples">
<menuitem label="gala" />
<menuitem label="granny smith" />
<menuitem label="fuji" />
</menu>
</menus>

//instantiate the MenuBar and populate its dataProvider with the xml object
var menuBar = new MenuBar(this);
menuBar.dataProvider = new XMLDataProvider(menus);

3

Monday, August 30th 2010, 5:53am

or this code for the tree




// Import the treeClasses.* to use TreeDataProvider
import com.yahoo.astra.fl.controls.treeClasses.*;

// Define an XML variable that will be used to populate the Tree
var myxml:XML =
<node label="Root Node">
<node label="Family photos">
<node label="Mom and I.jpg"/>
<node label="Dad and I.jpg"/>
<node label="My dog Skip.jpg"/>
<node label="Dancing together.jpg"/>
</node>
<node label="Vacation shots">
<node label="Eiffel Tower.jpg"/>
<node label="Louvre pyramid.jpg"/>
<node label="Rodin Museum.jpg"/>
<node label="Rue Elysees.jpg "/>
</node>
<node label="Architecture pics">
<node label="Rome">
<node label="Coliseum.jpg"/>
<node label="Vatican.jpg"/>
</node>
<node label="Greece">
<node label="Parthenon.jpg"/>
<node label="M. Olympus.jpg"/>
</node>
</node>
</node>;

// Set the Tree's dataProvider to a new TreeDataProvider, instantiated with the above XML
mytree.dataProvider = new TreeDataProvider(myxml);

// Define custom icons for the three different icon types in the Tree.
mytree.setRendererStyle("closedBranchIcon", folderClosedIcon);
mytree.setRendererStyle("openBranchIcon", folderOpenIcon);
mytree.setRendererStyle("leafIcon", fileIcon);

4

Sunday, September 5th 2010, 11:21am

Tree Menu

Nobody have any idea???????

Plase *cry* *cry* *cry* *cry* *question* *question* *question* *question* *question*

bulp

Intermediate

Posts: 389

Location: Malaysia

  • Send private message

5

Monday, September 6th 2010, 7:21pm

i do bought this 2 level menu flash file from HERE and modified the script just to make sure it compatible with krpano...