Actionscript cuepoints
Hey Guys,
I'm using FLVplayback and Actionscript cue points, no
embedded cue points in the FLV. I will be changing the actionscript
cue points from time to time, but I still need a button to advance
through the cue points and back, so I can't use
seekToNextNavCuePoint(). Any help would be greatly appreciated.
Thanks!
I have basically the same question... the FLVPlayback buttons backButton and forwardButton, as well as the seekBar, may only jump the play head along and trigger navigation cue points? Is there a way to develop a seek bar that allows seeking along actionscript cue points?
Thanks in advance...
Similar Messages
-
How to add Actionscript cuepoints in the latest version?
I can't figure out how to add Actionscript cuepoints...I see some documentation from November 2009 online but it doesn't match the OSMF docs online for Sprint 10.
I seem to be able to add a cuepoint by writing:
var cuePoint:CuePoint = new CuePoint(CuePointType.ACTIONSCRIPT, 1, "good point", null);
videoElement.addEventListener(MediaElementEvent.METADATA_ADD, onMetadataAdd);
But when I take these two functions from the OSMF online docs:
private function onMetadataAdd(event:MediaElementEvent):void
if (event.namespaceURL == CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE)
var timelineMetadata:TimelineMetadata = videoElement.getMetadata(CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) as TimelineMetadata;
timelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint);
private function onCuePoint(event:TimelineMetadataEvent):void
var cuePoint:CuePoint = event.marker as CuePoint;
trace("Cue Point at " + cuePoint.time);
I'm not getting any trace message at 1 second into the video?Okay, there is some things about the CuePoint Sample that don't quite make sense to me.
When I try to add markers to the dynamicTimelineMetadata, I keep getting "null" when I trace the dynamicTimelineMetadata.
For this event:
MediaElementEvent.METADATA_ADD
Is that triggered when a marker is added to the dynamicTimeLineMetaData?
Because if the dynamicTimelineMetadata is returning null,
then how can I add a marker to it? -
Flash CS5 dropping actionscript cuepoints
I've just upgraded from CS3 to CS5 and have discovered an annoying issue with cue points. When I open an existing FLA that has a movie with actionscript cuepoints and try to replace it with another movie (an updated version), Flash drops all my cue points and I have to re-enter them. Is there some way to prevent this?
The best way to preserve your cue points is to export the cue points to an xml file by clicking the "Export Cue Points" button located above the cue points. After you change sources to your new video, click the "Import ActionScript Cue Points" button and select the xml file you just exported.
-
Creating ActionScript CuePoints
I have ActionScript Cuepoints working fine by clicking on the
imported video instance and adding actionscript cuepoints. But we
keep getting new video and I have to put the cuepoints back in
every time. So I was hoping to add cuepoints and their times to
this script instead. Can I do that with the FLVPlayback? The script
is attached.yevri,
> I was hoping to add cuepoints and their times to this
> script instead. Can I do that with the FLVPlayback?
You can, and the FLVPlayback component makes it convenient by way of its addASCuePoint() method. (If you look up the FLVPlayback class entry of the ActionScript 2.0 Components Language Reference, you'll find this method.)
By the looks of it, your FLVPlayback instance name is vid, so assuming that's true, your code might look something like this:
var cue:Object = new Object();
// first cue point
cue.time = 2.444;
cue.name = "save";
cue.type = "actionscript";
vid.addASCuePoint(cue);
// second cue point
cue.time = 5.786;
cue.name = "americans";
vid.addASCuePoint(cue);
// third cue point
cue.time = 12.002;
cue.name = "howmuch";
vid.addASCuePoint(cue);
// etc.
I assume, for this example, that you're using ActionScript 2.0, based on the code you showed already. Notice that in my suggested code, I've
declared a generic Object instance named "cue", which is just an arbitrary name. The FLVPlayback component expects this cue point object to be
formatted in a certain way, which corresponds to the data you can alternatively provide with the Component Inspector panel; namely, the cue point needs a time value, a name, and a type (here, "actionscript"). In the code I've shown, I only set the .type property once, because it keeps the value "actionscript" until you change it. The other properties, .time and .name, are changed for each cue point, then passed into the FLVPlayback instance, vid, by way of the addASCuePoint() method.
You can follow this code by the cuePoint event handler you already have in place, and it works fine (just tested it here). Note, though, that you can *significamtly* reduce the complexity of your event handler by doing away with the repeated if() statements. Here's how:
> if (cues.info.name == "save") {
> slides.gotoAndPlay("save");
> }
By happenstance, it looks like you've matched the names of your cue points to the names of your frame labels. This is a really good thing! So really, you don't have to check what the .name value is (here, "save"), and then manually enter that same value ("save") into the gotoAndPlay() method. The value of the expression cues.info.name *is* "save", so you can just pass in the expression. Check it out:
vidList = new Object();
vidList.cuePoint = function(cues:Object):Void {
slides.gotoAndPlay(cues.info.name);
vid.addEventListener("cuePoint", vidList);
... and that replaces your numerous if() statements, because rather than checking the value and then typing it in by hand, you're simply passing that value into the gotoAndPlay() method. Does that make sense?
David Stiller
Co-author, Foundation Flash CS4 for Designers
http://tinyurl.com/dpsFoundationFlashCS4
"Luck is the residue of good design." -
I am tryin to use OSMF to play 4 videos that are divided into scenes using Navigation Cuepoints embedded into the f4v files using Media Encoder.
I also have a dynamic list of ActionScript cuepoints that is added for subtitling ( subtitles are done by another company and can't be embedded in the f4v because more subtitles may be added later).
When I just play a f4v file from the beginning everything works, but when I use seek tot start a different! video on a scene (so start seeking as the video canSeek) the embedded cuepoints never trigger the onCuePoint event.
The weird thing is that normally the embedded_cuepoints seem to be copied to the DYNAMIC_CUEPOINTS_NAMESPACE ! When trace numMarkers on timeLineData in EMBEDDED_CUEPOINTS_NAMESPACE it only returns cuepoints that have been reached! however numMarkers on timeLineData in DYNAMIC_CUEPOINTS_NAMESPACE returns the correct number of cuepoints.... but not when I use player.seek then teh DYNAMIC_CUEPOINTS_NAMESPACE return NULL
(this all happens even without adding teh actionscript cuepoints)
Can anyone shed some light?
Regards
PatrickHi Karan,
No! You cannot have a Static prompt that is a filtering source for the subsequent dynamic prompts.
Have a look at Patrick's workaround (and other workarounds) for filtering the prompts based on a Date Range here:
Dynmaic Cascading Prompts - Populate parameter prompt with only values in date range
-Abhilash -
Tried adding cue points via as3 code but haven't been able to find anyway to accomplish this task. Read allot places that when you load a video via netStream you can't add cue points with actionscript. The only way is to embed the cue points is into the video. But this is not an obtain for me since someone else does the videos and they may change or be modified at some time. I can add actionscript cuePoints with the FLVPlayback component but I am looking for ways of increasing video performace.
By the way what is the difference\advantage of using netStream over using the FLVPlayback component? Often wander this but haven't read anything to say one is better then the other when running video over the web.
ThanksThanks kglad. Being able to customize is always better in my flash world. LOL
I'll have to stay with the FLVPlayback component as long as I have to use cue points in my videos.
Thanks -
How to use cuepoint in audio files
Into a file .fla I have a file audio with cuepoints. I need
to read these cuepoints in flash (I use the MX 2004 version) to
manage some little animations into the stage.
It is possible to make this?
I have found solutions only for the .flv file but not for wav
or mp3 or others audio file... Why?
Help me pleaseSeems like this is exactly what you want to read:
http://www.adobe.com/devnet/actionscript/articles/cue_points_audio_print.html -
Hi all:
I'm trying to create a simple connection to my FMS sever
using actionscript 3 and the Flash 9 Alpha. The code below *kind of
works,* but I know it's wrong - I don't know where it's wrong, but
I know that it's wrong. I've been googling, reading the articles
here (state machine), and going through the AS3 cookbook, but I'm
this is the closest I can get by myself.
Any help would be really appreciated.
package {
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.defaultObjectEncoding.*;
public class VideoExample extends Sprite {
private var videoUrl:String = "1";
private var connection:NetConnection;
private var stream:NetStream;
//private function init():void{
// Create the NetConnection and listen for NetStatusEvent
and SecurityErrorEvent events
//nc = new NetConnection();
//nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
//nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
netSecurityError);
//nc.connect("rtmp:/myApplication");
public function VideoExample():void {
NetConnection.defaultObjectEncoding =
flash.net.ObjectEncoding.AMF0;
connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
connection.connect("rtmp://...videosource/");
private function netStatusHandler(event:NetStatusEvent):void
switch (event.info.code) {
case "NetConnection.Connect.Success":
connectStream();
break;
private function
securityErrorHandler(event:SecurityErrorEvent):void {
trace("securityErrorHandler: " + event);
private function connectStream():void {
var stream:NetStream = new NetStream(connection);
var video:Video = new Video();
video.attachNetStream(stream);
stream.play(videoUrl);
addChild(video);
}Found AS3 code on the Flex site, but it throws the following
errors on trace (video does stream, but this isn't working right).
Can someone please help?
=======
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
flash.net.NetConnection was unable to invoke callback onBWDone.
error=ReferenceError: Error #1069: Property onBWDone not found on
flash.net.NetConnection and there is no default value.
at VideoTest$iinit()
metadata: duration=570.2330000000001 width=796 height=536
framerate=30
package {
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.Event;
import flash.net.ObjectEncoding;
public class VideoTest extends Sprite{
private var videoURL:String = "1";
private var connection:NetConnection;
private var stream:NetStream;
public function VideoTest():void {
////NetConnection.defaultObjectEncoding =
flash.net.ObjectEncoding.AMF0;
connection = new NetConnection();
connection.objectEncoding = flash.net.ObjectEncoding.AMF0;
connection.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
connection.connect("rtmp://.../videosource/");
private function netStatusHandler(event:NetStatusEvent):void
switch (event.info.code)
case "NetConnection.Connect.Success":
connectStream();
break;
case "NetStream.Play.StreamNotFound":
trace("Stream not found: " + videoURL);
break;
private function
securityErrorHandler(event:SecurityErrorEvent):void
trace("securityErrorHandler: " + event);
private function connectStream():void
var stream:NetStream = new NetStream(connection);
stream.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
stream.client = new CustomClient();
var video:Video = new Video();
video.attachNetStream(stream);
stream.play(videoURL);
addChild(video);
class CustomClient
public function onMetaData(info:Object):void {
trace("metadata: duration=" + info.duration + " width=" +
info.width + " height=" + info.height + " framerate=" +
info.framerate);
public function onCuePoint(info:Object):void {
trace("cuepoint: time=" + info.time + " name=" + info.name +
" type=" + info.type);
} -
Triggering _root.play(); event with a cuePoint
Hey folks.
Let me start by saying I'm an actionscript novice. I'm a
designer and a timeline guy... I've been able to get by with
actionscript by cutting and pasting so there are some fundamentals
that I don't understand.
Now that that's out of the way, I need some help. I have a
flv in the flvplayback component, instance name roy. I've embedded
a cuepoint via the parameters panel named it continue. It occurs
about 2 seconds before the end of the flv.
The root timeline stops on the frame where the flvplayback
component is located.
All I need is for ActionScript to tell my root timeline to
play(); once that cuepoint is reached.
And surprise surprise... it doesn't work.
I would greatly appreciate any help. And please keep in mind,
I know very little about actionscript...Does anyone know if cue points can change the content being
called when the scrub bar is moved from end to end.
so let's say you have your embedded FLV playing along and at
cue point 1 you have slide 1 show, then at cue point 2 you have
slide 2 show.
That's all fine and dandy and exciting and users go ooooh and
aaaaah and you've just saved the world.
but then the user thinks to themselves, "hey, what did they
say about slide 1?" and at that point the most dreaded and feared
thing happens--they click the scrub bar and wrench it rapidly to
the left.
so what happens all ye powerful and omniscient Flash
Programmer Guru Video masters of the world gone yonder? does anyone
know?
I will buy the first person who can answer this question a
cold Extra Special Bitter Ale from Breckenridge, Colorado if you
come to Austin, Texas. -
Load streaming video at specific cuepoint - AS 3.0
Hello I have a video with 6 embedded cuepoints
(Chapter1-Chapter6)
All I want to do is load the video at a specific, in this
chase the one named "Chapter4" cuepoint.
Here is the actionscript 3.0 code I have so far (where
"player" is the name of the flvplayback component), which obviously
isn't working...
player.source = "rtmp://www.whatever.com/Youth.flv";
player.seekToNavCuePoint("Chapter4");
I am getting this error... VideoError: 1003: Invalid seek
Any advice on how to do this would be greatly appreciated...
Thanks in advance,
LeeI had the same problem. Dan Carr was kind enough to send a
reply. Here it is:
quote:
Getting stuck on the loading screen is a symptom that may
happen for a number of reasons.
The loading screen sits above the gallery and obscures the
screen while the thumbnails and screen assets are loading. The
loading screen stays in place until all the video thumbnails have
loaded - so what you're seeing is an issue where 1 or more of your
videos isn't loading.
Most commonly this is because the server isn't recognizing
the FLV mime type or one or more videos didn't get uploaded to the
path listed in the XMLfile. (Actually, the first time I saw
something like this it was because there were spaces in the video
file names - local playback worked as expected, but my server was
URL-encoding the file names which replaced the spaces with
different characters and broke the expected paths...)
I'd recommend that you do the following... In the FLA file,
select the white rectangle graphic on the "Preloading" layer and
make it invisible by turning its alpha to 0. This will allow you to
see which videos are not loading on the server. If none of the
videos load, this would hint that either the server isn't seeing
the FLV mime type, the XML file isn't loading, or there is a global
problem with file naming. (If you see all the labels on the
filters, you know the XML file loaded.) If most of the videos are
loading, look for the specific problem videos and check to see that
the naming is correct and that the files were uploaded to the
correct location.
My own issue, as Dan suggested, was that FLV wasn't
registered on the server.
Hope this helps others.
Paul -
URL Event cuepoints embedded in live flv stream
I would like to stream live flv files with on-the-fly embedded cuepoints to synchronize slide shows to the live stream
I use the function frequently on on-demand streams, but those are static xml cuepoint lists
I understand that it can be done. I read in the doucmentation that there are navigation and event streams embedded in the .flv, regardless of whether it's live or on-demand. I need a way to enter cue points at the encoder and to set a listener for them in the player. I know the url i will be calling for ahead of time, just not the time in the event that it will be called.
Thanks for your help..Charles,
Thanks for your response. Our use case seems is pretty basic. We have a live stream which will have cuepoints added at random times of the live encode. Additionally we want to retain the functionality for cuepoints added by actionscript to the dynamic timeline metadata The stream is h.264 and the encoder is inserting an in-stream callback for the cue point.
I know I can create a custom callback on the NetStream.client, but was initially investigating if they could/would be handled by current OSMF timeline processes. Another method I have thought of is to use different handlers for the embedded and dynamic timelines. MARKER_ADD events on the embedded timeline trigger an action immediately, rather than waiting for the MARKER_TIME_REACHED event.
Thanks,
Jeff -
How do I make a movie wait for a FLV cuepoint
I'm trying to synch a "talking head" FLV with some graphics,
so I simply want to get my movie to wait for a cuepoint to begin
playing again. I'm making it Flash 7 compatible, so I'm using the
older Media Display component.
Is there a "stop" and "wait for cuepoint" that would work? If
someone could give me the actionscript I should paste in the frame,
it would be greatly appreciated, since I don't really know
actionscript that well. Thanks.I'm sensing that you don't know much actionscript. If you
want to do much that is really fun and cool you will need to learn
some.
Start with the help files. Everytime you use a new component
or class go to the Actionscript Language Reference or the Component
Dictionary. Don't try searching it will generally only confuse you
more.
This next bit is going to sound silly, but the differences
are subtle and please take it in the manner it is offered.
When you say you'd like to pause at a certain frame you mean
a movieclip that you have, right?
If you check all the information about the FLVs and the Media
component you will find there is absolutely nothing that allows it
to make a movieclip pause or play. But if you check the MovieClip
class you will find there are the MovieClip.stop() and the
MovieClip.play() methods. These are the only ways to get a
movieclip to pause/stop and or play. There are no others.
So you have most of the answer there in your second post. It
is just worded a bit off.
You need a movie to pause (for which you will use the
MovieClip.stop() method) and when a cuepoint happens you will need
to start the movie using MovieClip.play();
If you check the MediaDisplay component directory there will
be sample code for how to listen for a cuepoint. I'm still using
Flash 7 so my help files are organized a bit differently, but what
you are looking for is under Media.cuePoint.
Notice the code at the bottom of the entry – READ the
whole entry, even if you don't understand it all now, read it,
outloud if it helps. You will need to have an instance of the
playback component on the stage (in this example it is called
myPlayback, but you could call it whatever you wanted, just make
sure that both names are the same.
I recommend trying this outside of your current project. Set
up a simple new document, put an instance of the playback component
on the stage, give it an instance name, assign an FLV to it, give
it a cuepoint or two, and then add the listener code, just as it
is. See how it works? Do you get the trace statements?
Then you can develop it a little further. Add some named
movieclip to your stage. Add a line myClip.stop(); Also notice that
you can give your cuepoints names? Put a few in and call some start
and some stop (or whatever you want.) Then instead of a trace in
the cuepoint listener have something that says, "If the cuepoint is
called start I should tell the movieclip to play and if the
cuepoint is called stop I should tell the movieclip to stop/pause."
I could easily write all this code out for you, but what
would be the fun of that for you? Give it your best shot and post
back as you accomplish things. -
Labeled Frame CuePoint Navigation
I have 2 systems with Flash 8 on them. On one system when I
try to use the FLV playback componenet and the Labeled Frame
CuePoint Navigation behavior I get an error code. When I take the
same file and use it on the other system it operates as it should.
I can't put my finger on what is different from one system to the
other. Can anyone give any insights? The error code experienced is
below:
**Error** D:\Documents and Settings\g4yr4y5\Local
Settings\Application Data\Macromedia\Flash
8\en\Configuration\Classes\FP7\Video.as: Line 18: The same member
name may not be repeated more than once.
function play(fileName:String):Boolean;
**Warning** Scene=Scene 1, layer=Layer 1, frame=1:Line 30:
There is no class or package with the name
'mx.controls.streamingmedia.behaviors' found in package
'mx.controls.streamingmedia'.
mx.controls.streamingmedia.behaviors.NamedFrameCuePointListener.initializeListener(this,
_parent, false);
Total ActionScript Errors: 2 Reported Errors: 2MichaelCo wrote:
> I am hoping to use a top middle and bottom frames page
with
> navigation bars in top and bottom frames - If I want to
make an
> addition to the navigation bar, can I set it up so that
I do not have
> to go back and change all previous pages. i.e. if I want
to add
> another button to navigation bar on bottom frame, will
it change the
> bottom frame on previously constructed pages. I hope I
am making
> myself clear MC
IMHO, if your concern is about "maintenance", you should use
flat pages
rather than frames and look into using external files:
http://www.tjkdesign.com/articles/maintenance.asp
HTH,
Thierry
Articles and Tutorials:
http://www.TJKDesign.com/go/?0
The perfect FAQ page:
http://www.TJKDesign.com/go/?9
CSS-P Templates:
http://www.TJKDesign.com/go/?1
CSS Tab Menu:
http://www.TJKDesign.com/go/?3 -
Hey
I'm currently working on creating a video player in Flash. Right now I am trying to figure out how use a cuepoint in the video to change the headline in the top fo the Player when cue point 1 is reached for example.
I'm really bad at actionscripting so thank you in advance.if flv_pb is your component reference, you can use:
import fl.video.MetadataEvent;
flv_pb.addEventListener(MetadataEvent.CUE_POINT,f);
function f(e:MetadataEvent):void{
for(var s:String in e.info){
trace(s,e.info[s]); -
I know this should be simple, but I'm an ActionScript novice
& can't work this out...
I've embedded cuepoints into an flv, and coded buttons to
seek to them. But, because I have autoplay set to false, clicking
buttons before setting the flv playing just goes to the cuepoint
but doesn't play. The feedback i've had from testing is "why don't
the buttons work" - people don't think to hit the "play" button as
well...
can someone tell me how to alter the code I have, to
incorporate a "play" command?
function cue1() {
var c = this._parent.my_flvPb.findCuePoint("tips");
this._parent.my_flvPb.seekSeconds(c.time);
seek_btn_1.onRelease = cue1;
Thanks, Matt.Should have worked this out earlier - all I needed was this:
function cue1() {
this._parent.my_flvPb.seekToNavCuePoint("tips");
this._parent.my_flvPb.play();
Maybe you are looking for
-
External hard drive not recognised in start up options
Hi! I'm struggling to get to grips with creating a bootable external drive - any advice would be very welcome! I've recently bought a LaCie Triple Interface 300GB external drive to use for backup storage and to use as a back up bootable drive should
-
Titles pixalated after burning my project
In Imovie 09 my project looks great on my mac but when i go to idvd and burn it, all the titles i have put in on imovie look really pixalated when i play them through my dvd player. ive even played it through a dvd player connected with HDMI and stil
-
IChat w/ Linksys WRT54G- insufficient bandwidth error
Hi, I am having trouble doing a video chat with iChat AV 3.1.5. Everytime I try to connect to a friend (using the same version of iChat) I get an error stating there is insufficient bandwidth. I have a cable modem connected over a linksys router and
-
Cs6 color picker current & below possible issue
Could somebody please try the following and let me know if they see the same behaviour? Create a Group, set it to Blend Mode Normal, with an empty Layer inside the Group selected and the Eyedropper Tool set to Current & Below try to pick a color from
-
Oracle Discoverer on windows server 2008
I'm looking for oracle Discoverer download on windows server 2008(32 bit). I tried looking on ORACLE.COM but I'm not able to find one. Can someone point me...