10 Replies Latest reply on Jun 28, 2009 11:26 PM by Roquiyya

    How to call swf and xml files using action script?

    Roquiyya

      Hi,

       

      I need to create a e-learning module that has some video and audio running.

      I got the swf output using Adobe Captivate file.

      I require help in displaying the audio script below the video that is being played in flash file.

      I have to call the swf and xml file using action script .How i do it.

      I am new to this technology.

       

      Thanks.

        • 1. Re: How to call swf and xml files using action script?
          kglad Adobe Community Professional & MVP

          use the help files to read about the moviecliploader class so you can load your swf and read about the xml class to learn how to load your xml file.

          1 person found this helpful
          • 2. Re: How to call swf and xml files using action script?
            Roquiyya Level 1

            I need to complete this assignment today as a part of my manager's expectation.

            I have gone through what u have said.

            I got this code.

            on (click) {
            createEmptyMovieClip("holder_mc", 1);
            holder_mc.lineStyle(1, 0xcccccc, 800);
            holder_mc.moveTo(0, 0);
            holder_mc.lineTo(500, 0);
            holder_mc.lineTo(500, 200);
            holder_mc.lineTo(0, 200);
            holder_mc.lineTo(0, 0);
            holder_mc.moveTo(100, 0);
            holder_mc.lineTo(100, 200);
            holder_mc.moveTo(200, 0);
            holder_mc.lineTo(200, 200);
            holder_mc.moveTo(300, 0);
            holder_mc.lineTo(300, 200);
            holder_mc.moveTo(400, 0);
            holder_mc.lineTo(400, 200);
            holder_mc.moveTo(0, 100);
            holder_mc.lineTo(500, 100);
            holder_mc.loadClip("C:\\Documents and Settings\\Roquiyya_khaleel\\Desktop\\Introduction_V1.swf");
            //loadMovieNum("C:\\Documents and Settings\\Roquiyya_khaleel\\Desktop\\Introduction_V1.swf", 0);
            //createTextField("dynamic_txt", 2, 10, 40, 150, 30);
            text1.text = "Here's more text";
            }

             

            This  included to see whether I am able to display something on frame.

             

            I need to create a audio-visual where in some part I am playing the video and in bottom part there is some static text of the audio that we can listen and in one part there are some options like Help,FAQ,Bookmark,Menu.

            A complete E-learning stuff.

             

            Please help me out.

             

            Thanks

            • 3. Re: How to call swf and xml files using action script?
              kglad Adobe Community Professional & MVP

              try:

               

              var mcl:MovieClipLoader=new MovieClipLoader();

              yourbutton.onRelease=function() {

              createEmptyMovieClip("holder_mc", 1);
              holder_mc.lineStyle(1, 0xcccccc, 800);

               

              // you should use a relative path from you flash files to the swf you want to load
              mcl.loadClip("Introduction_V1.swf",holder_mc);

              }

               

              • 4. Re: How to call swf and xml files using action script?
                Roquiyya Level 1

                Thanks  for your reply.

                 

                While u were asleep, I could somehow figure out the mistake.

                 

                Now I am stuck with a rest part which is the need to display text below this movie clip which has to take data from an xml file.

                 

                to start with I want to display hardcoded text and then move on to picking data from xml file. I added a text area and on click on button its not showing the hardcoded text. Can you help me on this?

                 

                TIA

                • 5. Re: How to call swf and xml files using action script?
                  kglad Adobe Community Professional & MVP

                  assign your textfield an instance name (say tf) and assign your button an instance name (say btn).  use:

                   

                  btn.onRelease=function(){

                  tf.text="this is a test";

                  }

                  • 6. Re: How to call swf and xml files using action script?
                    Roquiyya Level 1

                    I need some urgent help regarding E-Learning Module..

                     

                    What I need to do is, I have 5 buttons and with the click of button,it should lead to its respective modules.The module should show the video along with audio and subtiltle..I have veen provided with swf movie file for each of the module.


                    My approach towards this is that:
                    I have one scene with 1 layer and 2 frames
                    first frame shouls hold the 5 buttons and the second frame shows the movie and the  subtiltle in sync.I am using Flash CS4 ,actionscript 2.0.

                     

                    It would be great if some one clarifies my doubts.
                    Q1) Is the above approach of scene,layer and frames correct?
                    Q2)The actionscript to be written on button action or on the frame action.
                    Q3)How to show the movie and the text below it simultaneously.Currently imporing on stage is not working fine.
                    Q4)Do we specifically mention the key frames or adobe by default takes them as key frames.How is the navaigation from one frame to other done?

                     

                    Thanks!

                    • 7. Re: How to call swf and xml files using action script?
                      kglad Adobe Community Professional & MVP

                      if audio and visual absolutely need to be sync'd, you should create an flv.

                      • 8. Re: How to call swf and xml files using action script?
                        Roquiyya Level 1

                        In layman's terms what I understand is , do I need to ned to add an FLVplayback component for the video and text area for the text in the same layer??

                        Will the FLVplayback play the swf  movie file or do I need to convert .swf to .flv for compatibility.If yes, what's the best way out?

                        • 9. Re: How to call swf and xml files using action script?
                          kglad Adobe Community Professional & MVP

                          the best way depends on how import sync'g is.  an flv is the best way to ensure good playback and sync'g.   but it's more work than adding your sound to your swf's timeline and setting it to stream.

                          • 10. Re: How to call swf and xml files using action script?
                            Roquiyya Level 1

                            We need to show all the text from an xml mapped to different slides of the swf movie not character by character as in streaming (currently I have the captivate files on publising I get the swf file).

                            Currently, my main problem is that I need to have video and text to appear simultaneously. I'll  think of Sync'g  in the next step.