0 Replies Latest reply on May 3, 2006 12:22 AM by ssmrkulkarni

    Script updation required

    ssmrkulkarni
      Hi my name is sunder.... please do help me by giving some solution for the following question......

      I have authored a e-learning course which consists of pause/play[toggling], hindi/english[toggling], forward&backward button.. to control all this i have written a function, which is as follows...........

      var lang:String;
      var slideNo:Number;
      var my_snd:Sound;
      var playing:Boolean;
      var pausedLoc:Number;
      function init() {
      if (!_root.inited) {
      _root.inited = true;
      lang = "english";
      my_snd = new Sound();
      slideNo = 0;
      lang01.gotoAndStop(2);
      playing = true;
      } else {
      }
      if (playing) {
      playAudio(slideNo);
      }
      }
      trace(lang);

      init();
      lang01.onRelease = function() {
      if (lang01._currentframe == 1) {
      lang01.gotoAndStop(2);
      lang = "english";
      } else {
      lang01.gotoAndStop(1);
      lang = "hindi";
      }
      playing = true;
      pausePlay_mc.gotoAndStop(1);
      playAudio(slideNo);
      var slideLabel:String = "Slide_"+slideNo;
      this._parent.gotoAndPlay(slideLabel);
      };
      prev_btn.onRelease = function() {
      if (slideNo>0) {
      slideNo--;
      playAudio(slideNo);
      } else {
      // nothing
      }
      // copy the following for the first slide's prev button
      var slideLabel:String = "Slide_"+slideNo.toString();
      if (playing) {
      gotoAndPlay(slideLabel);
      } else {
      gotoAndStop(slideLabel);
      }
      pausedLoc = 0;
      };
      fwd_btn.onRelease = function() {
      slideNo++;
      playAudio(slideNo);
      var slideLabel:String = "Slide_"+slideNo.toString();
      if (playing) {
      gotoAndPlay(slideLabel);
      } else {
      gotoAndStop(slideLabel);
      }
      pausedLoc = 0;
      };
      function playAudio(sNo:Number) {
      if (playing) {
      sNo += 1;
      if (my_snd != undefined) {
      my_snd.stop();
      }
      var id:String = "";
      var slideNo_str:String = new String();
      slideNo_str = (sNo<10) ? "0"+sNo.toString() : sNo.toString();
      if (lang == "hindi") {
      id = "HCP";
      } else if (lang == "english") {
      id = "CP";
      }
      id += slideNo_str;
      my_snd.attachSound(id);
      my_snd.start();
      }
      }
      pausePlay_mc.onRelease = function() {
      if (pausePlay_mc._currentframe == 1) {
      pausePlay_mc.gotoAndStop(2);
      playing = false;
      } else {
      pausePlay_mc.gotoAndStop(1);
      playing = true;
      }
      if (!playing) {
      pausedLoc = my_snd.position;
      my_snd.stop();
      this._parent.stop();
      } else {
      my_snd.start(pausedLoc/1000);
      this._parent.play();
      }
      };

      the above script has been placed in first movie of the first frame [Ex: PH01], which has 4000 frames of timeline, but there is continuation of the first movie, which has more 3000 frames which is second mobvie [Ex: PH02]. Again, here i have given the same above script for the movie in the frist frame......

      Note: Here by default the Voiceover will be English, if i click on Hindi [i.e.Toggling button] the voiceover will change to Hindi, again you can click on english it plays english..

      My Question Is:
      1. I will play a first movie i.e PH01.swf [Note: 4000 Frames are inside a movie clip], by default it starts with English Voice Over for the 4000 frames of animation, in between i will click on English-Hindi Toggle button [movie clip], and now the voiceover changes to Hindi. After playing 4000 Frames[Note: Hindi Voiceover will be playing] the other movie will load i.e. PH02.swf, which is the continuation of the first movie, here the vocie over has to be hindi but it is changing to English....
      And in second movie also im initalizing the same script as mentioned above, the above fuction controls all pause/play, simulated/interactive.. so i have to palce the script in the first frame of any movie....

      so please give me solution... by modifying or sending a new script....
      simple it has to work like this.... if im in first movie and play some frames there... later i click on Hindi/English toggle button the voice over changes to hindi.... if i go to the second movie [which is the continutaion of first movie] the hindi voice over has to continue not english......

      looking forward from there ASAP.

      Sunder