PDA

View Full Version : "ON FINISH" evento for Flash?



pantera
10-25-2009, 12:44 PM
Is there a way to set an ON FINISH event to a flash file (without be necessary to open the FLASH program and write fscomands)?

longedge
10-25-2009, 01:16 PM
You have obviously done a search of the forum :yes :).

I don't know of a direct way but perhaps if you know how long it should play for, you could use a timer.

pantera
10-25-2009, 04:48 PM
thanks longedge,

Yes, I did a search before asking the forum.
What I want is to lunch some actions at the finish of the flash files, like appearing some buttons, dialog messages etc. My project has dozens of flash files; I am looking for a way to set the actions at the on finish event of the files.

But seems that I will have to edit each of the files to set a fscomand. Would be better if the flash movies could have the same events of AVI files, like on finish, and not only the fscomannds.

Scriptonite
10-25-2009, 10:41 PM
It would be hard to detect the actual "end" of a flash movie in some instances. Some flash files are several layers deep and although the main time frame ends on frame 10, a movie in the layer may continue play on until frame 60. It would be difficult for any program to detect the finish without a confirmation or command from flash. A better choice may be using the free encoder Format Factory (http://www.pcfreetime.com/download.html) and convert your flash files to videos.

longedge
10-26-2009, 02:57 AM
....convert your flash files to videos.

You lose a lot of the benefits of using flash objects though. My uses are as buttons and timers (and sometimes as videos) all of which I create from scratch. Possibly a different story if you are using an .swf where you don't have control of the source. Conversion would probably take as long as pasting a couple of lines of code in the last frame of the .fla.

Scriptonite
10-26-2009, 08:01 AM
I agree that flash is extremely beneficial. I have a program that has a flash interface with changeable text that is updated through the .swf and AMS just processes and handles the data. The flash is extremely versatile inside AMS. It sounded like he only had the .swf of the files though, and Format Factory is a batch converter that is pretty speedy unless you are using the disk functions. I only meant that if you are using the flash to playback animated content then there is no reason the files need to be in a flash format.

longedge
10-26-2009, 08:48 AM
... if you are using the flash to playback animated content then there is no reason the files need to be in a flash format.

I agree :) you have to be aware of all (or most anyway) the options whilst bearing in mind the drawbacks.

pantera
10-29-2009, 11:20 AM
Well, after trying a little, I think the best option is to use another file format, instead flash. With WMV, for example, I can set an ON FINISH event, and that event is very important because I want to ask questions to the user about the position in the last frame of the video.

When the video finish, then the on finish event will lunch the buttons with the questions.

But the problem is that the video is not stopping in the last frame, there is a BLACK SCREEN. I need the video stopping in the last frame, in a STILL frame.

I was reading another similar post, in http://www.indigorose.com/forums/showthread.php?t=27572&highlight=frame but the answers there are not clear.

I will have dozens of videos in my project, and I need a way to do it fast, without spending so much time in each video.

longedge
10-29-2009, 12:44 PM
There's always a way to achieve what you want. Assuming the video is not set to loop, when you detect the video has stopped you could perhaps seek backwards a second or two.

Scriptonite
10-29-2009, 01:19 PM
I had similar problem with the video object in a project, I switched to the mediaplayer plugin and it resolved these issues. Before I figured that out however, I used AMSWaves timer plugin and set the timer based on Video.GetLenth to trigger a function to change videos.

Scriptonite
10-29-2009, 02:21 PM
Sorry my mistake, it's actually the timer object by Reteset.

pantera
10-30-2009, 09:18 AM
Using a WMV file, I set an ON FINISH event like this:

Video.Seek("Video1", SEEK_END, 0);
Video.Pause("Video1");
Button.SetVisible("Button1", true);

It works OK, the video stop in a still last frame, and not a black screen.

I have another question now: I want to set visible 4 buttons. How can I set the 4 buttons to visible in just one line? I tried:

Button.SetVisible("Button1", "Button2", "Button3", "Button4",true);
and also tried:
Button.SetVisible("Button1, Button2, Button3, Button4",true);

but in both cases I got an error message.

longedge
10-30-2009, 09:52 AM
Posting the same question in two different threads will cause confusion :).

I've given a couple of possibilities in your other post.

pantera
10-30-2009, 12:16 PM
ok longedge, you are right, it is better do not have redundance in the forum!