Skip to main content
Known Participant
June 8, 2017
Answered

Adding Video(.M4V) and calling it using buttons

  • June 8, 2017
  • 1 reply
  • 547 views

Hi Animatites,

Scenario:

I have three buttons on the stage and on click of each button a video will load and play. Can anyone suggest how can this can be achieved?

I have to eventually put all the files and ensure it can be played via a DVD. So the format I assume will remain as .swf. Is my assumption correct or can some other format recognize the button interaction as well?

The current video format is M4V. Do I have to change the video to some other format for animate to recognize it?

    This topic has been closed for replies.
    Correct answer kglad

    not m4v, Add or incorporate video in Adobe Animate CC

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    June 8, 2017
    graphiasAuthor
    Known Participant
    June 11, 2017

    I created the stuff and it works perfectly fine from a Flash Player. However, the videos don't load, if I open it in IE or the Chrome Browser.

    Code:

    --------------------------------------------------------------------
    import flash.events.MouseEvent;

    import fl.controls.Button;

    stop();

    txtTitle.text = "";

    btnPres1.addEventListener(MouseEvent.CLICK, buttonClick);

    btnPres2.addEventListener(MouseEvent.CLICK, buttonClick);

    btnPres3.addEventListener(MouseEvent.CLICK, buttonClick);

    function buttonClick(e:MouseEvent)

    {

      var buttonIndex = e.target.name.substr(7);

      movieHolder.source = "Presentation1_part" + buttonIndex + ".mp4";

      switch (buttonIndex)

      {

      case "1": txtTitle.text = "XYZ1";

      break;

      case "2": txtTitle.text = "XYZ2";

      break;

      case "3": txtTitle.text = "XYZ3";

      break;

      }

    }

    --------------------------------------------------------------------

    kglad
    Community Expert
    Community Expert
    June 12, 2017

    attach a screenshot showing the directory that contains your fla and mp4s.

    also, you can debug using the developer console in chrome or ie.