1 Reply Latest reply on Mar 25, 2007 11:28 AM by MotionMaker

    Using Actionscript to create complete scenes

      Ok let me paint a picture. I'm designing an online flash application that will dynamically display tutorials stored in a MySQL database. These tutorials will be added via a php control panel for tutors to add new tutorials to the database.

      So my flash will load, dynamically create a new scene, add in some static elements i.e. logo and some other images and then list the tutorials for the user to select.

      The user then selects a tutorial and a new scene is dynamically created to display the contents of this scene i.e. a scrollPane for the text, video component for the video elements and the title etc.

      I recently read this tutorial so getting the data from the database into Flash shouldn't be a major problem.
      http://www.webmonkey.com/webmonkey/03/40/index1a.html

      Here's what I think I need

      I'm about to start digging through my flash bible so I'll edit this and let you know what I've found out myself,

      1. How to create a new scene using Actionscript,
      2. How to add a few images (jpgs) from the library using Actionscript,
      3. how to add a scrollPane (all using actionscript),
      4. how to add some text fields,
      5. how to add a video player to access a video from a folder on the server and lastly
      6. some kind of back button..

      Majority of these components will be loading content from PHP which will access my MySQL server.

      Any help would be greatly appreciated.

      Thanks

      Steve
        • 1. Re: Using Actionscript to create complete scenes
          MotionMaker Level 1
          A tall order for a single thread! There are many possible answers to each question. Plus there are not enough specifics to guide you to the correct alternative. The good news it you can do what you are planning.

          1. How to create a new scene using Actionscript,
          Do not be confused with the technical feature of a scene in Flash IDE. It is not something you use in Actionscript. However from a design view, you can create any page oriented content application you want. The usually dynamic element for creating a page is a MovieClip or the as you mentioned the component ScrollPane which is MovieClip.

          Beyond that there are many many ways to go.

          In general you would create one or more template layouts and load the content in selecting the template.

          A shell Flash movie would handle the loading of the templates and the data or content that would show.

          As well there could be swf that are custom pages that simply load and handle all the needed content separately.

          2. How to add a few images (jpgs) from the library using Actionscript,
          MovieClip.attachMovie
          You also can load externally using MovieClip.loadMovie or if you need to manipulate it after loading then MovieClipLoad.onLoadInit

          3. how to add a scrollPane (all using actionscript),

          Explained at ScrollPane.contentPath">MovieClipLoad.onLoadInit

          4. how to add some text fields,
          The question implies to create the TextField dynamically and a central method is: MovieClip.createTextField
          5. how to add a video player to access a video from a folder on the server and lastly
          Use the FLVPlayback component that is delivered with Flash 8 Pro. You need to encode the video as FLV format using the video encoder that comes with Flash 8 (also possible with import except you elected to make it external) or a third party encoder.
          You put the flv files on the server with the swf containing the FLVPlayer and use the FLVPlayback.contentPath method.
          6. some kind of back button..
          Again many many ways to go: You can use the Flash component button or create your own. You can make a button from a MovieClip. You can do these dynamically or at design time and in either case change their functionality and respond to their interactions at runtime.