1 Reply Latest reply on Nov 14, 2006 1:19 PM by Newsgroup_User

    Dynamic keyframe creation?

    raylaur Level 1
      I want to use XML and Actionscript to create, name, and assign objects, and navigate to frames on a timeline. So, for example, if the XML contains 10 "page" nodes the Actionscript will create 10 frames named "page1", "page2"......"page10". Then a button on a named frame can jump to another named frame...etc. exactly as if I had manually created a timeline with 10 frames.

      I know how to work with the XML but am not sure If I can open up new movie frames with Actionscript as described.

      Is this possible or should I be thinking about it in a different way..maybe creating an array from the nodes and attaching clips containing the elements of each "page" then using a "goto" button action that just hides or shows the "page" clip?
      IF I wanted to load contents into the page elements (from outside - such as text and images), what are considerations for keeping them in cache so that they don't have to reload from outside everytime the "page" is visited?
        • 1. Re: Dynamic keyframe creation?
          Level 7
          raylaur,

          > the Actionscript will create 10 frames named "page1", "page2"
          > ......"page10". Then a button on a named frame can jump to
          > another named frame...etc. exactly as if I had manually created
          > a timeline with 10 frames.

          I'm still exploring ActionScript 3.0, but I know this isn't possible in
          AS2.

          > Is this possible or should I be thinking about it in a different way..
          > maybe creating an array from the nodes and attaching clips containing
          > the elements of each "page" then using a "goto" button action that just
          > hides or shows the "page" clip?

          I'd say you're heading in the right direction with your alternate
          approach. Either attach existing movie clips or create new ones at runtime.
          I could see creating a "book" movie clip to hold your "pages," then using
          the MovieClip._visible property of each "page" to turn them on or off.

          > IF I wanted to load contents into the page elements (from outside -
          > such as text and images), what are considerations for keeping them
          > in cache so that they don't have to reload from outside everytime
          > the "page" is visited?

          Once they're loaded, they're in the user's cache. Requesting that file
          a second time, like requesting an image twice in a browser, is requesting it
          from the user's local hard drive.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."