Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-18-2004, 06:31 AM   #1
Tezread
Registered User
 
Join Date: Nov 2003
Location: Midlands
Posts: 70
Wink Video playback

I cant seem to find any tutorials on video playback. I would like to import and MPG movie and create play/pause/ff/ and rewind buttons- any signposts you could give me guys?
Tezread is offline   Reply With Quote
Old 02-18-2004, 12:18 PM   #2
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,512
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

Well, I guess the reasons there aren't any tutes on it are:
1. People don't often do it because flash is a vector-program, using too many pixels [which can easily be achieved when you work with video's] results in ****ed up sizes.
2. And secondly: Importing mpg's is as easy as ****...

But here we go anyway:

Just create an empty movieclip, in this example we'll give it the instance-name "someclip"

Then create some buttons [on the _root] with and put this script on the _root:

Code:
playButton.onRelease=function(){
  someclip.play()
}
pauseButton.onRelease=function(){
  someclip.stop()
}
stopButton.onRelease=function(){
  someclip.gotoAndStop(1)
}
stepbackwardButton.onRelease=function(){
  someclip.gotoAndStop(someclip._currentframe-1)
}
stepforwardButton.onRelease=function(){
  someclip.gotoAndStop(someclip._currentframe+1)
}
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Old 02-18-2004, 08:02 PM   #3
streets
Registered User
 
Join Date: Jun 2003
Posts: 46
Default

i'm fairly new to all this, and i've been trying to get this to work for hours but haven't had any luck at all. could someone please have a look at my .fla file and tell me what i've done wrong, i changed a little of the code as i only need play & pause. i've also linked to the video (.mov), is that ok? I added an .flv version of the video in there too (just in case you need it), which i can't get to play at all...?

thanks

s
streets is offline   Reply With Quote
Old 02-18-2004, 08:03 PM   #4
streets
Registered User
 
Join Date: Jun 2003
Posts: 46
Default

it won't let me attach the file???
streets is offline   Reply With Quote
Old 02-18-2004, 08:26 PM   #5
streets
Registered User
 
Join Date: Jun 2003
Posts: 46
Default

i uploaded the file to my space (minus the flv) to here. any help would be appreciated.
streets is offline   Reply With Quote
Old 02-19-2004, 10:37 AM   #6
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,512
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

Streets -> great movie, I was able to solve the problem partually. I found a away to do the video-playback and stuff, but I couldn't get the audio included. But here here's a zip with what I got so far for starters. I'll break my mind over the audio-part, maybe it has something to do with using a quicktime-movie...

By the way: great movie, liked it

- Ruben
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Old 02-19-2004, 10:50 AM   #7
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,512
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

Damn! They won't let me attach the zip!

OK: I'll try to explain what you did wrong with the video-thing...

1. Just remove the video from the library and remove the video from the stage
2. Create a new and empty movieclip on the stage and give it the instance-name 'videoClip'
3. When you're in the new movieclip go to
[file]
[import]
[import to stage]
and select the file [video.mov]
4. Then go through all the steps and select:
'Embed video in...' and 'Import the entire video'
5. After that you'll get a window that tells you that the video requires 600 frames, click yes.
6. On the _root, put the following script:
Code:
_root.screennotblackanymore=30
videoClip.stop()
playButton.onRelease=function(){
	if (videoClip._currentframe<_root.screennotblackanymore){
		videoClip.gotoAndPlay(_root.screennotblackanymore)
	}else{
		videoClip.play()
	}
}
pauseButton.onRelease=function(){
	videoClip.stop()
}
7. On the last frame [frame600] of a new and empty layer in the video-movieclip paste this script:
Code:
gotoAndStop(_root.screennotblackanymore)
That should do it for the video-part. As I said: I'll think about the audio-part...

Good luck - Ruben
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Old 02-19-2004, 06:46 PM   #8
streets
Registered User
 
Join Date: Jun 2003
Posts: 46
Default

thanks for the help ruben, i've got the video playing but the buttons don't work?
so a few questions:
-what should the layer with the videoClip be called?
-should the buttons be in the main scene (called "_root") with the script attached to the first frame?

thanks again

s
streets is offline   Reply With Quote
Old 02-20-2004, 11:46 AM   #9
Ruben
Me
 
Ruben's Avatar
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 3,512
Send a message via MSN to Ruben Send a message via Skype™ to Ruben
Default

I read your PM, I mailed you the sample a few seconds ago...

- Ruben
__________________
.
Originally Posted by MichaelxxOA
"He sounded like he knew which words he was going to use before he knew what he was going to say. I hate that shit."
Ruben is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:19 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.