Copy link to clipboard
Copied
Hi im creating a banner using the youtube api. What i want is that when you press the button to go to the another video also it apused. Ialready make it work but when i do the same to the other buttons it start creating errors and not working
function playRockabillyon(event:MouseEvent)
{
gotoAndStop(12);
videoPlayer.pauseVideo();
}
rockabillyon.buttonMode = true;
rockabillyon.useHandCursor = true;
rockabillyon.addEventListener(MouseEvent.CLICK, playRockabillyon);
I have to assume that the errors are pointing at the lines where you are targeting the different players. The 1009 error indicates that an object you are targeting does not exist as far as the code sees it - it looks like that's true for a number of the players you target. If those players are not present in the frame where that code executes you will get that error.
You should go into your Flash Publish Settings and select the option to Permit Debugging. That won't solve the problem but it wi
...Copy link to clipboard
Copied
I am not able to understand your problem, nor what you are trying to do that involves two functions with one click. If yoiu mean the two lines inside the playRockabillyon function, they should not be a problem, though I would change the order of them so that the change of frames is not commanded until the video is paused
What errors are you getting?
Copy link to clipboard
Copied
Hi the problem is that im trying to do a masthead with many youtube players, and when one start and u open another it keep running, so what i want is, that when you press the button to bring you to the other player it stop the video that is runing also. and it works but when im start adding more than one lines inside the playRockabillyon it work sometimes and sometimes no. Right now im changing the way of doing this I thought that is better if all players stop when u go to the frame of an specific player but I have the same problem it works at the beggining with one line but affter adding more it stop working, it only pause the videoPlayer.pauseVideo
stage.addEventListener(Event.ENTER_FRAME, onFrameEnter);
function onFrameEnter(e:Event)
{
videoPlayer.pauseVideo();
videoPlayer2.pauseVideo();
videoPlayer3.pauseVideo();
videoPlayer4.pauseVideo();
videoPlayer5.pauseVideo();
videoPlayer6.pauseVideo();
videoPlayer7.pauseVideo();
videoPlayer8.pauseVideo();
videoPlayer9.pauseVideo();
videoPlayer10.pauseVideo();
}
Copy link to clipboard
Copied
These is the error that appear
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at YT_Masthead_970x250_child_fla::MainTimeline/onFrameEnter()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at YT_Masthead_970x250_child_fla::MainTimeline/onFrameEnter()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at YT_Masthead_970x250_child_fla::MainTimeline/onFrameEnter()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at YT_Masthead_970x250_child_fla::MainTimeline/onFrameEnter()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at YT_Masthead_970x250_child_fla::MainTimeline/onFrameEnter()
Copy link to clipboard
Copied
I have to assume that the errors are pointing at the lines where you are targeting the different players. The 1009 error indicates that an object you are targeting does not exist as far as the code sees it - it looks like that's true for a number of the players you target. If those players are not present in the frame where that code executes you will get that error.
You should go into your Flash Publish Settings and select the option to Permit Debugging. That won't solve the problem but it will enhance the error messages to include the line numbers where the errors are occuring
Copy link to clipboard
Copied
Thanks I solve it
Find more inspiration, events, and resources on the new Adobe Community
Explore Now