Sie sind nicht angemeldet.

1

Sonntag, 29. August 2010, 19:24

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

Sonntag, 29. August 2010, 20:10

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

Montag, 30. August 2010, 05:53

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

Sonntag, 5. September 2010, 11:21

Tree Menu

Nobody have any idea???????

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

bulp

Fortgeschrittener

Beiträge: 390

Wohnort: Malaysia

  • Nachricht senden

5

Montag, 6. September 2010, 19:21

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