FORUMS: list search recent posts

Cue Point HELP!!!

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
influx justin
Cue Point HELP!!!
on May 11, 2007 at 6:45:58 am

Hi there.
Using.......


var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
showreel.attachVideo(ns);

ns.onCuePoint = function(infoObject:Object) {
trace("onCuePoint:");
for (var propName in infoObject) {
if (propName != "parameters") {
trace(propName+" = "+infoObject[propName]);
} else {
trace("parameters =");
if (infoObject.parameters != undefined) {
for (var paramName in infoObject.parameters) {
trace(" "+paramName+": "+infoObject.parameters[paramName]);
}
} else {
trace("undefined");
}
}
}
trace("---------");
};


ns.play("joan3.flv");




ns.onCuePoint = function(eventObj:Object)
{
mymovieclip1.gotoAndPlay(5);

}



....I have managed to successfully trace 2 embedded cuepoints from my FLV, and have their values returned.

However, I want to be able to trigger a seperate Movieclip event for each.
I only know how to trigger the same clip for both.........


ns.onCuePoint = function(eventObj:Object)
{
mymovieclip1.gotoAndPlay(5);

}

Problem is , "mymovieclip1" is designed for cuepoint 1 (not 2) How can i have cuepoint2 trigger "mymovieclip2" ??

Hope this makes sense

Cheers
Justin


Return to posts index

Mike_S
Re: Cue Point HELP!!!
on May 11, 2007 at 9:08:25 am

As you can trace out the different name properties from the two cue points, why not assign the name to a variable, and check that variable in an if clause and assign action according to the test (or a switch / case / break construct, if you end up with a lot of cue points)
>>>>


ns.onCuePoint = function(eventObj:Object)
{
// assign cuepoint name to a variable here, test name in
// an if clause and offer alternate actions accordingly
if (myCueName== a) {
mymovieclip1.gotoAndPlay(5);
} else {
do something else ...;
}


Return to posts index

influx justin
Re: Cue Point HELP!!!
on May 11, 2007 at 9:19:04 am

Hi Mike.

Are you able to post appropriate code for this?

My AS skills are very low level, and it is a stretch for me to do this.

If I am able to call movieclip1 to play when cuepoint 1 is reached
and movieclip2 to play when cuepoint 2 is reached....

that would be awesome

Cheers
Justin


Return to posts index


Mike_S
Re: Cue Point HELP!!!
on May 11, 2007 at 12:12:58 pm

Fiddling inside unseen code is always fraught with difficulty.

You have created an event listener object and used it to trace cue point names. You could try extracting the info into a variable ... something like this - I haven't tested it ...

Your modified source:

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
showreel.attachVideo(ns);

ns.onCuePoint = function(infoObject:Object) {
// trace("cue point");
// trace("check "+infoObject.name+" "+infoObject.time);
var myStor = infoObject.name;
if (myStor == "point1") {
// trace ("yes " + infoObject.name);
mymovieclip1.gotoAndPlay(5);
} else if (myStor == "point2") {
// trace("yes again " + infoObject.name);
mymovieclip(somenumber).gotoAndPlay(somenumber);
}
};
ns.play("your video file");


Return to posts index

influx justin
Re: Cue Point HELP!!!
on May 11, 2007 at 1:10:17 pm

Mike.
You are a genius!

Thankyou so much for that.

Are you available as a freelancer?
I am trying to piece together a basic site for client videos.

Thanks again!!!!

Justin


Return to posts index

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