Auto video game. How to stop

1. in this automatic script of video playback. How to stop this.
2. video AutoPlay. Suppose that I click on play/pause, then video showing everything first. What is the problem in the script?

Here is the solution of my file for the game of the break:

import flash.net.NetConnection;
to import flash.net.NetStream;
import flash.media.Video;
import flash.utils.Timer;
import flash.net.SharedObject;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;

stage.scaleMode = StageScaleMode.NO_SCALE;
internship. Align = StageAlign.TOP_LEFT;

# CONSTANTS
const BUFFER_TIME:Number = 8;
const SMOOTHING: Boolean = true;
const DEFAULT_VOLUME:Number = 0.6;
const DISPLAY_TIMER_UPDATE_DELAY:int = 10;

# Variables

var videoURL:String = "cuepoints.flv";
var videoURL:String = "video_1;
the var connection: NetConnection;
var stream: NetStream;
Video: video of var = new Video();
var intLastVolume:Number = DEFAULT_VOLUME;
var shoVideoPlayerSettings:SharedObject = SharedObject.getLocal ("playerSettings");
var bolLoaded:Boolean = false;
var bolVolumeScrub:Boolean = false;
var bolProgressScrub:Boolean = false;
var objInfo:Object;
var tmrDisplay:Timer;

hide buttons
mcVideoControls.btnPlay.visible = true;
mcVideoControls.btnUnmute.visible = false;
mcVideoControls.btnPause.visible = false;
mcVideoControls.btnFullscreenOff.visible = false;
   
Set the width of filling of progress/preload on 1
mcVideoControls.mcProgressFill.mcFillRed.width = 1;
mcVideoControls.mcProgressFill.mcFillGrey.width = 1;
   
Label SETTING date and time
mcVideoControls.lblTimeDuration.htmlText = "00:00 / 00:00";

Add the global event listener when the mouse is released
stage.addEventListener (MouseEvent.MOUSE_UP, mouseReleased);

Add fullscreen earphone
stage.addEventListener (FullScreenEvent.FULL_SCREEN, onFullscreen);
   
Add event listeners to the buttons
mcVideoControls.btnPause.addEventListener (MouseEvent.CLICK, pauseClicked);
mcVideoControls.btnPlay.addEventListener (MouseEvent.CLICK, playClicked);
mcVideoControls.btnStop.addEventListener (MouseEvent.CLICK, stopClicked);
mcVideoControls.btnMute.addEventListener (MouseEvent.CLICK, muteClicked);
mcVideoControls.btnUnmute.addEventListener (MouseEvent.CLICK, unmuteClicked);
mcVideoControls.btnFullscreenOn.addEventListener (MouseEvent.CLICK, fullscreenOnClicked);
mcVideoControls.btnFullscreenOff.addEventListener (MouseEvent.CLICK, fullscreenOffClicked);
           
mcVideoControls.btnVolumeBar.addEventListener (MouseEvent.MOUSE_DOWN, volumeScrubberClicked);
mcVideoControls.mcVolumeScrubber.btnVolumeScrubber.addEventListener (MouseEvent.MOUSE_DOWN, volumeScrubberClicked);
mcVideoControls.btnProgressBar.addEventListener (MouseEvent.MOUSE_DOWN, progressScrubberClicked);
mcVideoControls.mcProgressScrubber.btnProgressScrubber.addEventListener (MouseEvent.MOUSE_, progressScrubberClicked);

tmrDisplay = new Timer (DISPLAY_TIMER_UPDATE_DELAY);
tmrDisplay.addEventListener (TimerEvent.TIMER, updateDisplay);
   
stage.addEventListener (Event.RESIZE, resizeHandler)

//---------------------------------------------------------------------------------------- ------------------------------------------

NetConnectionExample();
function NetConnectionExample()
{
connection = new NetConnection();
connection.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener (SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
Connection.Connect (null);
}

function netStatusHandler(event:NetStatusEvent):void
{
Switch (event.info.code)
{
case "NetConnection.Connect.Success":
            connectStream();
break;
case "NetStream.Play.StreamNotFound":
trace ("stream not found:" + videoURL);
break;
case "NetStream.Play.Stop":
stopVideoPlayer();
break;
}
}

function securityErrorHandler(event:SecurityErrorEvent):void
{
trace ("securityErrorHandler:" + event);
}

function connectStream (): void
{
Stream = new NetStream (connection);
stream.addEventListener (NetStatusEvent.NET_STATUS, netStatusHandler);
Stream.client = this;
stream.bufferTime = BUFFER_TIME;
   
vidDisplay.attachNetStream (stream);
   Stream.Play (videoURL);
addChild (vidDisplay);
vidDisplay.smoothing = SMOOTHING;
}

# STEP SETTINGS
internship. Align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
   
//-------------------------------------------
   
var tmpVolume:Number = DEFAULT_VOLUME;
If (shoVideoPlayerSettings.data.playerVolume! = undefined) {}
tmpVolume = shoVideoPlayerSettings.data.playerVolume;
intLastVolume = tmpVolume;
}

mcVideoControls.mcVolumeScrubber.x = (53 * tmpVolume) + 353;
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 405 + 53;
setVolume (tmpVolume);
//}

mcplay.mcbtn.addEventListener (MouseEvent.CLICK, playfn);
function playfn(e:MouseEvent):void {}
Stream.Play (videoURL);
mcVideoControls.btnPause.visible = true;
mcVideoControls.btnPlay.visible = false;
bolLoaded = true;
}

function playClicked(e:MouseEvent):void
{
if(!bolLoaded)
{
Stream.Play (videoURL);
bolLoaded = true;
}
on the other
{
Stream.Resume ();
}
   
vidDisplay.visible = true;
   
mcVideoControls.btnPause.visible = true;
mcVideoControls.btnPlay.visible = false;
}

function pauseClicked(e:MouseEvent):void {}
Stream.pause ();
   
mcVideoControls.btnPause.visible = false;
mcVideoControls.btnPlay.visible = true;
}

function stopClicked(e:MouseEvent):void {}
stopVideoPlayer();
}

function muteClicked(e:MouseEvent):void {}
setVolume (0);
   
mcVideoControls.mcVolumeScrubber.x = 353;
mcVideoControls.mcVolumeFill.mcFillRed.width = 1;
}

function unmuteClicked(e:MouseEvent):void {}
var tmpVolume:Number = intLastVolume == 0? DEFAULT_VOLUME: intLastVolume
setVolume (tmpVolume);
   
mcVideoControls.mcVolumeScrubber.x = (53 * tmpVolume) + 354;
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 405 + 53;
}

function volumeScrubberClicked(e:MouseEvent):void {}
bolVolumeScrub = true;
   
mcVideoControls.mcVolumeScrubber.startDrag (true, new Rectangle (354, 19, 53, 0));
}

function progressScrubberClicked(e:MouseEvent):void {}
bolProgressScrub = true;
   
mcVideoControls.mcProgressScrubber.startDrag (true, new Rectangle (0, 2, 472, 0));
}

function mouseReleased(e:MouseEvent):void {}
bolVolumeScrub = false;
bolProgressScrub = false;
   
mcVideoControls.mcProgressScrubber.stopDrag ();
mcVideoControls.mcVolumeScrubber.stopDrag ();
   
mcVideoControls.mcProgressFill.mcFillRed.width = mcVideoControls.mcProgressScrubber.x + 5;
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 405 + 53;
   
If ((mcVideoControls.mcVolumeScrubber.x-354) / 53 > 0)
intLastVolume = (mcVideoControls.mcVolumeScrubber.x - 354) / 53;
}

function updateDisplay(e:TimerEvent):void {}
If (bolProgressScrub)
Stream.Seek (Math.round (mcVideoControls.mcProgressScrubber.x * objInfo.duration/472))
on the other
mcVideoControls.mcProgressScrubber.x = stream.time * 472 / objInfo.duration;
   
mcVideoControls.lblTimeDuration.htmlText = "" + formatTime (stream.time) + " /" + formatTime (objInfo.duration);
   
mcVideoControls.mcProgressFill.mcFillRed.width = mcVideoControls.mcProgressScrubber.x + 5;
mcVideoControls.mcProgressFill.mcFillGrey.width = stream.bytesLoaded * 478 / stream.bytesTotal;
   
{if (bolVolumeScrub)}
setVolume ((mcVideoControls.mcVolumeScrubber.x-354) / 53);
mcVideoControls.mcVolumeFill.mcFillRed.width = mcVideoControls.mcVolumeScrubber.x - 405 + 53;
}
}

var duration: number;
function onMetaData(info:Object):void {}
objInfo = info;

tmrDisplay.start ();
}

function stopVideoPlayer (): void {}
Stream.pause ();
Stream.Seek (0);
vidDisplay.visible = false;
mcVideoControls.btnPause.visible = false;
mcVideoControls.btnPlay.visible = true;
}

function setVolume(intVolume:Number_=_0):void {}

var sndTransform = new SoundTransform (intVolume);
{if (Stream)}
stream.soundTransform = sndTransform;
}
   
If (intVolume > 0) {}
mcVideoControls.btnMute.visible = true;
mcVideoControls.btnUnmute.visible = false;
} else {}
mcVideoControls.btnMute.visible = false;
mcVideoControls.btnUnmute.visible = true;
}
}

function formatTime(t:int):String {}
Returns the minutes and seconds with leading zeros
for example: 70 returns at 01:10
var s:int = Math.round (t);
var m:int = 0;
If (s > 0) {}
While (s > 59) {}
m ++ ;
s = 60;
}
Returns a String ((m< 10="" "0"="" :="" "")="" +="" m="" +="" ":"="" +="" (s="">< 10="" "0"="" :="" "")="" +="">
} else {}
return "00:00";
}
}

function fullscreenOnClicked(e:MouseEvent):void {}
stage.displayState = StageDisplayState.FULL_SCREEN;
}

function fullscreenOffClicked(e:MouseEvent):void {}
stage.displayState = StageDisplayState.NORMAL;
   
}

function onFullscreen(e:FullScreenEvent):void {}
If {(e.fullScreen)
       
buttons switch full screen
mcVideoControls.btnFullscreenOn.visible = false;
mcVideoControls.btnFullscreenOff.visible = true;
mcVideoControls.skinAutoHide = true;
mcVideoControls.skinFadeTime = 01;
           
bottom to center align controls
mcVideoControls.x = (Capabilities.screenResolutionX - 480) / 2;
mcVideoControls.y = (Capabilities.screenResolutionY - 36);
       
the size of the video display
vidDisplay.height = mcplay.height = (Capabilities.screenResolutionY - 36);
vidDisplay.width = mcplay.width = vidDisplay.height * 4 / 3;
vidDisplay.x = mcplay.x = (Capabilities.screenResolutionX - vidDisplay.width) / 2;
} else {}
buttons switch full screen
mcVideoControls.btnFullscreenOn.visible = true;
mcVideoControls.btnFullscreenOff.visible = false;
       
reset the position of the controls
mcVideoControls.x = 0;
mcVideoControls.y = 360;
       
Reset video display
vidDisplay.y = mcplay.x = 0;
vidDisplay.x = mcplay.y = 0;
vidDisplay.width = mcplay.width = 480;
vidDisplay.height = mcplay.height = 360;
}
}

function resizeHandler(e:Event):void
{
mcVideoControls.x = (stage.stageWidth - mcVideoControls.width) / 2;
mcVideoControls.y = stage.stageHeight - mcVideoControls.height;
}

Copy and paste the code above (or) simply change things "BOLD" above. It will solve

Tags: Adobe Animate

Similar Questions

  • Chess game, how to stop the project to continue

    If the user fails the test that I don't want them to be able to do b/c for those who have passed, I have created a certificate. I have my settings of the quiz in the success or failure "If the passage of rank"-go to the next slide. "If the quality defect:-send email to... on the drop down menu continue it play the project is not checked." But when I tested it out, he continues to play the project when the user fails. Should I set the Action if I fail the Action No.? Other solutions?

    ashorsley,

    One thing you can do is set such as if the user fails the test, then he jumps to a slide that you created.  The blade can simply say "Thank you" or 'Sorry, you do not pass' and include additional instructions the learner might need.  Say what you want.  Whatever it is, then set your project options to close the program.  So, it looks like this:

    For example:

    Slide 26: last question slide in the quiz properties: at the exit of the slide: go to the next slide

    Slide 27: Results of the quiz slide properties: at the exit of the slide: go to the next slide

    Slide 28: ' congratulations, you passed. "          Properties: At the exit of the slide: go to slide 30

    Slide 29: 'sorry, you do not pass."               Properties: At the exit of the slide: go to slide 30

    Slide 30: thank you very much.                                   Properties: At the exit of the slide: no action

    In preferences/Quiz/publish/success or failure, set the following parameters:

    If the passage of rank: go to the slide 28

    If lack of rank: go to the slide 29

    Publish/preferences/project/start and end, set the following parameters:

    Project end options: Action: close project

    Who should do if I understand your problem.  It worked for me.

    WARNING: In settings/preferences/publication/Quiz if you set must pass required - the user must pass this questionnaire to continue, then this solution will not work.  Assign the necessary - the user must take this questionnaire to continue, then it should work fine.

    Good luck.  Let us know how it works.  Any other questions, feel free to ask.

    Take care

    Jorge G.

  • Sony Auto Launcher popup - how to stop

    I get this pop-up and it really disrupts my workflow. I tried to click always allow and it is sill above and it still is constantly repeated. I have found no application under the name of "SonyAutoLauncher" and I would like to get rid of him. Any suggestions?

    Hi Williama_The_II,

    I'm sorry to hear that you are having these problems with your iMac. If you periodically receive these alerts, but are unable to find any associated application from Sony, you can check in the launch Agents at the level of the system folder. You can do this by going into menu go to the Finder menu, then selecting go to folder... and entering the following (without the quotation marks): "/ library/LaunchAgents / '. It should open a folder which can have several or many elements; Look for anything that can be associated with the Sony software. Please let us know if you are able to isolate.

    See you soon

  • Every time I play a video game on my computer crashes. How to solve this problem or better to diagnose the problem?

    Every time I play a video game on my computer crashes. How to solve this problem or better to diagnose the problem? Sometimes when I play a video game in the steam.

    Windows 7

    64 bit
    HP e9300z
    Processor: AMD Athlon II processor 4 620 X 2.60 Ghz
    RAM: 4 GB
    Graphics card: NVIDIA GeForce GT 220
    It does not give me an error message simply stops and restarts auto.
    When it reboots it just tells me that Windows has stopped unexpectedly.

    First - check that you have the latest drivers for your motherboard chipset, your video device, your audio device and your network devices.  The first place to look for those who are on the Web site for your computer model & specific brand:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?product=4148392&LC=en&cc=us&DLC=en&lang=en&cc=us

    When you select your operating system (Windows 7 64-bit) I see that HP ony supplies those who they provided with the system originally.  It's practically worthless.

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?OS=4063&LC=en&cc=us&DLC=en&sw_lang=&product=4148392#n177

    Yes, where to from here?  I would say that you should at least install the latest video card driver - as more modern games can use those strongly...

    http://www.nvidia.com/object/Win7-WinVista-64bit-301.42-WHQL-driver.html

    Download and install it.  If possible, you still have the original driver installed - this is more recent than most 30 months.

    It's an AMD 785 G chipset card mother configuration, if their site is correct.  Looks like you can download and install latest drivers from AMD for this also:

    http://support.AMD.com/us/gpudownload/Windows/pages/raid_windows.aspx

    I'd say it's a good start.

    What else?  It could very well be a heat problem.  Since it is a desktop - I suggest she get everything, buy some canned air for cleaning electronices and opening of this case and blow off any dust.  It can be quite the accumulation.  After blowing out, make sure that all the components that look like they 'plug' firmly/well connected.  Carefully.  Then, put the cover on and connect.

    Make sure that there is enough air around the case - put a fan in front of him if you have to.

  • Why my laptop stop suddenly while I am watching a video or a video game?

    Hello world! For several weeks now, I noticed that my computer suddenly shuts down while I'm watching a looking or playing a video game. I would like to know what can cause this and how can I solve the prolem.

    Hello world! For several weeks now, I noticed that my computer suddenly shuts down while I'm watching a looking or playing a video game. I would like to know what can cause this and how can I solve the prolem.

    ========================================
    There is a possibility that it is overheating.

    The following links may be worth a visit:

    Why my Toshiba laptop suddenly stops by itself without warning?
    http://www.laptoprepair101.com/laptop/2006/01/04/Toshiba-laptop-overheating/

    How to stop laptop overheating problems
    http://www.computer-Adviser.com/stop-laptop-overheating.html

    Laptop overheating problems - the easy cure
    http://EzineArticles.com/?laptop-overheating-problems---the-easy-cure&ID=1269144

  • How to stop play automatically Youtube videos?

    I have no idea if it's a firefox problem or a problem add-on, but since the update yesterday, embedded YouTube videos started playing automatically. Obviously, this is not ideal because I won't be stopped whenever I visit some sites, especially when there are several, so does anyone have an idea how to stop this?

    Problem solved, it was a module update which I did not know that I have always used.

  • How to stop automatic playback of videos?

    June 2013: videos on the sites Web begin to play without my permission, how to stop this?

    What I tried:
    I uninstalled Adobe Flash (turn off the Flash module did not work), existing modules 'stop' is more work according to the comments, I tried solution described in "How can I stop videos on websites AutoPlay? (Type in the address bar: subject: config and search for: plugins.click_to_play Double click and it will have the value true)-don't stop no videos to play either. Sent your comments for FireFox on the issue.

    From what I had read in the comments, it's not just about Flash: YouTube disabled add-ons and looking for something that can play videos in Windows, including using HTML5. Have no information how Web sites do.

    How do I stop this?
    Thank you.

    https://addons.Mozilla.org/en-us/Firefox/addon/stop-tube/

  • I play world of warcraft when I use a voice chat program while I play the dumb of vista, the game, how do I stop doing that? I use mumble for voice chat___

    that I play world of warcraft and I start to mumble vista mutes the game how can I stop at vista muteing the game?

    Hello Papastew10, I don't think it's something that makes Windows Vista.  Sounds like that, it's something controlled by Mumble, so there should be some options for that somewhere.  If not but you might be able to substitute by right click on the speaker icon in the system tray and choose Open Volume Mixer, try to adjust the volume of World of Warcraft from there. Paul Smith - MVP for Windows desktop experience... I crawled off NNTP - for now. Detachment Aldershot, United Kingdom. On the internet at windowsresource.net and dasmirnov.net. Please post back to let us know what works and what does not. :-)

  • How to stop the abandoned operation messages for the opening of the games on Facebook?

    Original title: how to stop the abandoned operation messages

    When I connect to my facebook and began to open the game or any game I get this error operation failed and it want start the game... I can open facebook and update the games, but it won't play...

    Hi Annspikes,

    1. what browser do you use?

    2. This only happens with Facebook game?

    3. you remember to make changes to the computer before this problem?

    If you use Internet Explorer, you can read the following article and check.

    Why do I get an "Operation aborted" error message when I visit a Web page in Internet Explorer?

    Hope this information is useful.

  • Windows Media Player 12 will stop playback automatically at the launch of compatible webcam app or video game

    It seems to be a logic in WMP 12 which automatically stops playback of video or music when another process wants to play another video or audio stream. Music playback stops when I run a video game, and a lot more annoyingly, it stops whenever I have a video stream that is played in Flash Player in my browser. I can't find the relevant controls in the options of WMP.

    Is this really a WMP feature that cannot be disabled?

    I use AMD / ATI drivers with transcoding video installed, can it be a cause?

    Hi Lucas,.

    You can try changing the settings in exclusive Mode:

    1. Right click on the speaker icon in the notification bar.
    2. Select the playback device
    3. Select your device and click Properties
    4. Select the Advanced tab
    5. Deselect the options in exclusive Mode
    6. Click apply
    7. Click OK

    Let us know if that helps.

  • Hello, I'm testing cc2015 Adobe Premiere Pro, I use it for my videos, but now it has stopped working. When I start it, it says ´´Premiere Pro could not find any video game capable modules´´

    Hello, I'm testing cc2015 Adobe Premiere Pro, I use it for my videos, but now it has stopped working. When I start it, it says ´´Premiere Pro could not find any video game capable of modules´´ and I don't know what to do, I saw a cople of solutions for mac, but not for windows ;( My PC: Intel core i5-4460 3.2 GHz, Nvidia GTX 760 2 GB, 16 GB of RAM, Windows 8.1 thank you for your attention and please help me!

    Hi PepeF,

    You have AVG installed anti-virus software? If so, disable or uninstall.

    Thank you
    Kevin

  • How to stop a freeze on transition framing between two video clips?

    Hi all

    Newbiee here

    How to stop a freeze on transition framing between two video clips?

    Cheers for your help in advance.

    Make sure that your clips have long enough 'handles', extra material before and after the change, the less both the duration of the transition.

  • How to capture characters from video games on a white background?

    So I honestly don't know where to start. I am a beginner to AE and wanting something very basic, but don't know what to ask. Also will be the link of a creator and I'm looking to do something similar.

    Want to ENB - YouTube

    I am only concerned about the first 8 seconds of youtube video. How can you take pictures of a video game (something I already selected) and drop on a white background to create a clever title? I don't mean to guide step by step, but just something or someone to point me in the proper direction.

    Thanks advance!

    -PL

    If you happen to have the background without character in (what is called a "clean plate"), you can use a cache of difference.

    Otherwise, it's good, old rotoscoping.

  • Video game after stop/pause

    I made a simple page on board animated with a video on the stage and a few buttons for time codes (when you click on a button, you go at this precise moment in the video)

    Sample code for a button is:

    SYM.$("video") [0] .currentTime = 5;

    .play sym.$("Video") [0]

    This works very well when the video is playing. However, when the video is over and stops and I click one of the buttons, the video does not play from this point on but it stops just at this moment. How can I do what the video from that point regardless of case the video playback is paused / stopped?

    Thank you.

    There can be question Safari then. You can try to upgrade your Safari browser to the latest version and then check it out.

  • How to stop a video to play after using removechild?

    I'm new to flash and asc3.  I am developing a website using cs3.  I have the main swf file that calls in other SWF files help to add a child.  SWFs that I call, have video using the flvplayer standard.  The problem that I encounter (and driving me crazy) is at this time I use the remove the child, you can still hear the audio of the video that has just been deleted.  How to stop it?  Help, please.  If you want more details, let me know.  I really need to solve this problem as soon as possible.  Thank you.

    Try adding this to your code:

    SoundMixer.stopAll();

Maybe you are looking for