Copy link to clipboard
Copied
Hey guys
As per the title, I've got a video set as a background using the Movie Clip symbol and I've followed every tutorial I can find, but it's not looping plus there's no audio. Nothing I can find online explains this. Anyone have any suggestions please?
Many thanks!
Chris
if you mean flvplayback component, assign it an instance name (eg, flv_pb) and use:
import fl.video.VideoEvent;
flv_pb.autoRewind = true;
flv_pb.addEventListener(fl.video.VideoEvent.AUTO_REWOUND,rewoundF);
function rewoundF(e:fl.video.VideoEvent){
flv_pb.seek(0);
flv_pb.play();
}
Copy link to clipboard
Copied
your movieclip needs to have the video added to its (the movieclip) timeline, or use a video component that's set to loop. then you have to use control > test > ...
Copy link to clipboard
Copied
Hi kglad
Thank you for your reply. I don't know if this helps, but the only way I could get a MP4 video clip into this project was as a Video Component. Does this change anything?
Many thanks
Chris
Copy link to clipboard
Copied
if you mean flvplayback component, assign it an instance name (eg, flv_pb) and use:
import fl.video.VideoEvent;
flv_pb.autoRewind = true;
flv_pb.addEventListener(fl.video.VideoEvent.AUTO_REWOUND,rewoundF);
function rewoundF(e:fl.video.VideoEvent){
flv_pb.seek(0);
flv_pb.play();
}
Copy link to clipboard
Copied
That worked, thank you so much!
Do you have any tips on how to get the audio from that video to sound? It's still silent.
Copy link to clipboard
Copied
is your computer volume set to an audible level?
does the sound play when you test the video from your file system (in your default player)?
Copy link to clipboard
Copied
Yes, it just wouldn't play from within the Animate Project or a test preview
Copy link to clipboard
Copied
Ah it would seem my audio is out of sync with my method
Copy link to clipboard
Copied
does the video (when tested from your file syste,) include sound?
Copy link to clipboard
Copied
Yes audio was embedded in the file. If I play the video outside of Animate (i.e. through Finder) the sound is present.
Copy link to clipboard
Copied
open the video in adobe media encoder and resave it to see if you can then import into animate without problem.
Copy link to clipboard
Copied
Thank you KGLad, what format should I export it as? It was originally MP4
Copy link to clipboard
Copied
Well the good news is, I do have audio from the video file now! The bad news is, whenever I click on a button that has sound attached to it, I get digital distortion, all sound stops, and the video starts from the beginning without audio
Copy link to clipboard
Copied
Actually I might have this, I added the audio separately as a sound event and told it to loop.
Thank you again for all your help!
Copy link to clipboard
Copied
Wait, there was a random keyframe that shouldn't have been there. Everything's working now.
Again BIG thanks to you kglad, you have really helped me immensely and I am grateful 😄
Copy link to clipboard
Copied
you're welcome
Copy link to clipboard
Copied
Hey KGLad
I wonder if you can help me. I've added a second video to my project in the same manner as before, and I used your script again ...
import fl.video.VideoEvent;
RadarMov.autoRewind = true;
RadarMov.addEventListener(fl.video.VideoEvent.AUTO_REWOUND,rewoundF);function rewoundF(e:fl.video.VideoEvent){
RadarMov.seek(0);
RadarMov.play();
}
By @kglad
Only this time I'm getting an error.
"1021: Duplicate function definition."
What can I do?
Copy link to clipboard
Copied
if you want to control both, you have to give them different instance names (in the control panel) and in the code, eg flv_pb1 and flv_pb2. then you could use the same function to control them, if you wanted:
import fl.video.VideoEvent;
flv_pb1.autoRewind = true;
flv_pb1.addEventListener(fl.video.VideoEvent.AUTO_REWOUND,rewoundF);
flv_pb2.autoRewind = true;
flv_pb2.addEventListener(fl.video.VideoEvent.AUTO_REWOUND,rewoundF);
function rewoundF(e:fl.video.VideoEvent){
e.currentTarget.seek(0);
e.currentTarget.play();
}