Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE FLASH:HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

combining flv with movieclips

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
dave rumbelowcombining flv with movieclips
by on May 14, 2009 at 3:13:03 pm

I am about to embark on a project that will include a video of a speaker giving a lecture accompanied by text and graphics some of which will be buttons to link to web pages, other parts of the flv etc.
I notice there are a few different techniques for achieving this and wondered if there was a favoured technique.
Any help gratefully received
thanks



Return to posts index
Reply   Like  

demetri tashieRe: combining flv with movieclips
by on May 14, 2009 at 9:31:28 pm

i'm sure people are sick of hearing me say this, but i am a big fan of using CuePoints. your project seems like it would use a combination of both Navigation Cue points, and Event Cue points.


Return to posts index
Reply   Like  

dave rumbelowRe: combining flv with movieclips
by on May 15, 2009 at 3:03:29 pm

I thought that might be the answer, I am not a flash wizz and am really struggling with them, I have written my event listener to spit out the cue points to my output but I can't figure out how to hook them up to launch movieclips, any tips?



Return to posts index
Reply   Like  


demetri tashieRe: combining flv with movieclips
by on May 16, 2009 at 3:28:36 am

as much as i love learning and using ActionScript, i do not consider myself a purist. in other words, i will just as easily rely on a Component ( gasp .... ) if it is easier or better, than relying solely on code ....

as such, you can, obviously, add Cue Points with script. i however always try to add the cue points while i am encoding , and i do use the Flash Video Encoder to add the Cue points and generate the FLV. these 'embedded' cue points are much more reliable to me, since they are actually adding a keyframe in the video. ok, enough said. create your cue points, with unique names.just keep in mind that navigation cue points are for just that - to navigate to or from a certain point in the video ( say you want a button to take you to a certain point in the video .. that is a navigation cue point ). event cue points invlove and trigger ,well, events.

anything you want to happen once the video hits that event cue point, can occur.

here's a simple real world scenario and how to make it work ( btw , i hate giving examples using 'trace'. i find most people can't then put that into a real function. give me 'real world scenarios' anytime ) :

you have a flv with a event cue point named cpoint1. you have a navigation cue point named cpoint2.


let's say cpoint1 is at 5 seconds into the video, and cpoint2 is 50 seconds into the video.

cpoint one will trigger the event of placing a button on the stage. this button will be scripted to navigate to cpoint2. in other words a button appears, which when clicked, will skip ahead to somewhere else in the video ( in this case to 50 seconds into the video ) . you should be able to extrapolate all other possibilitieds from this ( populating text fields, triggereing other videos, navigating to URLs etc etc etc )

here's some code to make it all work. to keep it simple, on the stage is a FLVPlayback Component with an instance name of flvPlayer. in the library is a movie clip with linkage name btn to be used as the button. the flv with the cue points is called video.flv

//import the necessary classes
import fl.video.FLVPlayback;
import fl.video.VideoEvent;
import fl.video.MetadataEvent;

flvPlayer.source="WalkingOnSunshine.flv" //sets the source of the video player

//listens for cpoint1, and tells it to add the button via addChild
flvPlayer.addEventListener(MetadataEvent.CUE_POINT, addButton );

function addButton(pEvent:MetadataEvent) {
if(pEvent.info.name == "cpnt1"){
var button:MovieClip = new btn;
addChild(button);
button.x=75;
button.y=200;
}
// to get the button to navigate to the cue point
button.addEventListener(MouseEvent.CLICK, navToCuePOINT);
function navToCuePOINT(evt:MouseEvent):void{
flvPlayer.seekToNavCuePoint("cpnt2");
}

}



let me know if this makes sense and helps ( or not ! )


Return to posts index
Reply   Like  

demetri tashieRe: combining flv with movieclips
by on May 16, 2009 at 3:18:44 pm

i am revising this code ever so slightly. after writing it, i then actually went on to test it ( bad me ...)
it totally worked as is, but was throwing out a Compiler error ( which did NOT effect the fuctionality - it played and worked correctly through the error) i am just now placing the button.addEvent Listener within the scope of the if statement....

revised code:



//import the necessary classes
import fl.video.FLVPlayback;
import fl.video.VideoEvent;
import fl.video.MetadataEvent;

flvPlayer.source="YourVideo.flv" //sets the source of the video player
flvPlayer.autoPlay=false;

//listens for cpoint1, and tells it to add the button via addChild
flvPlayer.addEventListener(MetadataEvent.CUE_POINT, addButton );

function addButton(e:MetadataEvent) {
if(e.info.name == "cpnt1"){
var button:MovieClip = new btn;
addChild(button);
button.x=75;
button.y=200;
//}
button.addEventListener(MouseEvent.CLICK, navToCuePOINT);
function navToCuePOINT(evt:MouseEvent):void{
flvPlayer.seekToNavCuePoint("cpnt2");
}}

}

plyVideo.addEventListener(MouseEvent.CLICK, plyVID );

function plyVID(evt:MouseEvent):void
{ flvPlayer.play(); }



Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]