Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Programming Languages A Place for windows applications programs and programmers .

Programming Languages Thread, AS3 FLVplayback user navigation. in Programming , WebDesign & Development; I am trying to create a system using Flash AS3 and videos. The idea is that all these videos are ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=29987


Reply
LinkBack Thread Tools Display Modes
AS3 FLVplayback user navigation.
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
17-02-2009, 10:00 AM
 
I am trying to create a system using Flash AS3 and videos. The idea is that all these videos are rooms and hallways in a building linked to each other, At the end of each video, i want an arrows to appear (left or right [or both]) in order...

I am trying to create a system using Flash AS3 and videos.

The idea is that all these videos are rooms and hallways in a building linked to each other,

At the end of each video, i want an arrows to appear (left or right [or both]) in order for the user to click, so that they can "go into the next room" by watching the next video.

The "undefined" part is to check if an object has a variable set, if the variable is not set it will be "undefined".

To know which is the current video, I think i need to store the object that relates to that video once it starts playing. So any time a video starts, store that object in the variable. But im not sure how to do this.

Here is the code i have so far below, any help would be great - i think im nearly there...


Code:
var object1:Object = new Object();
var object2:Object = new Object();
var object3:Object = new Object();
var object4:Object = new Object();
var object5:Object = new Object();
var object6:Object = new Object();
var object7:Object = new Object();


//adding labels and data associated with the list
object1 = {label: "Exterior 360" , data:"../MyFlashapp2/vid/exterior.flv"};
vidList.addItem(object1);
object2 = {label: "South and West Range, Lower Floor", data:"../MyFlashapp2/vid/path1.flv", coordx:90, coordy: 45, upbject6, rightbject3};
vidList.addItem(object2);
object3 = {label: "North & East Range, Lower Floor" , data:"../MyFlashapp2/vid/path2.flv", coordx: -30, coordy: -30, rightbject6};
vidList.addItem(object3);
object4 = {label: "North & East Range, Upper Floor" , data:"../MyFlashapp2/vid/path3.flv", coordx: 20, coordy: -90, leftbject5, rightbject7};
vidList.addItem(object4);
object5 = {label: "West & South Range, Upper Floor" , data:"../MyFlashapp2/vid/path4.flv", coordx: -50, coordy: -10, leftbject7, rightbject4};
vidList.addItem(object5);
object6 = {label: "Up Stairs" , data:"../MyFlashapp2/vid/stairup.flv", coordx: -145, coordy: -40, leftbject4, rightbject5};
vidList.addItem(object6);
object7 = {label: "Down Stairs" , data:"../MyFlashapp2/vid/stairdown.flv", coordx: -120, coordy: 10, leftbject3};
vidList.addItem(object7);

//add the list to the program
addChild(vidList);

arrowL.addEventListener(MouseEvent.CLICK, playNextVideo);
arrowR.addEventListener(MouseEvent.CLICK, playNextVideo);

//Changing cursor to hand
arrowL.buttonMode = true;
arrowL.useHandCursor = true;
arrowR.buttonMode = true;
arrowR.useHandCursor = true;
//End Changing cursor to hand

//adding a complete listener to flvplayback to call a function whenever a video ends:
vid.addEventListener(VideoEvent.COMPLETE, addNextVideoControls);

function addnextVideoControls(e:VideoEvent):void{
//check if current video has a left video
if(currentObject.left != "undefined"){
// it has got a left so add a left button
var leftarrow:arrowL = new arrowL();
leftarrow.x = vid.x + vid.width - 400;
leftarrow.y = vid.y + vid.height - 100;
addChild(arrowL);
}
if(currentObject.right != "undefined"){
//it has got a right so add a right button
var rightarrow:arrowR = new arrowR();
rightarrow.x = vid.x + vid.width - 40;
rightarrow.y = vid.x + vid.height - 100;
addChild(arrowR);
}
}

function playNextVideo(Event):void{
vid.play();
}
 
 
 
Reply

Programming Languages Thread, AS3 FLVplayback user navigation. in Programming , WebDesign & Development; I am trying to create a system using Flash AS3 and videos. The idea is that all these videos are ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=29987


Bookmarks

Tags
as3, flvplayback, navigation, user


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump