Solved

Video Play Pause (Flash CS3)

Posted on 2009-05-09
18
555 Views
Last Modified: 2013-11-11
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
Comment
Question by:seamaster9095
  • 7
  • 7
  • 2
18 Comments
 
LVL 5

Expert Comment

by:Dobromir Yordanov
Comment Utility
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
 

Author Comment

by:seamaster9095
Comment Utility
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
 
LVL 5

Expert Comment

by:Dobromir Yordanov
Comment Utility
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
 

Author Comment

by:seamaster9095
Comment Utility
I have uploaded the sample video

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

Pls help me figure out this. I need this urgent.
0
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility
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
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility

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
 

Author Comment

by:seamaster9095
Comment Utility
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
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:seamaster9095
Comment Utility
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
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility

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
 

Author Comment

by:seamaster9095
Comment Utility
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
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility
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
 

Author Comment

by:seamaster9095
Comment Utility
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
 
LVL 22

Accepted Solution

by:
rascalpants earned 500 total points
Comment Utility

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
 

Author Comment

by:seamaster9095
Comment Utility
So fast respond,  Ty.
So I need to create another layer for buttons?
because I just try nothing happened.
0
 
LVL 22

Expert Comment

by:rascalpants
Comment Utility

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now