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."

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.

  • 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...

  • Converting MXML Components to ActionScript Classes

    I'm in the process of converting most (if not all) of my MXML
    components to Action Script classes. I've found this is easy, and
    doesn't require a lot of extra code when extending a simple
    container or control. However, several of my MXML components have
    several nested containers and controls - i.e. a component that
    contains several Labels, a ComboBox, a TextInput, a Button, and a
    DataGrid, plus several other containers needed for layout. To code
    the layout of all these containers and controls using MXML, it uses
    about 16 lines of code. To code the layout in ActionScript, it
    takes about 50+ lines of code (see attached).
    I'm just wondering if there are any best practices for
    creating ActionScript classes that include several (or even A LOT
    OF) containers and controls. It's very easy to layout in MXML, and
    is more visibly pleasing to look at and understand, but I feel it
    is best practice to code components as ActionScript classes. I know
    I should be using MVC, but it's a little late to rewrite the entire
    application now.
    Any thoughts?

    I can't specifically speak to how to write layout code in
    ActionScript, but you can look at the generated code that Flex
    creates to get an idea of how Flex does it. When you compile an
    app, the Flex compiler takes your MXML input and converts it to
    ActionScript classes before compiling the entire set of classes
    into a SWF. Because of this, you can look at the interim
    ActionScript code.
    You do this by setting the keep-generated-actionscript
    compiler option to true and looking in the /generated directory.
    hth,
    matt horn
    flex docs

  • Osmf:use both embedded cuepoints and dynamic quepoints and using seek fails,is it possible at all?

    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
    Patrick

    Hi 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

  • Actionscript for mobile

    Does any one have any good links they can spare with good (pererably video) tuts ect on starting with AS fro mobile within FB rather than flex, I can make a start but it woudl be nice to find out the stuff regarding mobile specific items such as touch, gestures, lists, creatign view effects etc that flex does without blinking, any thing woudl be great
    thanks
    Si

    Well I gatehr there are no tuts out there for creating Actionscript Mobile Projects?

  • Swf won't load on web but ok locally (believe only video playback issue)

    Hi all,
    I am very new to flash....literally first day into it.
    I converted a mov into flv and imported the flv with playback component. When I publish, I am able to see both (via the swf and the html) from my browser. Once I uploaded the swf and html onto my webserver (both files are stored in the same folder just like how I had it locally), the swf won't display the video.
    Now, I have a button (when clicked, it skips the playback and go directly to the site) and the button works fine. So, I think it is only limited to the video playback.
    Any help appreciated.

    Hi Ned,
    I was just fiddling with it and it seems to be working now.  I think your advice of putting the flv there helped?!?! Thanks a billion!
    http://www.astoryconcept.com/index1.html
    The only minor issue that I need to fix and not sure how yet:
    -it stops during the initial playback (I guess my flv is a little large 4mb and I might have to optimize it to a smaller file)
    -it didn't center itself when I drag the browser larger/smaller
    Now that it works, I want to see if I could optimize it. Wandering if there is a "BETTER/EASIER" way to take me to a url at the end of the video playback.
    What I did in here:
    I created a cuepoint at 23 second (that's the end of the video) and it will take me to a url (here: adobe.com). Below is the actionscript I had in there (using code snipper) [One is for "Skip Intro" that will bring me to cnn.com; and the other one is the cuepoint that will take me to adobe.com):
    ================================================================
    /* Click to Go to Web Page
    Clicking on the specified symbol instance loads the URL in a new browser window.
    Instructions:
    1. Replace http://www.adobe.com with the desired URL address.
       Keep the quotation marks ("").
    skip_intro_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
    function fl_ClickToGoToWebPage(event:MouseEvent):void
    navigateToURL(new URLRequest("http://www.cnn.com"), "_blank");
    /* On Cue Point Event Handler
    Executes the fl_CuePointHandler function defined below each time a cue point is passed in the specified video instance.
    Instructions:
    1. Add your custom code on a new line after the line that says "// Start your custom code" below.
    The code will execute when cue points are reached in a video that is playing.
    import fl.video.MetadataEvent;
    video.addEventListener(MetadataEvent.CUE_POINT, fl_CuePointHandler);
    function fl_CuePointHandler(event:MetadataEvent):void
    // Start your custom code
    // This snippet code displays the cue point's name in the Output panel
    // trace(event.info.name);
    var url:URLRequest = new URLRequest("http://www.adobe.com/");
    navigateToURL(url);
    // End your custom code

  • Not able to access the mx.controls package

    hi,
    i found a weird issue. I'm developing my application
    entirely using actionscript 3 by creating "actionscript Project' in
    the flex builder. I need to use the ColorPicker component which is
    under mx.controls package, but to my disappointment i'm not able to
    access that mx.controls package and when i forcefully use it the
    compiler throws me an error, but when i create a new flex project
    and create an asctionscript file, i'm able to access that
    mx.controls package and also the ColorPicker class. Can anyone tell
    me what the problem is?
    Thanks,
    Shajahan

    I am having the same issue. I'm using Flex 3 and I cannot
    access the mx.controls package in any actionscript project.

  • Flash CS5.5 professional English how to display error messages in english

    I created actionscript code and when testing the movie, there appears an error:
    ArgumentError: Error #2025: Podany obiekt DisplayObject musi być elementem potomnym elementu wywołującego.
              at flash.display::DisplayObjectContainer/removeChild()
    Is it possible to set Flash to display all messages in English? (my Flash language version is English)

    The messages should be in English if your version is in English.  You should try contacting Adobe Technical Support directly... these are primarily user-to-user forums.

  • Start to build my first flash website

    I've learned actionscript form resources like video and
    books. i read some serious tutorials and did many practices and
    small projects. I'm trying to build my first flash website. do i
    need to learn Flex? or anything else? do i need to study some other
    courses? My problem is where to start. what's a structure of a
    professional and serious full flash website? links? components (if
    any)? and ... yes i've worked on small swf files. creating
    actionscript effects, building some easy components before but i'm
    sure they are not enough. and one more thing! is there any good
    practical (and specially free!) tutorials based on this concept?
    (i've already reviewed actionscript.org and kirupa.com, thx!)

    Your first question: subjective to your skillset. http://Zen-Cart.com has their own tutorials/FAQ/Forum that has plenty of information on the subject. Make your determination from the information they provide. It's free... download it and try it yourself to find out, perhaps?
    Second question: you would not build additional product pages. There's only one product page that is populated with data from, wait for it... you guessed it, a database. If you're unfamiliar with working with database data then familiarize yourself with it if you wish to work on dynamic shopping carts.
    I recommend http://Cartweaver.com if you want to work in Dreamweaver on the design and coding of the cart. It is very easy to implement your design into a cartweaver shopping cart.

  • AS3 Project in Flash Builder

    Hi I am an experienced AS3 developer working on a Mac, been working in the CS4 IDE and using Textmate for html, PHP etc. I am very keen to use Flash Builder IDE to build my AS3 projects. I have been able to create actionscript projects but when I try to incorporate FLA and the library assets in FLAs I get stuck.The way I want to work is to use CS4  for creating graphics, timeline animation, so when I run the project it compiles the fla and scripts as if I was in CS4 ide.
    So my question: Is there any good tutorials or sites that can guide me thru setting up an Actionscript project in Flash Builder and manipulation of stage, timeline and library assets from an FLA?

    Firstly flashbuilder doesn't use a timeline, it can use assets in a CS4 compiled flash file, but knows nothing about the fla format. A good starting point would probably be to down load the tour deflex which has a lot of  flex examples with the source.
    http://www.adobe.com/devnet/flex/tourdeflex/
    there is also the cookbook page
    http://www.adobe.com/devnet/logged_in/esullivan_cookbook_20.html
    this is a great site for resources when you run into problems
    http://blog.flexexamples.com/
    Adobe also have a lot of video tutorials which are great to get an idea of just how Builder works.
    David.

  • Re-Using Java Business Layer in Flex

    I am new to flex and particulalry looking at this to use as front end for existing Web based Java Application as front end. We have comprehensive business layer written using POJOs and DAOs and want to reuse it. I will be using remote objects to call servr side code and return domain objects (models/POJO). As per my understanding to use the strict typed data such as objects of business classes i have to create ActionScript class and bind it with corrosponding Java class. This looks lots of code duplicaiton to me.
    Can you please guide me if my understanding are wrong or i'm missing something. Is there better way to acheive the above?
    Thanks in advance.

    HTTPService can call HTML pages, so maybe Tapestry would work?
    Have you considered using JSON to format the object data?
    These lins describe using JSON and Flex:
    http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
    http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
    http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
    If this post answers your question or helps, please mark it as such.

  • Code Errors Not showing in 4.7 FlashPro Projects

    Just installed 4.7 and my existing and newly created FlashPro projects don't show code errors. Here's the same test class in 4.7 and 4.6. Anyone else seeing this or is there a pref I'm missing:
    Doesn't seem to be a problem with a newly created ActionScript project, this is in 4.7:

    This is not good. It should not display not data but
    "No interface IN Errors occurred in the last 1 Hour"
    It is amazing to think the utilization polling would work but the error polling would fail.
    Try perhaps stoping and restarting the pollers.
    Cheers,
    Michel

  • Counting the files in an image folder

    I have created a target_mc that loads images based on the
    frame number of the timeline. loadMovie(imageFolder + imageType +
    _currentFrame)
    imageFolder and imageType are variables that are set on a
    navigation menu item roll over. _currentframe pulls the current
    frame number. Combined, they make up the name of the image.
    The slideshow navigation buttons (forward and back) move the
    playhead and the images are loaded based on the position of the
    framehead. Frame 1 = image01.jpg etc.
    What I want to do is create actionscript that reads a folder
    containing the images and counts the number of files. Then I could
    store that number in a variable and use some actionscripting to
    load the images into the target_mc.
    Any ideas? The problem I have is when a new image is added to
    a slideshow movie clip I have to insert a frame or when a pictures
    is removed I have to remove a frame from the timeline for that
    clip.

    > What I want to do is create actionscript that reads a
    folder containing the
    > images and counts the number of files. Then I could
    store that number in a
    > variable and use some actionscripting to load the images
    into the target_mc.
    No such thing, flash has no system accessibility and it can't
    read folder content.
    You need to do it with some middle ware like php or asp.
    > Any ideas? The problem I have is when a new image is
    added to a slideshow
    > movie clip I have to insert a frame or when a pictures
    is removed I have to
    > remove a frame from the timeline for that clip.
    The problem is with your design. We normally don't hard code
    and hard built
    movies like that. Driven dynamically by XML is your best
    choice. It gets the
    info, makes the slide in real time based on input. All you
    need to do than
    is modify the xml file, not flash.
    Anyhow, here is an example of flash reading folder content
    using php.
    (inside the zip file you will find asp sample as well)
    http://flashfugitive.com/stuff/tree/dirtree.swf
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

Maybe you are looking for

  • Yoga 2 Pro, Etekcity 16Ah power bank and some additional measurements

    Hello guys, this would be my short review of Etekcity Wingman external battery I use with y2p. As you know, the y2p battery performance is a little disappointing for a Haswell ultrabook (at least for some), so it's a good idea to have some additional

  • Need help with moving files into Itunes and syncing

    Please help. I have an external hard drive with my music on it.  I created a new playlist in Itunes and did a drag and drop from my external hard drive into my newly created playlist.  Now that I go back and play the items I brought over, I get an er

  • How Do I Change My App Store Username????

    When i got my iPad i set it up with my itunes username, which was a AOL account. i since changed my itunes account to use my apple id. when i purchase or try to update apps on my iPad, i have to enter a password. the AOL account that i originally set

  • My CC account is still on trial after purchasing a Month to Month

    after login in may CC acount -> https://creative.adobe.com/ it still shows the blue UPGRADE button and a 2GB space even if under my PLAN INFORMATION shows: Account Status:    Month-to-month plan    All of my installed application is still on trial an

  • Planned order CIF blocks

    Hi,        This is continuation of my previous [post|No IModel active for cat. Planned Orders] I am getting the CIF blocks starting with CFIP00... and these are from the program,/SAPAPO/RDMCPPROCESS, that collects and pushes the orders to R/3. Now th