2 Replies Latest reply on Sep 16, 2009 8:06 AM by Carl Woffenden

    Getting the behavior instance data for a frame script

    Carl Woffenden Level 1

      Hi! With sprites it's possible to do this:




      ...to get both the behaviors and any instance data attached, like so:


           [[(member 19 of castLib 1), "["onLeftNav": #previous, "onRightNav": #next]"]]


      I don't find any method of doing this with frame scripts though. I can get the script index:


           trace(_movie.frameScript) or trace(the frameScript) [if you're Lingo inclined]


      ...but that is only part of the answer. I'd seen suggestions (a long, long time ago) of using sprite channel zero for the frame script, which works fine for the startFrame and endFrame properties but not for scriptList. Digging out my old Lingo in a Nutshell book, one of the UiHelper functions looks to be another option; looking at its interface I see:


           *getBehaviorInitializers int channelNum, int behaviorNum


      The description being "get behavior initializer string at current frame". But if I call this Director crashes (both versions 7 and 11), whether I use valid channels or zero.


      I don't have any other ideas. Has anyone had success trying this?