FORUMS: list search recent posts

AS3 How to navigate to a certain CuePoint

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Frank Wichert
AS3 How to navigate to a certain CuePoint
on Oct 21, 2010 at 12:49:37 am

Hi all,

I'm searching the web for hours and days as well as the Adobe Help and Docs, but I do not find any answer. Could you provide some help, please?

Problem is following:
I have two .flvs containing navigation cuepoints. If in vid1 a cuepoint is reached vid2 should goto the next cuepoint and stop. (BG: vid1 is the video of a speaker, vid2 are the slides of the presentation, if I skip by clicking a button it should also skip presentation to keep it synchron) (forgive me my bad english)

Im getting more and more confused with onMetadataEvent and onCuePointEvent, what's the best way to bring it all to a dvd in the end. NetStream or FLVPlayback? Using NetStream I cannot use Eventlisteners to check the appearence of a cuepoint (is that right?).

I have the following code with NetStream so far:

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.play("../Test_Flash/Footages/Test1.flv");
function asyncErrorHandler(event:AsyncErrorEvent):void
{
// ignore error
}

var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid.x = 552
vid.y = 132

var nc2:NetConnection = new NetConnection();
nc2.connect(null);

var ns2:NetStream = new NetStream(nc2);
ns2.client = this;
ns2.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns2.play("../Test_Flash/Footages/Test2.flv");
function asyncErrorHandler2(event:AsyncErrorEvent):void
{
// ignore error
}

var vid2:Video = new Video();
vid2.attachNetStream(ns2);
addChild(vid2);

vid2.x = 0
vid2.y = 132



function onCuePoint(infoObject:Object):void
{
ns2.seekToNavCuePoint(point1);
}

Questions are: How can I tell the function just to "listen" only to CuePointEvents of vid1? And:
How can I tell ns2 to go to a certain CuePoint? seekToNavCuePoint doesn't work! I'm just able to pause and play the ns2 (vid2)...

btw: I'm using Flash CS4 and imported the NavCuePoints with PremiereProCS4 (and checked them with MediaEncoder and Flash, they're there!) Cuepoints are named CP1, CP2... in vid1 and poin1, point2... in vid2.

Thanks a lot for any help you can give.

Frank


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 21, 2010 at 3:49:47 am

there are 2 types of cue points: navigation type cuepoints, and event type cuepoints.
navigation cue points are used to seekto ( go to ) those point(s).
event type cuepoints are used to trigger events(functions) when they are reached.

one can't be used for the other.

to simplify it, let's use a FLVPlayback component for now and forget about NetStream.

a FLVPlayback is given a listener to listen for a MetadataEvent. the cue points are embedded in and passed along with the flv's metadata. other ways can work, but the fail safe way to embed cue points is by using the Flash Media Encoder.

so now just write the code that tells your first FLVPlayback to listens for the cupoint, and to trigger a function which tells the 2nd FLVPlayback to seek to its cuepoint and play.

i know this didn't answer all your questions, but it should get you started.

simplest scenario - there are 2 FLVPlayback components, with the instanc names of 'flvPlayer1' and 'flvPlayer2" . vid1.flv has an Event Cuepoint named 'cue1' and vid2.flv has a Navigation Cuepoint named 'cue2'.

this code will then make vid1's cupoint rigger vid2 to play at its cuepoint:
import fl.video.MetadataEvent;

flvPlayer1.source="vid1.flv";
flvPlayer2.source="vid2.flv";
flvPlayer2.stop();

flvPlayer1.addEventListener(MetadataEvent.CUE_POINT, jumps);
function jumps(evt:MetadataEvent):void{
if(evt.info.name=="cue1"){
flvPlayer1.stop();
flvPlayer2.seekToNavCuePoint("cue2");
flvPlayer2.play();
}
}


hope this helps. cuepoints can a first seem tricky, but they do make sense, and are a great tool to work with. i am not a big fan of ActionScript cue points, i prefer to always use embedded cuepoints - which are also more accurate.

tip 1- be careful in your coding. if your navigation cuepoint's name is : point1 , then it needs to be written within quotes when using seek to : ns2.seekToNavCuePoint('point1');

tip 2- if you did set the Nav cue points from PremiereProCS4, once brought into Flash Media Player, you can convert the Cue Point type to Event type. can Premeire export Event type cue points ?? ( i'd like to know as i don't use Premeire)


Return to posts index

Frank Wichert
Re: AS3 How to navigate to a certain CuePoint
on Oct 21, 2010 at 10:28:07 am

Hello Demetri,

Thank you very very much! This helped me really.
It works. I just had to render the .flv new to change cuePoints from navigation to event, 'cause I didn't find how to change (just to disable) in flash.

Now I just have to write lots of functions to link each cuePoint to the one of the other video. But that's ok in the first step. I will refine this later when if've got the time.

And I will have to find a solution with NetStream, because these are several hours of video so that the projector.exe will be very big, I guess...

To answer your question: Yes its possible and very comfortable to set CuePoints in PremiereProCS4. Just set a marker at the point you want doubleclick and enter options like Name,Parameter, Type(evt or nav) and Time (which is not neccesarry, because it is at the time you selectet in the timeline, but you can adjust framewise if you want to)
Rendering the file with AdobeMediaencoder gives you the possibility to check and/or rework those cuepoints, and all details are passed to the .flv.

Thanks again, you showed me a way out of the dark;-)
(into the next tunnel which is on my way to a flash-pro...)

yours

Frank


Return to posts index


demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 21, 2010 at 2:00:07 pm

glad it is working now for you - now comes the 'drudge' work of finishing he code !

thanks for the info on Premiere. it is good to know that it can embed both types of cue points.


Return to posts index

Frank Wichert
Re: AS3 How to navigate to a certain CuePoint
on Oct 22, 2010 at 10:07:24 pm

Hello Demetri,

Sorry to bother again. But as I want to refine the code I'm wondering abaout a certain line:

if(evt.info.name=="cue1"){

Could you please tell me what that means?
Background is, that I want to do a "for loop" to save the time writing a new function for each cuePoint's name. I want to replace the value of "cue1" (which is meanwhile renamed to just "1") by a variable.
But I cannot find out how to because I don't even have a clue what kind of data this is.

My last try was a code like this:

var n:int;

for (n=1; n<100 ; n++)
{
vid1.addEventListener(MetadataEvent.CUE_POINT, jumps1);
function jumps1(evt:MetadataEvent):void{
if(evt.info.name==n){
trace (n);
//vid2.seekToNavCuePoint(n);
vid2.stop();
}
}
}


The NavCuePoints where also renamed o'corse. But this doesn't even give me a trace, so I assume that it's not that simple.

I've even tried to create a Object, but as I'm very new to oop at all it didn't work...

If you could be so good to give me again a helping hand and a hint.

Thanks

Frank


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 22, 2010 at 11:30:26 pm

I'm wondering abaout a certain line:

if(evt.info.name=="cue1"){

Could you please tell me what that means?


"cue1" was the name of the cue point - the event cue point , so
the video player component named 'vid1' has an event listen that is listening for a CuePoint Metadata event. remember that the cue point is embedded in the flv, so it is part of the metadata that is sent along with the video file, as it reaches an event ( coming across a new or next cue point for example), the function is asking it " if the name of this event ( that is, the cue point...) is named 'cue1', then perform what is next in the function". that is how you read that part of the code.

i question your wanting to use a for loop. if the variable 'n' supposed to be cuepoints named 1, 2, 3, then are all these in the same video ? if so, then you probably want an 'if' statement/conditional, or a more readable 'switch' conditional statement to say" if the event is named '1' , then do this, if the event is named 2, then do that, if the event is named 3, then do such-and-such.

something like this:

vid1.addEventListener(MetadataEvent.CUE_POINT, jumps1);
function jumps1(evt:MetadataEvent):void{
if(evt.info.name=="1" || evt.info.name=="2" || evt.info.name=="3" || evt.info.name=="4" ){
trace (evt.info.name);
}

}


but if you were to use the 'for' loop, you should type cast the variable as either a uint or int , so the compiler knows to expect a number when it sees the variable 'n'

for loops are usually used with arrays, so you would declare an array with all your cuepoint names var nArray:Array=['1', '2', '3', '4']; and use the for loop inside the function:

var nArray:Array=['1', '2', '3', '4'];

vid1.addEventListener(MetadataEvent.CUE_POINT, jumps1);
function jumps1(evt:MetadataEvent):void{
for (var n:uint = 0; n<nArray.length; n++){
if(evt.info.name==n){
trace (n);
}
}



i hope this helps as i am now unsure as to what you are trying to achieve. what i thinkyou are wanting is a video player to play video 1 which has 100 cuepoints, and every time it reaches a cue point, it triggers video player 2 to play video 2 from the same cuepoint name. is that right ??


Return to posts index


Frank Wichert
Re: AS3 How to navigate to a certain CuePoint
on Oct 23, 2010 at 7:58:18 am

Hello Demetri,

That's right. But actually I don't know how much cuePoints are in the videos, yet. Perhaps I have to explain a bit better:

There was a conference of my company where we did video of the speakers and I want to produce a dvd where this video is shown. As we do have just the speaker in this vid1 I converted the presentations of each speaker into a video (vid2).
I used CuePoints in vid1 (EventCues as you told me) when the speaker goes too the next slide. (And NavCues in vid2 at the point where this slide is.)
I want the user to be able to use the navigation buttons (either of flvPlayback or own - I have to deciede later) to navigate through the video. As the conference had three days of presesntations with different lenghts and different numbers of charts/slides I dont want to write a function for each cuePoint"x" in vid1 to call cuePoint"x" in vid2. I thought it should be possible to write something like 'if in vid1 MetadataEvent.name==var then in vid2 gotoCuePoint.name==var'
Shure this is no code, but to tell you my intentions.
btw. I made NavCues in vid1 which are 5 frames infront of the EvtCues, so that if the user navigates by clicking the the skip buttons to a cuePoint shortly after he reaches the EvtCue and the onMetadataEvent can be triggered.
And as there are three days of video I thought of using netStream in the beginning. But that's ok, I will split it in different .swfs...
I hope it's better to understand now.

I thought to use if-loop because the possibility to navigate backwards is given and vid doesn't go forward only.

What I was wondering was: Which type has the info.name? unit, int, string, number? I didn't find in FlashHelp that the MetadataEvent has a parameter that is named info.name...

The n<100 was just to tryout the trace. As I cannot know how often the user steps back and forth I don't know how many EvtPoints will be reached, so I have to read out vid1.EvtPoint.name to a variable a and pass it to the function seekToNavCuePoiint(a);

Thanks very much again for your time and patience. You did help me a lot, yet. And I will now test a bit with the results of your last post. I think it could work with unit...

Thousand thanks

Frank


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 24, 2010 at 4:42:34 pm

hi frank,

working from your scenario, here are some random thoughts and questions:

you say are publishing to a DVD to distribute. Are you expecting that this is a auto-run DVD to play in DVD players/TV sets, or it this going to made as a data only DVD for use in computers?

i am assuming it is going to be a computer disk, and it is on a DVD because of the large files needed to be there. are you compressing your video to optimize file size vs playback quality for viewing on their screen?

so different speakers will all be gathered on video1 while their presentations are gathered on video2 ? are the presentations static ( like powerpoint slides ) or are they actual videos? because you might be better off having each presentation as a movie clip symbol ( or external swf) that can be loaded in as triggered by the event cue-points in video 1. just a thought..

event.info.name is a STRING. the cue point name is a String embedded in the metadata.

you should have at least a nav and a coresponding event cue point in video 1 for each segment/speaker. video 2 needs at least a nav cue point and also an event cue point ( if you want a 'stop' after each presentation)

then using an array of the vid 1 event cue point name( = vid 2 nav cuepoint name), you can then, with the addition of 2 variables - 1 as a uint to use for a counter and another as a boolean check, keep track of your chapters/speakers and their presentations, whether video 1 just plays by itself, or the user clicks through it with a next/previous buttons., it just takes some specific logic to keep track of it. an 'if' conditional statement would be used, but a loop is not needed. of course, as always, there are different ways to acheive the same ends. **

these are the kinds of logic situations i regularly tackle for clients. i've already developed projects like this. maybe if i find some extra time i will post a working example of this type of project if there is still interest.

i hope this further helps your thinking about how to lay this all out.

-demetri-

** for instance, you can use imported classes like "fl.video.CuePointType" which combined with the MetadataEvent can tell you exactly what the name and type of the cuepoint event is, and then that info can be passed along to the 2nd video player. this is not 'wrong', but it involves extra steps, and therfore processor usage ( which is another reason why to try to avoid loops if possible). if i have a choice i always try for the simplest way possible.


Return to posts index

Frank Wichert
Re: AS3 How to navigate to a certain CuePoint
on Oct 24, 2010 at 5:16:07 pm

Hi Demetri,

thanks again for all your help.

You're right, it will be a DVD for computers only, due to the ammount of data.

The presentations actually are PowerPoint. And you are absulutely right, that I should not convert them to a video to import them into flash. But I didn't even think that there is a way doing it otherwise. Thanks for that hint.

I will try my best to figure out the code that works. (Due to your help, I guess I can do it).
The interest for your code is still there, even when the project is finished, at least for learnings sake. But as I know (or at least assume;-)) that you have to do some work to earn some money please do not stress yourself. You helped me a lot so far and I'd like to thank you again.

I guess I do understand a bit more about as3 and oop at all.

Frank


Return to posts index


Frank Wichert
Re: AS3 How to navigate to a certain CuePoint
on Oct 25, 2010 at 6:41:48 pm

Hi Demetri,
and all who have or will have the same Problem.
I figured out a working code.

import fl.video.MetadataEvent;

vid1.source="footages/Test_NavPlain1.flv";
vid2.source="footages/Test2_plain.flv";
vid2.stop();

vid1.addEventListener(MetadataEvent.CUE_POINT, jumps);
function jumps(evt:MetadataEvent):void{

var u:String = (evt.info.name);
vid2.seekToNavCuePoint (u);
}


vid1 is the speaker and contains just Navigation CuePoints with the names "1", "2", "3" ..
vid2 is (at the moment) a video with the slides of a presentation and NavCuePoints in it with the same names ("1", "2", "3"...)

starting the .swf gives you the tha ability to see the video1 and when a CuePoint is reached it makes vid2 to jump to the cuepoint with the same name as vid1's point.

Furthermore the user has the chance to jump to next or previous cuepoints by clicking the skip buttons of the built in flvPlayback controlls.

Thanks a lot once more for all the help and assistance.

Frank


Return to posts index

Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Oct 28, 2010 at 12:16:30 pm

Hi

firstly i want to say thank you for this thread it has helped me understand cue points a bit better.

I am currently seeking some advice concerning cue points.
Lets say that i have an flv playing and want to interact with the cue points but i want the flv to first reach the end of one cue point then direct it to another.

In other words what i would like to achieve is an interactive film experience. So basically i have one flv with cue points. Then at a certain cue point i load a button that runs down (acting as a timer). then i want the viewer to be able to select an option but i don't want the trigger to happen instantaneously. I want the flv to first finish playing the cue point and then when it is finished decide what the users input was and then skip to the cue point that is relevant.

i'm kinda new to AS3, i think the approach would be something like a if statement with a variable that is link to the button.

if( x=1 && cupoint)
{
gotoAndPlay (cueName);
}

i apologize if the syntax is incorrect.

Is it possible that you could help me with the syntax for the example that you used in order to achieve my desired effect?

Kind Regards


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 28, 2010 at 3:52:09 pm

hi luke. if you've reviewed this and the and the other recent threads about cue points then you understand there are 2 different types you can embed : event type cue point to trigger events, and navigation type cue points to let you seek to ( scrub to...) that location

so i would think you need cue points embedded/placed in this sequence/configuration :


(Nav1).(Ev1a)....................(Ev1b).(Nav2).(Nav2a)....................(Ev2b).(Nav3).(Ev3a)..............EV3b.

where Nav1 allows you to seek to the first section. immediatetly after that is Event 1a cue point which would trigger this function:

- your countdown clip starts, and also, if i understand you correct, it also triggers some buttons to appear to make a next selection. clicking one of those buttons triggers another function:

- the button click is stored as a variable "buttonclicked"

then it keeps playing until it reaches Event1b, which trigges this function:

- this is either a stop, and/or it directs it to jump to(seek to) "buttonclicked" which is the navigation point coresponding to the button that was selected.

that is certainly one logical way to set it up. these threads have working code examples you can follow for the correct coding syntax.

i hope this all makes sense and helps.


Return to posts index


Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Oct 28, 2010 at 6:09:36 pm

I cant thank you enough for the quick response.

I will most certainly get to work on this asap.

Kind Regards


Return to posts index

Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Oct 29, 2010 at 1:02:56 pm

again thanks for your help.

anyway you mentioned that i should use embedded cue points or nav cue points, i assume you are not referring to cu points i must add in AE. or should i?

the senarion is as follows; i have a white circle that fades in and when at 100% opacity is where you should have made a choice already. so the next part is that you can choose between green and red. they also fade in. thus if you dont make a choice it just fades the white circle out.

i understand the logic that you have shown me, but i still cant figure out how to create the event listener that only acts at the end of the certain cue point. i know this might be an easy solution for you, but it feels like a mountain i just cant get across.


here is the code:

import flash.events.*;
import fl.video.*;

//-----------------
// Video control assignment
//-----------------
// Use the skin assignment properties of the FLVPlayback
// instance to associate the controls with the player.

display.playPauseButton = play_btn;
display.stopButton = stop_btn;
display.seekBar = seek_bar;
display.volumeBar = volume_bar;
display.muteButton = mute_btn;
display.fullScreenButton = full_btn;


//-----------------
// Video event handling
//-----------------
// Create an event handler function to catch the
// cue event from the FLVPlayback instance.


function cuePointHandler( event:MetadataEvent ):void
{
// On cuePoint, look for a button named with the cue name
// plus "_btn". If it exists, then call its select method...
navigate(event.info.name, false);
}


//-----------------
// Navigation / screen state
//-----------------

// Store the current button name
var currentBtn:*;
var currentBtnName:String = "";

// your buttons in the library

function navigate( cueName:String, seekTo:Boolean ):void


{

// Handle previous button
var prev = getChildByName(currentBtnName);
if( prev != null ){
currentBtn.reset();
}
// Handle new button
var next = getChildByName(cueName+"_btn");
if( next != null ){
currentBtn = next;
currentBtn.select();
currentBtnName = cueName+"_btn";
}
// Seek to Cue Name
if( seekTo == true ){
var c = display.findCuePoint(cueName);
if( c != null ){
display.seekSeconds(c.time);
}
}
}

//-----------------
// Button event handling
//-----------------


// start_btn
function startHandler( event:MouseEvent ):void
{
navigate("navS", true);
}
start_btn.addEventListener(MouseEvent.CLICK, startHandler);

// white_btn
function whiteHandler( event:MouseEvent ):void
{
navigate("navN", true);
}
white_btn.addEventListener(MouseEvent.CLICK, whiteHandler);

// green_btn
function greenHandler( event:MouseEvent ):void
{

navigate("navG", true);
}
green_btn.addEventListener(MouseEvent.CLICK, greenHandler);

// red_btn
function redHandler( event:MouseEvent ):void
{
navigate("navR", true);
}
red_btn.addEventListener(MouseEvent.CLICK, redHandler);



so finally i would like to ask you if you could maybe help solve this tiny problem that i have. if you could give me an example of a piece of code i would jump up and down with joy.

Kind Regards


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Oct 29, 2010 at 5:22:45 pm

hi luke-

i think the answers did lie in previous posts. but never-the-less, if you do have your video set up with this configuration of cue points:

(NavN).(EvNa)....................(stop).(NavG).(NavGa)....................(stop).(NavR).(EvRa)..............(stop).

then code like this should make it work. note that this code was written in the browser, so it was not tested for erros:

var currentBtnName:String="";

// these buttons need to be in the display list before adding these listeners
white_btn.addEventListener(MouseEvent.CLICK, btnHandler);
red_btn.addEventListener(MouseEvent.CLICK, btnHandler);
green_btn.addEventListener(MouseEvent.CLICK, btnHandler);

function btnHandler( evt:MouseEvent ):void {
switch (evt.target.name) {
case "white_btn" :
currentBtnName="navN";
break;

case "red_btn" :
currentBtnName="navR";
break;

case "green_btn" :
currentBtnName="navG";
break;
default:
currentBtnName="navN";
}

}
// assuming of course that your video player's name is 'display'
display.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);
function cuePointHandler( evt:MetadataEvent ):void {
if (evt.info.name=="EvNa"||evt.info.name=="EvRa"||evt.info.name=="EvGa") {
/* code to make white_btn, red_btn and green_btn appear. either by visible=true or maybe
they are added ( addChild) from the library... */
}

if (evt.info.name=="stop") {
display.seekToNavCuePoint(currentBtnName);
}
}


hope that helps you out


Return to posts index


Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Oct 29, 2010 at 6:35:39 pm

I never considered a switch.

I'm going to give it a try and get back to you.

thanks again for your time.

kind regards


Return to posts index

Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Nov 1, 2010 at 9:32:55 am

hey demetri

your code produced a weird error something like error:1003 and a long list of adobe references. anyway i finally got it to work

here is the code


//note this is only for one cue point, but the principle is the same

import fl.video.MetadataEvent;

var btn:*;
removeChild(btn);

myvideo.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);

function cuePointHandler( evt:MetadataEvent ):void
{
if (evt.info.name=="cueA")
{
addChild(btn);
}

}

btn.addEventListener(MouseEvent.CLICK, startHandler);

function startHandler( event:MouseEvent ):void
{

myvideo.addEventListener(MetadataEvent.CUE_POINT, cuepointfound);

}

function cuepointfound(myevent:MetadataEvent):void
{

var c = myvideo.findCuePoint("cue3");


if (myevent.info.name=="cue2" && c!= null )
{
removeChild(btn);
myvideo.seekSeconds(c.time);


}

}



now i need to just figure out little kinks to fluff up my concept and implement my film.

unfortunately the switch function i still dont get, but i will figure it out if i need to clean the code.

there is just one little thing that i just cant figure out, if at all possible would you mind taking a look. if the person does not make a decision i want to code it to pick a random button to pick a random button. i have look at the eventHandler functions to figure out if their is something like if no event then do something or noclick do something, but unfortunately im stuck. any guidance here?

i experimented with removingChild in this piece of code to see whether it can be dont removed here but then i get the error:1003 if the user has not clicked the button:

function cuePointHandler( evt:MetadataEvent ):void
{
if (evt.info.name=="cueA")
{
addChild(btn);
}
// else { removedChild(btn);}
}


if i can figure out the random button thing the above code will not require the removeChild function. because once you click the button the removeChild function works fine in the cuepointfound function.
so actually the above code is more of an example of where not to put the removeChild().

i would just like to thank you for helping me out once again. your help has proved invaluable to me. and i will definitely refer my peeps to creative cow, awesome resource and awesome response time on the forums.

kind regards


Return to posts index

Luke Carelsen
Re: AS3 How to navigate to a certain CuePoint
on Nov 2, 2010 at 12:30:59 pm

MyBad

I meant that the code above is for one button only not one cue point.

Hope this helps someone out when in a pickle.


Return to posts index


demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Nov 2, 2010 at 2:20:13 pm

hi luke-

of course you will get errors if you are saying to remove something ( removeChild(btn) ) if it is not placed/added to the display list yet....


if you want a random button choosen , you might consider a timer set once it reaches the pause, that deploys after a few seconds to choose a random button if none has been choosen up to that point.


Return to posts index

Prashant Savalia
Re: AS3 How to navigate to a certain CuePoint
on Nov 9, 2010 at 3:10:14 pm

demetri,

Is there a code sample you can put up for the logic you just explained? I understood the logic, but it's the code I'm having trouble with. I'm new to AS3.

Also, can you help me figure something else out? I have the same situation as the person who initiated the thread, but the in my version, I have multiple speakers, so I cut out the speakers and left the audio, synced the audio and the slides together, and exported them with navcues as flv files. The problem I have, since I'm new to all this, is my customer wants a Previous Module and Next Module button. Essentially, the buttons go back one and forward one video. But he also wanted seek points in each video. So he wanted to be able to view certain slides in each video as well as go between videos. Can you or anyone help me figure out out to do this? I thought I had something, but it only worked within one video.

Thanks in advanced for any help!


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Nov 9, 2010 at 5:59:39 pm

hi prashant,

what code example are you talking about? this thread got kind of long and there was a lot of code examples already posted on it, so i don't know what specifically you are referring to.

as far as your other question - we will need more information, because
quote
"customer wants a Previous Module and Next Module button. Essentially, the buttons go back one and forward one video"

really doesn't tell to much. are these "modules' all separate external swfs? loading via xml ? are they movieclips added from the library? or are you putting them on a timeline ?

if you want some overall suggestion, i would start by having each 'module' as a separate self contained external swf. this would have its own navigation buttons to get to specific cuepoints

then a loader on the main swf can load in a module at a time. all the module names can be in an array.
then you can script a 'next' and a 'previous' button to load in the next/previous module based on its array position. then you would acheive independent navigation to a specific module, and witin each module you would have the navigate to cuepoints ability built in to each module.

hope this anwers your question. if not, please start a new thread which can go deeper into it, as this has mpw veered off the topic of this original post.


Return to posts index


Prashant Savalia
Re: AS3 How to navigate to a certain CuePoint
on Jan 16, 2011 at 6:04:46 pm

I have a similar problem. I have a quiz that's written in AS2 but I need to get it to play a specific cue point when it's finished. The way it works is if the user passes the quiz, it goes to the main swf which is a separate file, not embedded. If they pass the quiz, it plays the next cue point from where it left off. If they don't pass, it makes them repeat the one they just finished. Can anyone help me figure out how to code out the part where passing takes you to the next cue point in the external swf and failing takes you to the one you just played?


Return to posts index

demetri tashie
Re: AS3 How to navigate to a certain CuePoint
on Jan 17, 2011 at 1:43:42 am

hi prashant,

i would like to help you but i can't understand the layout and structure of your project at all from the way you are describing it.

the quiz is a video ( flv ) being played ? and answering a question generated from the flv ( assumed generatd by an Event cue point being reached ) will then effect the main timeline ?

i am sure everything is quite doable, if you can just layout the structure for us clearly and logically . can you post an example of what you have done so far ? or post some source files ?


Return to posts index

Schuyler Holman
Re: AS3 How to navigate to a certain CuePoint
on Jun 3, 2012 at 6:39:37 am

I am trying to navigate to a certain point in my video. I currently have the outplay off and I am trying to start it using cue points. Basically using a button to play the movie when clicked, and then stop the video when clicked again.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]