Solved

GetURL not working after last video completes

Posted on 2008-10-22
2
213 Views
Last Modified: 2013-11-11
I am having trouble redirecting to a new web page after playing 11 Flash videos automatically.  The videos play correctly.  After the last  one completes it sits at a black video box.   I have included my action script.  Could someone tell me what's missing or how this should be done?

Thanks.
import mx.video.*;
 
var movieClipArray:Array = new Array();
 
 
movieClipArray.push("the case being built.flv");
movieClipArray.push("fact 1.flv");
movieClipArray.push("fact 2.flv");
movieClipArray.push("fact 3.flv");
movieClipArray.push("fact 4.flv");
movieClipArray.push("fact 5.flv");
movieClipArray.push("fact 6.flv");
movieClipArray.push("fact 7.flv");
movieClipArray.push("fact 8.flv");
movieClipArray.push("fact 9.flv");
movieClipArray.push("Case Closed.flv");
 
var i_currentVideo = 0;
 
var firstVideo:String = movieClipArray[i_currentVideo];
my_FLVPlybk.contentPath = firstVideo; 
 
my_FLVPlybk.play();
 
var listenerObject:Object = new Object();
// listen for complete event; play new FLV
listenerObject.complete = function(eventObject:Object):Void {
 
if( i_currentVideo < (movieClipArray.length-1) ) //if less than length of
{
i_currentVideo++;
var newMovie:String = movieClipArray[i_currentVideo];
my_FLVPlybk.contentPath = newMovie;
my_FLVPlybk.play();
}
 else  
 getURL("toc1.html", "_blank");
 
};
 
my_FLVPlybk.addEventListener("complete", listenerObject);

Open in new window

0
Comment
Question by:bsg999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 200 total points
ID: 22783227
You just need to "i_currentVideo" incremental code outside if statement, then only it will increase first and then check..

below is the fixe code which should work fine.
import mx.video.*;
 
var movieClipArray:Array = new Array();
 
 
movieClipArray.push("the case being built.flv");
movieClipArray.push("fact 1.flv");
movieClipArray.push("fact 2.flv");
movieClipArray.push("fact 3.flv");
movieClipArray.push("fact 4.flv");
movieClipArray.push("fact 5.flv");
movieClipArray.push("fact 6.flv");
movieClipArray.push("fact 7.flv");
movieClipArray.push("fact 8.flv");
movieClipArray.push("fact 9.flv");
movieClipArray.push("Case Closed.flv");
 
var i_currentVideo = 0;
 
var firstVideo:String = movieClipArray[i_currentVideo];
my_FLVPlybk.contentPath = firstVideo;
 
my_FLVPlybk.play();
 
var listenerObject:Object = new Object();
// listen for complete event; play new FLV
listenerObject.complete = function(eventObject:Object):Void  {
	i_currentVideo++;
	if (i_currentVideo<(movieClipArray.length-1)) {
		//if less than length of
		
		var newMovie:String = movieClipArray[i_currentVideo];
		my_FLVPlybk.contentPath = newMovie;
		my_FLVPlybk.play();
	} else {
		getURL("toc1.html", "_blank");
 
	}
};

Open in new window

0
 

Author Closing Comment

by:bsg999
ID: 31509086
Thanks for your prompt response.  All is working well.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question