ActionScript 3.0 :: Pausing A Swf With Audio When The Html Window Is Out Of Focus?

May 16, 2011

I have created a container in Flash Professional CS5 for my projects CBT. I have been able to script many of the features we require using AS3, but there are a couple of things I am still trying to work out.I would like the swf presently playing in one tab to pause and go silent when another swf is opened in a new tab (the sound is inside this externally loaded swf which is loaded inside a movie clip from buttons nested a movie clip down). I have tried :

var originalFrameRate:uint = stage.frameRate;
var standbyFrameRate:uint = 0;
addEventListener(Event.ACTIVATE, onActivate)[code]....

This function is present when I publish the CBT with Captivate, so obviously there must be code available. You can set the Captivate button to open url in new window and pause movie.Is there something I can add to the html file that is similar to the �has Priority� for mobile devices or is there javascript that can be added to the flash itself?

View 0 Replies


Similar Posts:


ActionScript 3.0 :: Pausing Swfs And Audio In A Browser When The Tab Is Out Of Focus?

May 19, 2011

I'm trying to code my flash file so that the html will pause all swfs AND audio when the tab is out of foucs.  I found this code on[URL].._and_VBScr ipt_Injection_in_ActionScript_3 and it works,but not completely. It only pauses the movie clips that are in the Flash file and not any that are exteranlly loaded with audio included.

[Code]...

View 2 Replies

Professional :: Pausing Swfs And Audio In A Browser When The Tab Is Out Of Focus?

May 19, 2011

I'm trying to code my flash file so that the html will pause all swfs AND audio when the tab is out of foucs.  I found this code on [URL] and it works,but not completely. It only pauses the movie clips that are in the Flash file and not any that are exteranlly loaded with audio included.
 
How can I adjust it to pause the externally loaded swfs that are loaded to a mc within my main movie clip and the audio OR what should I use in place of this code?  Someone mentioned on a different post that I needed to use a window.onblur funcition, but they didn't give details. 
 
import flash.display.MovieClip;import flash.utils.setTimeout; // This is a more "safe than sorry" setting, since multiple domains// have entry into my site. Can be removed or hardcoded if you feel// secure or insecure, as you see fit.flash.system.Security.allowDomain("*"); // Throw any errors around to make sure somebody actually gets

[code]....

View 1 Replies

Actionscript 3 :: Pausing On Loss Of Focus?

Jun 4, 2011

I'm working on a Flash mobile game. If the app loses focus (a call comes in for example) I need the game timer to stop until focus is restored. Here is my current code but I'm getting a "Argument count mismatch error" onDeactivate(). Expected 0, got 1.

Here is the related code, I think:

addEventListener(Event.ACTIVATE, onActivate);
addEventListener(Event.DEACTIVATE,onDeactivate);
public function onActivate():void {

[Code].....

I'm getting the error when testing in flash and I close the window.

View 1 Replies

ActionScript 3.0 :: Animation Pausing When Lost Focus, But Sound Continues?

Jul 9, 2010

I have an issue with an animation/movie thingy i am making

When the user for example, Switches a tab in firefox or something. The sound on the video will continue to play, but the animation will pause. Leading the animation to become out of sync with the sound.

Is there a way to make the animation continue playing even if the tab has been changed??

View 8 Replies

ActionScript 3.0 :: Pausing Audio Embedded Into A Swf?

Jan 13, 2009

I read all of the threads on this forum about pausing audio in a swf. They were all very helpful - if you have control over the swf fla. However i have no control over the swf i am loading. I cannot find a way to reference a sound that is placed on the timeline of the movie. If i had access to the fla of the swf, then i could change the linkage, but again i don't possess the fla.

so does anyone out there know of a way to reference global sounds in a swf? In as 2.0, this could be done easily by declaring a new sound object without a target such as this: var gvol = new Sound();

I can't seem to make this work in AS3.

I need a way to reference a global sound in a swf, so i can then apply the SoundChannel to the sound object, and read the position property within

View 0 Replies

Professional :: Playing - Pausing - Stopping Audio In A Timeline

Feb 23, 2010

I don't use Flash that much so the question may sound simple, but how do I pause audio in a timeline? I have added the audio, play and stop button. When I test it works fine, but I can't figure out how to add the pause button, or the play/pause button.

View 2 Replies

ActionScript 3.0 :: Embedded F4v Files Drop Audio After Pausing/playing?

May 10, 2011

I have a template I created in CS4 where an flv video clip was embedded with a controller skin, etc. It worked fine.

I'm working in CS5 now and using f4v files, and publishing for Flash 10 Player. The files are targeted, load and play properly, but if I pause the video, then hit play, audio stops. Starting a new clip at a different point in the timeline works fine. I noticed if I turn off autoplay under Component Parameters, audio doesn't work at all.

View 2 Replies

Html :: Flash Audio Player For M4a (AAC) Audio File Embedded?

May 15, 2007

I'm looking for a (free) flash player that I can embed in my site and use to play a .m4a (.mp4 with AAC audio) file that will be obtained using a URL (i.e. it's not local to the server hosting the web page).I've tried searching on google for one, but either I'm searching wrong or no one has made such a thing. Ideally this would be very simple (small user interface with play button and maybe a progress bar) and it would be easy to have multiple instances of on an html page (can create the player with an <object> tag).

View 7 Replies

ActionScript 3.0 :: Pause Stage/swf With Audio When A New Tab Is Opened/ Out Of Focus In Browser

May 16, 2011

I have created a container in Flash Professional CS5 for my project's CBT.  I've been able to script many of the features we require using AS3, but there are a couple of things I'm still trying to work out. I would like the swf presently playing in one tab to pause and go silent when another swf is opened in a new tab (the sound is inside this externally loaded swf which is loaded inside a movie clip from buttons nested a movie clip down).  I've tried :

var originalFrameRate:uint = stage.frameRate;
var standbyFrameRate:uint = 0;
addEventListener(Event.ACTIVATE, onActivate);
addEventListener(Event.DEACTIVATE, onDeactivate);

[Code].....

This function is present when I publish the CBT with Captivate, so obviously there must be code available. You can set the Captivate button to open url in new window and pause movie. Is there something I can add to the html file that is similar to the "has Priority" for mobile devices or is there javascript that can be added to the flash itself?

View 1 Replies

Flex :: Using Tab Focus Manager In A Title Window?

Sep 7, 2010

I'm struggling to get around an error that is constantly thrown in my application when I press the tab key.

I have a modal dialog box that contains a form with 3 form items. Whenever I press the tab button flex throws an error saying

"ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller."

I've tried setting up a focus manager in the initilize handler of my title window to no avail

private function init(e:FlexEvent):void
{
focus=new FocusManager(myform);
focus.setFocus(firsttextfield);

[Code]....

View 2 Replies

User Cannot Hear Sound Effects When Window Is Not In Focus?

May 28, 2009

I have made a javascript/flash system to play sound effects on an AJAX-based game I have made. For some reason, on some systems (it appears to be just Firefox 3 on Windows XP), users can only hear the sound effects play while the window is in focus. If they minimize the window or are looking at a different window the sound effects don't play.

View 8 Replies

Giving Stage Focus When First Opening In Browser Window

Jun 25, 2009

Is there any reliable way to give the stage focus when you first open it in a browser window WITHOUT first clicking on the stage? By reliable, I mean something that works across different browsers and on both PCs and Macs.I've seen numerous threads on this subject, and I've read the Adobe tech note, and it seems there is no reliable way.How in the world can Adobe ask people to use Flash and not provide a reliable way to give the stage focus on startup.

View 1 Replies

Flex :: Remain In Fullscreen Mode With Another Window Having Focus?

Mar 20, 2009

I have a flash panorama that has hotspot links to pop-up windows that contain more information about the object. Right now if you are in fullscreen mode and click a hotspot you are automatically kicked out of fullscreen mode and the pop-up then opens. Is it possible to have the pop-up open and have focus while in the background the panorama is still in fullscreen mode?

View 2 Replies

ActionScript 3.0 :: RemoveChild Problem When Window Loses Focus?

Mar 21, 2011

I am unable to replicate this issue in Flash - only in a browser window. It appears that if I lose focus of that window for a period of time or scroll down the page where the embedded flash isn't visible, when I scroll back up or return to the window, the event timers appear to play catch-up.The timed "removeChild" commands do not run and leave remnants on the stage. I do not get any errors however, and everything else seems to continue running as normal.

ActionScript Code:
// XML File:
<?xml version="1.0" encoding="utf-8"?>

[code]....

View 0 Replies

Html :: Flash - Play A Background Audio Across Multiple HTML Pages.?

Nov 17, 2010

Is there a solution to have the background audio/music play across multiple page on a website, WITHOUT restarting on every page load.The website currently uses a frameset, but I'm looking for an alternative.

View 2 Replies

Flash - Flex MXMLC Ant Task Steals The Window Focus?

Aug 5, 2010

Has anyone noticed the following behavior building Flex programs using the mxmlc ANT task (running in the background): as the MXMLC task starts, it steals the window focus from whatever application is currently running, and then gives it back again! This is extremely disruptive.Is there a way to run the MXMLC task "headless" so it doesn't interact at all with the window system?I'm running on Mac OS X (10.5.8, if that matters), and Flash 4.0.1 (although the behavior existed on 3.x as well).

View 1 Replies

Javascript :: Preserve Browser Window Focus When Clicking On Plugin?

Sep 7, 2011

I have a web page that uses javascript counters to count user "active" time, meaning the time a user spends viewing this page (and not some other page). I do this by starting/stopping them using the [URL].. However, when the user clicks on a plugin inside the same page (flash, java, etc), the window loses focus and window.onblur is fired. Is there a way to tell that the user is still on my page?

View 1 Replies

ActionScript 3.0 :: Flash Detect When User Switches Focus To Another Window?

Jan 22, 2010

Can flash detect when the user switchs focus to another window?

If it can then is there any event that fires when it does?

View 2 Replies

ActionScript 3.0 :: Timer Lagging When Browser Window Loses Focus?

Sep 12, 2009

I have this SWF that is pulling videos from YouTube through their API. Everything is working nicely until I go to another browser tab or cause the window the SWF is in to lose focus otherwise (largely by using any program aside from the browser). When I return to the tab/window that the browser is playing in, if I have been away for anything over like 20 seconds, the time text that indicates where the play head is plays catchup jumping over 3-5 seconds at a time. While the video is not making these jumps, what is happening is that any buttons for controlling the video become unresponsive until the time text actually has caught up with the current position in the video play head. Thereafter all functioning for my other buttons (play/pause, full screen toggle, and sharing) returns to normal. I am using a Timer that calls every millisecond.

View 1 Replies

ActionScript 3.0 :: When User Focus The Other Browser Window Then Flash All Functions Goes Stopped?

Sep 12, 2011

I have create a poker game user have 30 seconds time to play his turn, but the error is when user open another tab of his browser then flash countdown stopped until user dosent click on game tab. I tried, Timer event, setInterval and MovieClip enterframe also, but the main problem is when user focus the other browser window then flash all functions goes stopped until dosen't come back...

View 1 Replies

ActionScript 2.0 :: [FMX] Make A Website Fall Asleep When The Focus Is Shifted Away From The Entire Window

May 5, 2004

I was wondering if its possible to make a website fall asleep when the focus is shifted away from the entire window.... so something like onBlur. I've seen this on a few websites and I got thinking how they did it. I'm guessing they have some kind of JavaScript code in their HTML page that can detect an onBlur or killFocus or whatever you call it - then the flash movie picks up on this and takes the appropriate action - like pauses a movie or displays a message "please come back" or things to that effect.

EXAMPLE: Go to [URL] and go to the WANDER AWAY section and click his links. Provided you have enough "money" (you can earn "money" by navigating around) you'll be taken to pixel ranger etc. Now click on the [URL] window and you'll see its been greyed out and is "asleep". You have to click the movie to awaken the site.

View 3 Replies

ActionScript 2.0 :: Set Focus Back To HTML?

Nov 18, 2010

I am working on a very old file developed by my predessessor. The application use JavaScript to capture keyboard input and send it to Flash. All works well untill the point that you have to click on the embedded Flash file to enter some text. Then the user have to press Enter on the keyboard. Problem is that the minute the user click on the Flash file, the focus is set to the Flash. I need to reset the Focus back to the JavaScript in the Html in order for the keyboard Enter to trigger.

From what I have read I must use something like this to make it work:

document.body.focus();

View 1 Replies

ActionScript 2.0 :: Flash Focus In HTML Page?

Aug 26, 2004

I found a post about detecting focus for an HTML page containing a flash movie. I have a problem with buttons in an MP3 player not working correctly when changeing HTML pages.However, when I test this code......

<HTML>
<BODY onFocus="alert('you have focus');" onBlur="alert('blur');">
test focus

[code]....

View 2 Replies

Flash :: Html :: Create Mini Window For HTML?

May 8, 2010

Is there a way to create a mini window in flash that contain an HTML web page?

View 1 Replies

Html :: Make Flash Object Get Focus On Load?

Oct 27, 2011

I've been trying to set up this test page for my flash game but it refuses to gain focus on load. I read a bunch of forum entries and didn't get it to do anything, I can't really believe this should be so hard.

Here's what I have:

<head>
<title>UP HERE WE ESCAPE THE RAT RACE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject

[Code].....

View 1 Replies

ActionScript 3.0 :: Set The Focus On The Page To A Link/div/id/anchor In The Html, (outside The Swf)?

Feb 17, 2009

I have several AS3 flash movies embedded in html pages, and for whatever reason, when you tab through the page, when you get into the flash movie, you can't tab out. The tab just goes in a loop through the tabindex of the swf.

Is there a way that you can add a button or a little script in the swf, set it to the last in the taborder, and then make it set the focus on the page to a link/div/id/anchor in the html, (outside the swf)

View 2 Replies

Javascript :: Setting Focus To An Embedded Flash Movie/HTML Embed Element?

Dec 26, 2009

Is there a way to set focus to the embed HTML element using JavaScript? Test case: embedded YouTube videos on a page.

I have no control over the embedded Flash element. So, is there a way to set focus on it by using only JavaScript?

I read somewhere that calling the element.focus() method works only in IE. I need a browser-independent way that works in Chrome/Firefox.

View 3 Replies

Html :: Flex Textfield Doesn't Gain Focus When Cursor Is In Text Field Of Iframe

Sep 10, 2010

I have a web page which has a SWF file embeded. I have an issue with the focus.

Steps to reproduce:

1)Click on a HTML Text Field which is inside a Iframe

2)Click on a Flex Field.

3)Begin to type some text.

Expected Result is the entered text should go in the Flex TextInput field but the actual Result is it goes into HTML text field.

This is the bug which was filed but closed without any resolution. The workaround suggested there doesnt work. ( bugs.adobe.com/jira/browse/SDK-12377 )

This is happening only in IE 6.0 and IE 7.0. Below is the live example. [URL]

View 1 Replies

ActionScript 3.0 :: What The Focus 2 - Automatic-focus - Clicking To Be Able To Detect Key Input

Mar 8, 2011

[Code]...

when i have this line active(the red one) it gives me automatic focus, so no clicking to be able to detect key input so i got that going for me which is nice BUT when i have it active(not commented out) i get this big yellow line which goes away when i click it(seeBelow)

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved