Hi All
I am making a interactive image (or at least trying) and thought I would give maxLoader a try as I have been using the amazing TweenMax, but I am having trouble with maxLoader as it's Loading the content on top of everything and I cannot access my navigation buttons that I am tweening in. Also I would like to fire a command once a video completes playing but cant work out how.
So for an example lets say I have an image a with two blackholes for the front page.
I would like to be-able to click one of the holes and for the relevent video to play (a flythrough video shooting through that hole).
Once it has played I would like it to either stay on the last frame of the video to use as the background or to switch to an image of the last frame of the relevent video.
For the other blackhole I would like for the fly through video to play and once it has finished to play another video and for that one to keep looping untill the back/reverse button is pressed.
I also need all my navigation buttons to be on the top of the videos/images loaded from LoaderMax.
Another alternative is that I could make a long video with all the sections and for me to play and stop at the relevent seconds/frames. but I am not sure how to do that either.
Thanks in advance.
Here is my code so far with //HELP put besides the parts I think I need help with.
import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;
import com.greensock.easing.*;
import flash.display.MovieClip;
import flash.events.MouseEvent;
TweenMax.to(mainButtons_mc, 0, {autoAlpha:0});
TweenMax.to(hole1Buttons_mc, 0, {autoAlpha:0});
TweenMax.to(hole2Buttons_mc, 0, {autoAlpha:0});
//Load Assets
var urls:Array=["homeScreen.jpg", "hole1.f4v", "holeLoop.f4v", "hole1Reverse.f4v", "hole2.f4v", "hole2Reverse.f4v"];
LoaderMax.activate([imageLoader, VideoLoader]);
var queue:LoaderMax=LoaderMax.parse(urls,{onComplete:completeHandler},{autoPlay:false});
queue.prependURLs("assets/");
queue.load();
//On Assets Loaded Complete (Show home screen Image and tween home buttons in)
function completeHandler(event:LoaderEvent):void {
var viewer:ImageLoader=LoaderMax.getLoader("assets/homeScreen.jpg");
addChild( viewer.content );
TweenLite.to(mainButtons_mc, 1, {autoAlpha:1}); //HELP!!!! I Need these buttons on top of the MaxLoader video as I cant press them.
}
//Home Screen Buttons
mainButtons_mc.hole1_mc.addEventListener(MouseEvent.CLICK, hole1);
mainButtons_mc.hole2_mc.addEventListener(MouseEvent.CLICK, hole2);
//Hole 1 Buttons
hole1Buttons_mc.back_mc.addEventListener(MouseEvent.CLICK, hole1Reverse);
//Hole 2 Buttons
hole2Buttons_mc.back_mc.addEventListener(MouseEvent.CLICK, hole2Reverse);
//Home Screen Button Functions
//HELP!!!! How can I get this function to play the holeLoop function once the video has played through and then keep looping?
function hole1(event:MouseEvent):void {
TweenLite.to(mainButtons_mc, 1, {autoAlpha:0});
var viewer:VideoLoader=LoaderMax.getLoader("assets/hole1.f4v");
addChild( viewer.content);
viewer.playVideo();
TweenLite.to(hole1Buttons_mc, 1, {autoAlpha:1}); //HELP!!!! I Need these buttons on top of the MaxLoader video as I cant press them.
}
//HELP!!!! How can I get this video to loop after hole1 video has completed playing and for it to keep looping untill told otherwise and for the hole1Buttons_mc to stay on top?
function holeLoop(event:MouseEvent):void { //Guess this needs to be a loader event.
var viewer:VideoLoader=LoaderMax.getLoader("assets/holeLoop.f4v"); //Guess I need an onComplete here.
addChild( viewer.content);
viewer.playVideo(); //Needs to loop.
}
function hole2(event:MouseEvent):void {
TweenLite.to(mainButtons_mc, 1, {autoAlpha:0});
var viewer:VideoLoader=LoaderMax.getLoader("assets/hole2.f4v");
addChild( viewer.content);
viewer.playVideo();
TweenLite.to(hole2Buttons_mc, 1, {autoAlpha:1}); //HELP!!!! I Need these buttons on top of the MaxLoader video as I cant press them.
}
//Hole 1 Button Functions
//HELP!!!! I need to show the homescreen.jpg once this video completes
function hole1Reverse(event:MouseEvent):void {
TweenLite.to(hole1Buttons_mc, 1, {autoAlpha:0});
var viewer:VideoLoader=LoaderMax.getLoader("assets/hole1reverse.f4v");
addChild( viewer.content);
viewer.playVideo();
TweenLite.to(mainButtons_mc, 1, {autoAlpha:1}); //HELP!!!! I Need these buttons on top of the MaxLoader video as I cant press them.
}
//Hole 2 Button Functions
//HELP!!!! I need to show the homescreen.jpg once this video completes
function hole2Reverse(event:MouseEvent):void {
TweenLite.to(hole2Buttons_mc, 1, {autoAlpha:0});
var viewer:VideoLoader=LoaderMax.getLoader("assets/hole2reverse2.f4v");
addChild( viewer.content);
viewer.playVideo();
TweenLite.to(mainButtons_mc, 1, {autoAlpha:1}); //HELP!!!! I Need these buttons on top of the MaxLoader video as I cant press them.
}