[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


AS3 Fullscreen projector has black screen instead of flvplayback

Posted on 2012-09-12
Medium Priority
Last Modified: 2012-12-11
Hi All,

I'm having difficulty getting this to work. Basically I'm putting together a CD Rom which will play full screen.

Parts of the CD Rom have videos in. I don't want these to play full screen but just play in a box in the middle.

The problem I'm having is that it works fine until I export a Macintosh Projector file. When I go to the scene with the movie, it just goes black. Filling the screen with black, and when I press escape, it goes back to the scene but the movie hasn't started playing.

I'm also using cue points so that it can go to the next video at the end. I'm not a very good programmer yet, as you may see from my code...

The fullscreen code I'm using is on the previous scene:
import flash.system.fscommand;

fscommand("fullscreen", "true");
fscommand("allowscale", "false");

Open in new window

On the next scene, with the video on it, I've tried
 IntroMovie.fullScreenTakeOver = false; 

Open in new window

but it doesn't work. I've tried going through all of my code and now I've ended up here. Please could somebody attempt to help?

My full code is:

Intro Scene
import fl.video.VideoEvent;
import fl.video.MetadataEvent;
import flash.system.fscommand;

fscommand("fullscreen", "true");
fscommand("allowscale", "false");

ADTStartBtn.addEventListener(MouseEvent.CLICK, gotointrovideo);

	function gotointrovideo(event:Event):void 
	trace("Intro Video");
	gotoAndPlay("IntroPlay", "Intro");
//This is where there's a transition for the "out" of intro. It doesn't have an end frame command to go to the next scene as it's automatic.

Open in new window

Code for Intro Video Scene:
import fl.video.FLVPlayback;
import flash.system.fscommand;
import flash.events.MouseEvent;

IntroMovie.fullScreenTakeOver = false;

//Initiates the Cue Point

function cp_listener(event:MetadataEvent):void
// Traces cue points for info
trace("Elapsed time in seconds: " + IntroMovie.playheadTime);
trace("Cue point name is: " + event.info.name);
trace("Cue point type is: " + event.info.type);

// Code for going to next scene automatically at the end of the video
if (event.info.name == "Intro End") {

// Code for "Next" button
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopflv);
function stopflv(event:MouseEvent):void {

// Code for "Pause" button
pause_btn.addEventListener(MouseEvent.MOUSE_DOWN, intro_pauseflv);
function intro_pauseflv(event:MouseEvent):void {

// Code for "Play" button
play_btn.addEventListener(MouseEvent.MOUSE_DOWN, intro_playflv);
function intro_playflv(event:MouseEvent):void {

// Code for "Scene Selection" button
menubtn.addEventListener(MouseEvent.CLICK, gotomenu);

	function gotomenu(event:Event):void 
	trace("Game Menu");
	gotoAndPlay(1, "Game Menu");


Open in new window

Many thanks,

Question by:tomsaunders9
LVL 19

Expert Comment

ID: 38402993
I'm not sure if this will help, but it sounds like it may be related


Also, since the author of that piece says this only works with videos encoded in the flv format, one other possible solution may be (if you are using flv videos yourself) is to re-encode the videos using a *different* video codec (e.g. using Adobe Media Encoder and choosing, say, the H264 video codec).

Accepted Solution

tomsaunders9 earned 0 total points
ID: 38417090
Thanks for the reply, quizengine.

Actually it turned out to be an issue that when the screen goes black it's actually crashing:
ReferenceError: Error #1056: Cannot create property IntroMovie on flash.display.Stage.

It's processing the code before it's had chance to add all the elements to the display list. I'm referencing "IntroMovie" but it doesn't exist yet.
A simple solution is to delete the video from the stage in the timeline, and instantiate the FLVPlayback instance with code:
var IntroMovie:FLVPlayback = new FLVPlayback();

//Then set up the properties like this:

IntroMovie.source = "Videos/1_Intro.mp4";
IntroMovie.fullScreenTakeOver = false;

// change these as appropriate

IntroMovie.x =100;  //in pixels
IntroMovie.y= 100;
IntroMovie.width = 800;
IntroMovie.height= 400;
//add this newly created object to the stage

Open in new window

There's also a COMPLETE event that I used instead of adding cue points. Much better.

Anyway, that should solve the problem for most people, and the MP4s work just fine.

LVL 37

Expert Comment

ID: 38678655
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

834 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