PDA

View Full Version : Xml Tree selecting different functions?


aktell
04-23-2012, 12:30 AM
Hi there,

I have this Xml Tree ViewStack set up which works fine now for many month as it is, but I do need to do more with it, and I have the problem that I can't work it out the way it should preform using IF or a Switch.
Maybe somebody had come across a similar problem ???

Any help would be appreciated ! regards aktell


........
if (showThisView != "") {

myViewStack.selectedChild = this[showThisView];

I need to address every time a different function I select a different
Node in this Tree.

e.g.
myViewStack.selectedChild == 0 .... ??? - function DO THIS
myViewStack.selectedChild == 1 .... ??? - function DO THAT
etc.

}
........

aktell
04-23-2012, 12:33 AM
Hi there,

I have this Xml Tree ViewStack set up which works fine now for many month as it is, but I do need to do more with it, and I have the problem that I can't work it out the way it should preform using IF or a Switch.
Maybe somebody had come across a similar problem ???

Any help would be appreciated ! regards aktell


........
if (showThisView != "") {

myViewStack.selectedChild = this[showThisView];

I need to address every time a different function I select a different
Node in this Tree.

e.g.
myViewStack.selectedChild == 0 .... ??? - function DO THIS
myViewStack.selectedChild == 1 .... ??? - function DO THAT
etc.

}
........

Barna Biro
04-23-2012, 12:53 AM
Subscribe to the CHANGE event and inside the handler decide what actions need to be taken ( which function needs to be called based on the selected data, etc. ). http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/containers/ViewStack.html#event:change