Copy link to clipboard
Copied
I have a simple scene with multiple buttons that each start a different video. Each video lives on a separate frame. Click a button, and it goes to the salient frame and the video plays. What I'd like to do is have the video fade up, play, then fade out. I don't know how to do this. Each button click goes to the frame where it's video lives.
The first frame has all of the actions. They take the following form:
Hi.
Video components wrap DOM elements, so you'll need CSS for it.
You can add the styles in the HTML file using a publish template or use the .animate method in JavaScript, for example.
var root = this;
// the two methods below could live in the first frame
root.onDrawEnd = function(e, data)
{
root.fadeVideo(data.id, data.from, data.to, data.duration);
};
root.fadeVideo = function(id, from, to, duration)
{
currentVideo = document.getElementById(id);
currentVideo.animate([{ opa
Copy link to clipboard
Copied
Well, I added the below and still no joy. Once the button is pushed and the video runs its course, upon the next button push it fades up over 2 seconds then disappears, or I'm presuming the opacity goes to 0.
Copy link to clipboard
Copied
not the function, too.
upload you fla, post link.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
which of the 3 flas is the current fla?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It's ogl_interactive_v01_wip02.fla.
Copy link to clipboard
Copied
I tried a method to omit the function, as seen below, and that too didn't work.
Copy link to clipboard
Copied
Thank you both for your patience in helping me figure this out. I think I'm on the right path to redo the way I had done my previous layout, but I'm still struggling with one important aspect. Once I've clicked a button and the video has run it's course, the next time I click the button (any button really since I'm using the same video component and just changing the source), the video fades up and then disappears immediately. I know what's causing it because if I set the opacities in the e.currentTarget.animate from 1 to 1 (to: to to: in the parlance of the code) the video is replayable...it fades up, it just never fades down. I'm struggling to understand why the video can't fade down and the function bring it back upon button repress.
My suspicion is that the function thinks the video has "ended" already and just changes the opacity to 0 after duration. Is there a clever way to reset that? Perhaps this isn't what's going on...just a guess, really.
The code is below:
Copy link to clipboard
Copied
For posterity, I figured out the issue as seen below:
Copy link to clipboard
Copied
Thank you to you both! I'll give this a shot.
Copy link to clipboard
Copied
thumbs up