Here is how I determine when a movie completes. The key section is this:

myListener.complete = function(eventObject:Object):Void {

           trace("My video has been viewed");

           getURL("javascript:setCookie('mycookienameOK','My Video
Title','365');void(0);");

};

In the above I set a cookie that is good for 365 days if and only if the
movie completes. This does not prevent the user from scrubbing the play head
to the end of the movie if you make the controls available. If the user
cancels before it completes the cookie object does not get set and the video
does not show up in their list of "Viewed Videos". I am not sure how you
would implement this from externally loaded videos but maybe this is a
start.

Good luck!
Mike Ickes



// Create a NetConnection object

var my_nc:NetConnection = new NetConnection();

// Create a local streaming connection

my_nc.connect(null);

// Create a NetStream object and define an onStatus() function

var my_ns:NetStream = new NetStream(my_nc);

my_ns.onStatus = function(infoObject:Object):Void {

   status_txt.text += "status (" + this.time + " seconds)\n";

   status_txt.text += "\t Level: " + infoObject.level + "\n";

   status_txt.text += "\t Code: " + infoObject.code + "\n\n";

};

// Attach the NetStream video feed to the Video object

my_video.attachVideo(my_ns);

// Set the buffer time

my_ns.setBufferTime(15);

// Begin playing the FLV file

my_ns.play("http://yourpathtoyourvideohere.com/myVideo.swf<http://pilots.flightoptions.com/traininig/be400_EP_Drill/aircraft_fire.swf>
");



var myListener:Object = new Object();

myListener.complete = function(eventObject:Object):Void {

           trace("My video has been viewed");

           getURL("javascript:setCookie('mycookienameOK','My Video
Title','365');void(0);");

};

myMedia.addEventListener("complete", myListener);


On 7/24/07, Holth, Daniel C. <[EMAIL PROTECTED]> wrote:


Are these timeline based swfs, or single frame, or movieclips within
movieclips?  Or won't you know?

You could create an onEnterFrame event that continually checks the swf's
_currentframe compared to _totalframes.  When they are equal, it has
reached the end.

If it's a single frame or MovieClips within MovieClips situation, it
becomes more difficult...

DC Holth


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Christopher Whiteford
Sent: Monday, July 23, 2007 3:54 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] How to determine when an externally loaded swf
hasended playing.

I have a situation where I don't have control of the external swf files
that
my prog is using.

I have created a movieClip that uses a movieClipLoader and loads an
external
swf into it, I am trying to detect when the end of that external swf has
been reached.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

This e-mail and its attachments are intended only for the use of the
addressee(s) and may contain privileged, confidential or proprietary
information. If you are not the intended recipient, or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution, displaying, copying,
or use of this information is strictly prohibited. If you have received this
communication in error, please inform the sender immediately and delete and
destroy any record of this message. Thank you.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Kind Regards,
Mike Ickes
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to