[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

Video Play Pause (Flash CS3)

Hi,

I hope someone notice this thread. I need help.

I have a video, I import it to Flash CS3. its .avi file. The video is animation page flip (2 minutes length video and 7 pages flip) The video is something like this http://www.youtube.com/watch?v=eQQorNhD2M8&feature=player_embedded
And I want to make next and previous button which can go to page 1 page 2 in the video.
Lets say~
Page 1 is video start/play from 00.00 - 00.20 (this is video time)
Page 2 is video start from 00.20 - 00.30

So If I click next button, the video will play starting from 00.20 (Page 2).
If I click prev button, the video will play starting from 00.00 (Page 1)

Do you guys think its possible to do it in flash?
I just start learning flash so I have no idea how am I going to do this.
Hope someone can help me.
Thanks in advance.

If  you cant understand my question, pls ask me.
Sorry for my poor English as its not my main language.
0
seamaster9095
Asked:
seamaster9095
  • 7
  • 7
  • 2
1 Solution
 
Dobromir YordanovCommented:
Ignore the timing,what's the general effect you're after?The user is on let's say page 1.He clicks next,the movie plays the part where the book turns from page 1 to page 2,he clicks previous,the movie plays the same in reverse as if he turned back to page 1. Is that it or you want something else? And do you want the pages to stay on screen for a predefined amount of time and then turn to the next one or the only way to turn to be with the buttons?
0
 
seamaster9095Author Commented:
Yes, I want this effect.
When the user on Page 1, he clicks next button then the movie play the part the book turns from page 1 to 2.
If he clicks previous button, the movie plays the same in reverse as if he turned back to page 1.
Do you this possible?
I am really new on Flash.
0
 
Dobromir YordanovCommented:
I'm pretty sure it's doable but I'm writing an article right now and I'll try it when I can.In the meantime,upload a sample video if you want so anyone who wants to help you can try.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
seamaster9095Author Commented:
I have uploaded the sample video

http://www.megaupload.com/?d=E9F92BJB

Pls help me figure out this. I need this urgent.
0
 
rascalpantsCommented:
i might not be understanding what u need, but if you need to skip to a point in a video, use seek()

ns.seek(20);

this assumes u r using netstream

rp / ZA
0
 
rascalpantsCommented:

okay, i think i misunderstood how the application was setup...

so you have an embeded video that is now in the timeline, right?


I found an really easy tutorial for you... I assume you are not using AS 3.0...  below is the link, and I have attached the code that was presented...

http://flashmove.com/forum/showthread.php?t=23828


you would use this code and instead of myButton, you would use the instance name of your previous button.  and based on the keyframe that you need to animate backwards to, you can change the value of 15 to the frame you want.


rp / ZA


myButton.onClick=function()
{
	this.onEnterFrame=reverseFrame;
}
this.reverseFrame=function()
{
	if (this._currentframe>15) 
	{
		this.prevFrame();
	} else {
		delete this.onEnterFrame;
	}
}

Open in new window

0
 
seamaster9095Author Commented:
The animation I import to Flash is not made in Flash.
I made it using 3ds max and import it to Flash. as FLVPlayback (.avi file)

And I only have one frame, how am I going to do it?
Sorry if confused you, I am totally new in flash.
0
 
rascalpantsCommented:
you need to re-import the AVI file into the Flash document, and select the embed in file option(last radio button) and then the video will be put in as many frames as needed to play the video with the Flash playhead.

make sure to first change your Frames Per Second number to match the Video frame rate


rp / ZA
0
 
seamaster9095Author Commented:
Can you explain in details? Like step by step how to do it.
I really don't understand flash at all. x_x
Hope you dont mind.
Thanks
0
 
rascalpantsCommented:

sure...

- start with a new document
- make the frames per second equal to your AVI (most likely 24 or 30) in the propertied panel
- then select File > Import to stage
- find the AVI file and select it
- a prompt will come up
- select the very last radio button, which should be labeled something like Embed Video in timeline
- then you just click OK for the rest of the pages
- if it ever asks you if you want to have the timeline expand to the number of frames in the AVI, selct yes

at the end of this you should have a layer with the AVI stretched to the end... and when you movie the playhead, the video will play with it...

Then use the above code to play the video in the way you want...

rp / ZA


0
 
seamaster9095Author Commented:
Okay, now I don't get the code.
I put the code in button and which one I need to change? xD
Do you have any link to learn this. I am @.@
0
 
rascalpantsCommented:
no, you don't put the code "in" or "on" a button, you put it on the timeline (or in a class for best practice).

you basically, need to create a movieclip...  so draw a shape, hit the F8 key, name the symbol, hit okay... then in the properties panel, give it an instance name.

the instance name I chose in the code above is "myButton"


rp / ZA

0
 
seamaster9095Author Commented:
I see. So the above code is reverse frame?
Where do I put it? And how about go to specific frame script.
I need it for my next page button.
I feel like asking so many questions. Hope u dont mind.
0
 
rascalpantsCommented:

okay...  I assume you are using AS 2.0...  I have cleaned up the code, and posted it below...  

- it should be put into frame 1 in its own layer (top layer) and named "ACTIONS".

- create a new layer below the actions layer and call it "FRAME STOPS".

- then in the first frame and the last frame, create keyframes by hitting the F6 key

- then in the actions panel, type "stop();" in both keyframes

- you layer with the video embedded on the timeline should be below the others

- create two movieclips and give them instance names of "forward_btn" and "reverse_btn"


then you can compile the SWF (run it) and the buttons should make the timeline play forward and backwards.


rp / ZA







 
// import utility class to control scope
import mx.utils.Delegate;
 
 
// assign event handlers for buttons
forward_btn.onRelease = Delegate.create( this, startForward );
reverse_btn.onRelease = Delegate.create( this, startReverse );
 
// event handler for forward_btn
function startForward():Void
{
	play();
}
 
// event handler for reverse_btn
function startReverse():Void
{
	reverse_btn.onEnterFrame = Delegate.create( this, reverseFrame );
}
 
// event handler for onEnterFrame
function reverseFrame():Void
{	
	if (_currentframe > 2) prevFrame();
	else delete reverse_btn.onEnterFrame;
}

Open in new window

0
 
seamaster9095Author Commented:
So fast respond,  Ty.
So I need to create another layer for buttons?
because I just try nothing happened.
0
 
rascalpantsCommented:

yeah, typically your movieclips (buttons) should be on a separate layer.  Actions should be on a layer by itself, typically at the top.

if you start a new document, and do exactly as i stated above, this will work for you.


rp / ZA
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 7
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now