Skip to main content
Inspiring
October 14, 2008
Question

Tree with choices : recursive scripts VS "Exit frame" action ?

  • October 14, 2008
  • 1 reply
  • 207 views
Hello,

I need some help !

I've build a multiple choices tree menu, which is quite simple :

You start with, say, three entries : A,B,C

If you click A, it will "store" choice A and open "D,E,F,G" and so on...

Each sub menu is actually a clip that appears in another frame of its
parent (DEFG is on frame 2 of ABC movie clip).

You can "unselect" any choice at any level and it should unselect its
children. And selecting a value unselects its brothers.

Everything was working OK until I had an extra constraint : some
children at the same level are not "exclusive" (that is you can choose
between "D or E" and "F or G" but they are still at the same level and
that's where my routine does not work any more...)

So I was thinking to "hard code" unselection, as I've got a very little
number of levels. That is, if a frame is left, it will erase its
possible choices.

Say, if I go back to "main movie - frame 1", its frame 2 will call
"delete D,E,F,G" on exit. And so would its nested clips if they are open
(visible on stage)

Any idea how to achieve this ? Some kind of "onExitFrame" ?

I don't post my recursive routine because it's been altered so much I
would spend to much time making it legible... Sorry..

Thanks in advance.

PJ

This topic has been closed for replies.

1 reply

Inspiring
October 15, 2008
It works ! I cleaned up my recursive routine by passing an array of
"neighbours" to visit that I "pop" each time (and I discovered that you
have to use slice() to have a new array instead of a pointer !)

The main problem was in fact targeting neighbours that were not in the
same parent movie clip. And then came "targetPath(this)" that stored the
path for each button on root !


Hope this may help.

PJ