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


Similar Posts:


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.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

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

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

Motion Tween Animation Hanging/pausing In Browser?

Jan 1, 2010

Let me start by stating that I am a complete and total noob to web design, programming of any type, and flash animation. I've spent more hours watching videos on YouTube and reading web pages than I ever should have.I've created my first flash animation for my business website that consists of four pictures moving across the pageThe problem I'm having is that as the first two pictures reach the side of the page where they exit, they pause for a second or two. This happens even when the animation is fully loaded.

View 3 Replies

ActionScript 2.0 :: Keeping Focus On Higher Level Swfs?

Mar 2, 2006

I'm sort of re-discovering Flash. As such, I'm a bit rusty with all the ActionScript and general techniques. I have a site that loads swfs on higher levels with loadMovieNum (i.e., a pop-up photo gallery). The only problem lies in lower level buttons still remaining active; apart from the aesthetic issue, I don't want the user to be able to "accidentally" click something on level0. Is there a general method for keeping the "focus" on the highest level, or making any interactive elements below inactive?

View 4 Replies

Set Focus To Swf In Browser?

Aug 8, 2010

I have a game where you can move a character around on a screen, very simple. My problem is, I have to click on the swf object in my browser before it starts to recognize my input keys. If there a way to set set to my swf object either in html or the swf itself /w as3?

This is the browser code I keep finding on googing:

Actionscript Code:
<body onLoad="window.document.mymovie.focus();">  <object width="760" height="820"> <param name="mymovie" value="test.swf"> <embed src="test.swf" width="760" height="820"> </embed> </object>   </body>

View 1 Replies

ActionScript 3.0 :: Set Focus In Swf Instead Of Browser?

Oct 4, 2009

I have the swf embedded in a html page and want to know if it is possible to set the focus so that it is within the swf and not the html (browser) when the page loads. You have to click on the swf to make it active, I do want this.

View 2 Replies

ActionScript 3.0 :: Know If The Browser Has Focus Of The Swf Or Not

Feb 7, 2010

is there a class or general method used to know if the browser has focus of the swf or not?

View 3 Replies

Facebook :: Return The Focus To A TextInput In A Browser

Oct 10, 2011

I need to focus a the text input into the facebook login popup. I am usig a virtual keyboard to simulate a physical one, but when i click a key, the text input lose focus and the letter is not wrtitten into the field.I dont know how i could mantain the focus in the text input.

View 2 Replies

ActionScript 2.0 :: Hitting TAB Loses Focus To The Browser?

Jun 8, 2010

Creating a flash project where I need to hit TAB in order for the playhead to go forward a frame. Then I need the user to hit a letter (for example hit 'a') to move forward again. Hitting the above keys is working,

As soon as the user hits TAB, flash seems to lose focus to the browser, and the user has to click on the swf on the screen before they can proceed.

View 0 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

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 :: 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 2.0 :: Multiple Audio Swfs On A Page

Jul 30, 2008

I basically have multiple identical swfs on a html page, each containing an mp3. I need it so that when you play one.. it stops any others that are playing, to prevent the audio from overlapping and creating a mess.

I've tried using 'local Connection' which almost worked.. but just didn't seem to be well suited to this sort of thing.

View 9 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

Flex :: Flash - Giving An Application The Focus In Browser To Capture Keystrokes?

Jan 1, 2010

I've written a little video game in Flex that runs in a browser. The player moves by pushing the arrow buttons on the keyboard, so I need to capture those keystrokes. In fact, the game action starts when the player presses one of those keys.In order to capture the keystrokes, the Flash/Flex application, not just the browser, needs to have the focus.How can I ensure that the application has the focus? I've implemented a bit of a hack: A "Begin" button you must click to start the game. The only point of this button is to ensure that the app has the focus.

View 2 Replies

Actionscript 3 :: Add Keyboard Shortcut To Flex-project To Focus Container Browser?

Nov 9, 2011

What would be the appropriate way to add some AS in a flex-project, giving giving focus back to the parent browser.

ctrl-q: i'm blurring flash
ctrl-t: ah, a new browser tab.

View 1 Replies

ActionScript 3.0 :: Overlapping Sounds With SWFs With Embedded Audio?

Aug 11, 2010

I am using an xml based slide navigation shell that uses next and back buttons to page through content.

If I use SWFs with embedded audio (which I need to do sometimes) the audio will overlap after I leave the slide, SoundMixer.stopAll() is not doing the trick. I think removeChild may be the direction I need, but I'm not sure how to implement so far.

View 3 Replies

Why Won't FLV / F4Vs Play In A Browser But SWFs Will

May 13, 2009

Why can't I get my FLVs and F4Vs to play out of a browser window but they'll play out of explorer through the Adobe Media player?Once I convert them to be SWFs, they play out of a browser but they're still humungous and take a lot of time to play. 400Mgs as an FLV/F4V and 200Mgs as a SWF. Is there a way to shrink them down to a much smaller file size? These were video recordings of long presentations.

View 1 Replies

ActionScript 3.0 :: Load Identical Swfs In A Browser?

Nov 24, 2009

I want to embed multiple swfs on a single page. they will be identical. i was wondering if browsers will redownload the swf each time or store the first one and retrieve the others locally? if they re-download it, is there a way to tell the browser that it can use the same one?

View 3 Replies

Audio Can't Play When View Swf In Browser

May 4, 2009

When viewing the .swf file inside a web browser, the audio file does not work. The sound does not get played. However, when double clicking on the .swf file, it works fine with the sound.

View 40 Replies

Java :: How To Capture Audio From A Browser

Oct 22, 2010

My client needs to let a user record a message from the browser, then export the message as an audio file (e.g., WAV).How is this best accomplished? Flash, Java, HTML5? By best, I mean something that is straightforward to implement and also broadly supported.

View 3 Replies

ActionScript 3.0 :: Publish Swfs For Cross-browser Support?

Feb 4, 2010

I've tried publishing CS4 swfs in both Flash 10 and 9, but the pages are acting strange in various browsers. For example:

On PC FF and IE when hitting back button in browser the site disappears.

Sometimes PC site won't load. Says "Done with errors."

In FF, the page is coming up blank.

What is the best way to publish swfs for cross-browser support?

View 4 Replies

CS3 Preload Multiple Swfs Into The Browser Memory Cache?

Feb 11, 2010

Flash CS4 using AS 2.0 for this.

Here's a simple problem I am having. I have a website made up from multiple swfs. Which open up over the index swf.

What I need to do is load 4 swf files into the memory so the transition between the page loads is smooth. The swfs are only a few kb in size but the delay in loading these (1 second) makes the transitions look very untidy. Once i've clicked on every section then the flashplayer has them stored in the cache so they run smooth, is there anyway just to load these in before the start page has loaded.

here is the website [URL]

View 8 Replies







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