FORUMS: list search recent posts

how do I... (conditional video playing)

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Irene Driessen
how do I... (conditional video playing)
on Mar 11, 2009 at 7:41:40 pm

Hi all,
I'm a relative newbie to Flash. I'm now working on a new project and need to do this:

I want to play one video (let's name it 'story').
At the end, I want 2 buttons (or 3, 4, but that doesn't matter I guess).
One is 'the right answer' and needs to play the 'right answer video',
the other one(s) 'wrong answer', need to play the 'wrong answer video'.

Also, at the end of both the 'right' and 'wrong' bits, I want to give the viewer the opportunity to re-view the original 'story' video.

So, where should I start?
How can I make a flash project that does

play 'story'
'user input'
if right - play 'right' - if wanted play 'story' again (or end)
else wrong - play 'wrong' - if wanted play 'story' again (or end)

I hope I've made it a bit clear, any help appreciated!


Return to posts index

demetri tashie
Re: how do I... (conditional video playing)
on Mar 12, 2009 at 2:07:47 am

i think i understand what you are asking. i made a little test of it. you can see it here: note: this is AS3 ! !

i used short video clips of old TV programs.
the 'story' video = Lucy , the 'right answer/yes' video = Car54 , the 'wrong answer/no" video = George Burns. There are 4 buttons. it's not pretty - it just illustrates the functionality plain and simple.

here is an outline of how you can approach this. you can search this site and it's tutorials for more specifics on coding each step, or ask for help if you don't understand.

1) add an Event type Cue Point to the end of the first video

2) have that Cue Point trigger the instantiating of the 2 buttons. the buttons can be OUTSIDE of the FLVPlayer ( in my example i just toggled on and off the visibility of the buttons depending on the need.)

3) those 2 buttons then load the appropriate next video.

4) those 2 videos each have a Cue Point at the end to make a new button appear that would then reload the original video... ( my 'review' button )

i don't see the need for conditional statements to have this type of functionality. it would all be 'button' based MouseEvents to call each specific function. there is just a little Conditional Logic in dealing with listening for the certain Cue Points.

does that help ??

Return to posts index

Irene Driessen
Re: how do I... (conditional video playing)
on Mar 12, 2009 at 8:12:40 am

Yes! thanks, that is an excellent start. Is it also possible to have buttons as if they were an 'overlay' over the movie?
And in this case (sorry for the newbie questions, I'm learning...) is the swf just a 'placeholder' containing the buttons and scripts pointing to the movies, and are the movies kept separately?

Return to posts index

demetri tashie
Re: how do I... (conditional video playing)
on Mar 12, 2009 at 1:07:12 pm

yes - the buttons can be anywhere - 'overlayed over the video or elsewhere. see here to see them now OVER the video, once they appear: note that the YES button is made semi-transparent, in case that is what you meant by 'overlay'

basically the buttons can be anywhere, and look like, and act like, anything you want..

this example is a 1 frame Flash Movie ( a generated SWF). in it, on that main timeline ( 1 frame) is a FLVPlayback Component, and the 4 buttons. each button isa 1 frame MovieClip Symbol.

all the script lies on the first frame of the main timeline. all the FLV files ( the videos) are outside the main file, and are referenced by the script. - so yes, the movies are kept separately.

as far as the 'placeholder' comment: in my example, the buttons and FLVPlayback Component actually reside ( are placed) on the stage ( the first frame of the Main Timeline), so it is not really a 'placeholder'. you could of course have everything referenced and or created right from your Actionscript, in which case you could call it a 'Placeholder'. that would just require extra coding steps to do so. You could of course consider the FLVPlayback Component on the stage a 'placeholder' for the 3 videos to come..

hope that helps some more !

Return to posts index

Irene Driessen
Re: how do I... (conditional video playing)
on Mar 12, 2009 at 2:15:19 pm

Fantastic, thanks so much for your help, it is greatly appreciated!

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved