Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 09:17
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  V2 Components (Flash MX 2004 - Flash 8) (Moderators: vesa kortelainen, Ronald Wernecke, Jorge Solis, ..:: Mazhar Hasan ::.., papachan)
| | |-+  Need to get flv to stop using button
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Need to get flv to stop using button  (Read 5308 times)
Hollie
Server what's that
*
Posts: 5


View Profile Email
« on: 03/11/08, 00:14 »

I have a FLV playback and I have a file set to play a full video, and I also have nav buttons that control other segments of the full flv to play in the same playback instance.

The problem is that I have 2 additional buttons that I need to link to http: references - I can do that just fine, but I can't get the flv file to stop playing in the background.

I DESPARATELY NEED HELP!  I've been trying to find a resolution ALL DAY!

Here is my code - it works aside from the fact that I can't do the above...

var listenerObject:Object = new Object();
// listen for complete event; play new FLV
listenerObject.complete = function(eventObject:Object):Void {
    if (myPlayer.contentPath == "Tax_LifeCycle_Integration.flv") {
        myPlayer.play("The_CORPTAX_Difference.flv");

    }
};
myPlayer.addEventListener("complete", listenerObject);

var listenerObject:Object = new Object();
// listen for complete event; play new FLV
listenerObject.complete = function(eventObject:Object):Void {
    if (myPlayer.contentPath == "The_CORPTAX_Difference.flv") {
        myPlayer.play("Provision_to_Return_in60sec.flv");

    }
};
myPlayer.addEventListener("complete", listenerObject);




my1_btn.onRelease = function (){
myPlayer.contentPath = "full_movie_1200_480x320.flv";
}
my2_btn.onRelease = function (){
myPlayer.contentPath = "Tax_LifeCycle_Integration.flv";
}
my3_btn.onRelease = function (){
myPlayer.contentPath = "The_CORPTAX_Difference.flv";
}
my4_btn.onRelease = function (){
myPlayer.contentPath = "Provision_to_Return_in60sec.flv";
}
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #1 on: 03/11/08, 05:22 »

To stop your player use:

myPlayer.stop()

So when you move to another frame (or hide the component or whatever), remember always to stop it

Jorge
Logged

Hollie
Server what's that
*
Posts: 5


View Profile Email
« Reply #2 on: 03/11/08, 10:29 »

I have tried this - can you please show me how this works with the entire script attached to a button event (onRelease).

Thanks!
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14593


View Profile
« Reply #3 on: 03/11/08, 11:31 »

try

myButton(onPress){
  myPlayer.stop()
}

Jorge
Logged

Hollie
Server what's that
*
Posts: 5


View Profile Email
« Reply #4 on: 03/11/08, 15:01 »

Thanks - I will give it a shot!
Logged
Hollie
Server what's that
*
Posts: 5


View Profile Email
« Reply #5 on: 03/11/08, 19:09 »

Hi Jorge,

I put this code in as an action-button script as well as on the 1st frame of the actions layer and nothing worked.

**Error** Scene=Scene 1, layer=view, frame=1:Line 1: Syntax error.
     my5_btn(onPress){

Total ActionScript Errors: 1     Reported Errors: 1


Any suggestions

Here is the code

my5_btn(onPress){
  myPlayer.stop()
}

I appreciate your help!
Logged
Hollie
Server what's that
*
Posts: 5


View Profile Email
« Reply #6 on: 03/11/08, 21:09 »

WHOOHOO!

I figured it out... I took what you gave me and I had to modify it...

I had to create a var for the player...

var flvControl = myPlayer


and then this is the code for the button in the actions layer


my5_btn.onPress = function (){
  myPlayer.stop()
}

Works like a charm!

Thanks Jorge!
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!