Actionscript :: Delay Before Playing Embedded Mp3 In Flex 3?

Nov 19, 2009

I am embedding an mp3 into my Flex project for use as a sound effect, but I am finding that every time I play it, there is a delay of about half a second from when I call .play() to when you can hear the sound. This makes it weird because I want the sound effects to sync to game events. My mp3 itself is only about a fifth of a second long so it isn't because of the contents of the mp3.

I'm embedding with

[Embed(source="assets/Tock.mp3")]
[Bindable]
public static var TockSound:Class;

[Code]....

I know there's a delay because the sound plays about a half second after the Alert displays. I did consider that maybe it was the initial loading time of constructing the TockSound, but the delay is there on all the subsequent calls as well.

How can I avoid this delay on playing a sound?

Update: It turns out this delay is only present when playing the swf on Linux. I believe it is a Linux-specific flaw in Adobe's flash player.

View 5 Replies


Similar Posts:


Delay The Playing Of A Movie Clip?

Apr 9, 2009

I've got a little animation that I'm going to embed in my website. I'd like it to start playing, say, 10 seconds after the page is loaded.

Is there an Actionscript command that effectively says "start play after 10 seconds"?

Or do I need to just add a bunch of blank frames within the animation to effectively start roughly 10 seconds in?

View 1 Replies

ActionScript 3.0 :: Timer Delay Before Playing Movieclip?

Jul 29, 2011

I have a "News Bar" on my flash site that plays a movieclip I created to display the news. I would like a one-time delay of around 2.5 seconds before the movieclip starts playing. I'm comfortable with flash and am learning AS3 more and more everyday.

View 2 Replies

ActionScript 2.0 :: Stop Mc On Mouseevent And Assume Playing With Delay?

Feb 23, 2009

Does anyone know how to:stop a movieclip on mouse click, make the movieclip wait for, say, 3 seconds and then assume playing again from the same frame that it stopped on

(The movieclip is an instance on the main stage, the actual footage is placed in a seperate mc)

Im using Flash 8 (gave up on 10 as I realised I would have to post questions here on how to make a simple button )

View 1 Replies

ActionScript 3.0 :: Start Sound - Delay In Loaded MP3 Playing

Feb 2, 2009

I have recently updated to Flash CS4 and AS3 from Flash 8 - apart from one issue I have with the Sound Object. There seems to be a delay in the loaded MP3 playing when told to. This means that I am unable to add SFX to the game I am developing for a client, because the sound plays about 1-2 seconds after it is told to play. How to tee the Sound up, so that it plays immediately?

The process I am using is this:
Class defined to load all game assets defined in XML

All Sounds are loaded into their own Sound Object and a reference to each is held in an array and passed to the relevant Class (i.e. Player). The relevant Class tells the reference to the Sound to play - it plays, but 2 seconds after the collision detection Event has told the sound to play.

View 4 Replies

ActionScript 2.0 :: Playing Short Animation With Time Delay

Feb 18, 2009

I have a short animation that I want to pause for 5 seconds and then play again. Now I am using acionScript 2 to get this done.

Here is the code.
stop();
function triggerNext () {
var z = setInterval (changeAd, 15000);
}function startAgain(){
gotoAndPlay(1);
}
triggerNext()

Now this works the first 2 times. But when the third time rolls around it seems to start and the start again. This progressively gets worse as time goes on.

View 3 Replies

ActionScript 3.0 :: Flash Add Delay(s) Before Song Start Playing?

Mar 15, 2012

okay.. i'm using a xml n URLrequest to bring up the song n song list in a listbox but, I want the song hold for x seconds (because there r a silent opening first, then I want the the song start when the silent opening ends). Perhaps there r code to add delay just to the song so it not autoplay? Plus I dont know where to put the code..

here's the code for frame 1

[Code]...

View 6 Replies

ActionScript 3.0 :: All Embedded FLV's Playing At Once?

Nov 17, 2010

I have completed my website with several sections Home, competition, prizes, sponsors, gallery, enter, contact us.Each section is labelled on the main time frame and then there are movies within that with the content for each section.Everything was working fine until I decided that I was going to import some FLV files to use within my home section.There are seven of them and they are each 12 seconds long with audio. I imported them in to a movie clip called santa_intro_movie with structure like thisScene 1 - Home_BG - santa_intro_movie > and each imported flv sits within it's own movieclip named snta_click-001 etc up to 007 all on different frames of the santa_intro_movie and controlled by buttons.

When I test the movie it works great....except when i try and navigate to other sections of the website, when i click on my main buttons at the top for some reason the audio from all of the FLV's start playing at once and any tweens or animations that I have on those other pages start going in to hyperdrive!!!I have checked through my actionscript and I just can't figure it out.

View 8 Replies

SWF File Not Playing When Embedded In Html

Aug 16, 2009

I have embedded an automatic slideshow as a swf file into a website I'm designing for my parents. When I test the swf file, it performs exactly as expected but when I embed it into the html, it just sits there and doesn't run/animate/whatever.

The slideshow (should) automatically run through a group of 7 photos, with a fade transition and was all done with actionscript, loading the external jpeg files into alternate movieclip containers etc etc.
 
The web page where it doesn't work is here: [URL] - you can see that the swf just sits there, doing absolutely nothing.

The location of the swf file is: [URL] - as you can see, it works fine on its own!!

View 1 Replies

ActionScript 1/2 :: Playing An Embedded Timeline?

Jan 18, 2011

I may not have the correct terminology and such, but I have a simple symbol that plays, and then I have a timeline within that symbol that I want to play right after that. I named the embedded timeline/frame "trailer" so I used the action

gotoAndPlay("trailer");

this works if the named frame is in the main timeline, but it doesn't seem to be able to access the timeline within the symbol. Is there a different command I could use? Or am I doing something wrong?

View 1 Replies

Html :: Firefox Not Playing Embedded Swf?

Nov 4, 2009

I am using swfin to embed a swf object (video player) and it loads fine in all browsers, but in firefox it won't "start".I have to right click on the movie area and "start" is unchecked so I click on "start" and it will start just fine. Yet, in chrome and IE (haven't moved to a mac for testing yet) it fires up and starts just as I expected. I have tried swfobject instead of swfin and I have IE issues that I couldn't seem to correct. Hence moving to swfin.Here is the swfin code:
`
var s = new swfIN("/Flash/video_player_playhead_overlays.swf", "flashMovie", "427", "280");
// s.hideSEO("div_seo");
s.addVar("video_file", "/DownloadableWork/Boardwalk.flv");[code]....

View 1 Replies

ActionScript 2.0 :: Sound Not Playing When Embedded Into A Container SWF?

Sep 1, 2009

I have a simple MP3 file that I am attaching from a library and playing using Sound object.When testing SWF on it's own, it works fine, but I have to embed the SWF into another SWF (container) using loadMovie, AND, the sound not playing??? What can be wrong?

child.swf code:
var mySound:Sound = new Sound();
// in the library MP3 is set for export as "voiceoverclip"

[code]....

View 2 Replies

ActionScript 3.0 :: Stop Embedded Audio From Playing?

Jun 27, 2011

I have a section of a site that has a voice over when you get to a page. I have a play/pause button that works fine, and plays and pauses the audio voice over. I have about 9 other buttons on this page that all have 'SoundMixer.stopAll();' in order to stop the embedded audio. This works the first time you click a button, but any button after that restarts the embedded audio.

Is there a way to make it so that Flash knows not to restart the embedded audio?

Do I need to make a sound variable and set it to 'false'. I am not sure what to do, or how to do it.

View 8 Replies

ActionScript 3.0 :: Background Sound Not Playing In Embedded File

Jul 1, 2009

I've got a game I made just to play with AS3. But I'm having an issue with the sound. Playing the swf file will play the sound, but when embedded I hear nothing. The code for calling the sound:

Code:
import flash.media.SoundMixer;
SoundMixer.stopAll();
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
[Code] .....

View 4 Replies

ActionScript 1/2 :: Stop Playing Embedded Swf When Clicking On A Link In The Parent Swf?

Apr 11, 2009

I have a flash website www.sitzmarkgolf.com. I have a couple of embedded swf's in my main flash page. When you click on a menu item to switch to another page the embedded swf's reload the home page again until they stop playing. Is there a way via as to stop these swf's from playing when you click on a link? sorry I am new to flash and as.

View 4 Replies

ActionScript 3.0 :: Stopping Sounds From Playing In Embedded Video Clip?

Jun 10, 2011

I have three embedded video clips that are inside of movieClips. They I have buttons that take you to a framelabel where those movieClips are located. Each movieClip containing each movie are on separate frames. (See attached image)

When I click on any of the buttons that take me to any videoClips other than the first one, make the audio from the previous embedded Video on the timeline in front of the one I went to , start to play.

I have SoundMixer.stopAll();

on everybutton before I tell it to go anywhere. what to do to only get audio from the video clip in that section of the timeline to play.

View 0 Replies

ActionScript 3.0 :: Playing Embedded Video On Stage Because Of Loaded In Image

May 5, 2009

I have embedded a flv video onto the stage. I then have loaded in an image which is transparent enough to see the video through it. The problem is I cant now access the video player to control it. Is there anyway to bring the embedded video on the stage above the loaded in image so I can actually click play on the control bar and play the video?

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

CS3 Delay - Button To Play Frame 10 To 40 Then After Playing From Frame 10-40 The Movie Stops

Jul 3, 2010

how to code this on a button

onrelease
gotoandplay(10); // i need delay here before activating the next code below//
gotoandplay(80);

the trick is.. i want the button to play frame 10 to 40 then after playing from frame 10-40 the movie stops and then play frame 80 to 100

View 4 Replies

ActionScript 2.0 :: Create A Delay Via SetTimer, SetInterval Or Delay?

Feb 23, 2009

I want to create a function based (not frame) delay of about 10 seconds to the function at the start of a flash movie, the code only needs to run once.I'm very new to actionscript and have been given links to SetInterval and SetTimer examples but they all seem to be very complex.The function is below. I believe it's possible to add the commandTimer(delay:Number, repeatCount:int = 0) how me to a simple example.

onClipEvent (enterFrame) {
framePos = int(_xmouse / 100 * _parent._totalframes);
if (framePos < 0) {

[code].......

View 4 Replies

Flash :: Runtime Fonts Not Playing Nice With Fonts Embedded In Static Text?

Jul 11, 2010

I save my (embedded) fonts in an external file (fonts.swf) that gets loaded at runtime. Pretty standard. I also use a bunch of UI artwork generated in the Flash IDE. Some of this artwork contains static textfields (thus, not proper TextFields that can change. Just frozen glyphs). Here's the problem: if I use the same font in any static textfield and then embed that same font into my collection of runtime fonts, the runtime font will refuse to render. It's the same effect you get if you set a textfield with embeddedFonts=true to use a font that isn't embedded. If I change the static textfields to use a different font, the runtime fonts work just fine.

[Code]...

View 2 Replies

Get A Movie Clip To Automatically Load Up Another External Clip After Playing An Embedded Flv?

May 24, 2010

I'm trying to get a movie clip to automatically load up another external clip, after playing an embedded flv.

This is what I've tried so far:

var holdFrame = setInterval( holdFrame, 5000);
gotoAndPlay(
_root.mc_holder.loadMovie("swf/library.swf"));
clearInterval (holdFrame);

Although it throws no errors, the setInterval is ignored and it just loads direct into the next mc clip.

View 9 Replies

Make "play" Button For Embedded FLV Disappear When Movie Starts Playing?

Oct 16, 2009

I can't believe how impossible it has been to find info about this. I'm sort of a beginner with actionscript, but this shouldn't be as hard as I'm finding it to be.
 
I'm using AS2. I have an ordinary FLV video playing with one of the skins that comes with the Flash software (CS3). That all works perfectly fine. What I need to do, however, is add a large "PLAY" button over top of the movie. I have made that work also. But, I need the button to disappear when the movie starts playing, because it is obviously in the way and making it hard to view the video.
 
Some forums suggested making that button disappear when it is clicked. That would be fine, except that the video player skin also has a play button, and if someone clicks that button instead of my new large button, I still need the large button to disappear.
 
So what I'm trying to figure out how to do is something like:   if the FLV is playing, make this object (the button) disappear or become invisible. This can't be that difficult!

View 1 Replies

Flex :: Timer Delay Changer?

Jan 12, 2012

var timer:Timer = new Timer(x);
basically x is an array...
when timer.start() is invoked

it runs, the first count is 1000 ms, then the second 800 ms, and the third 6200 ms and so on. In other words, it's a dynamic change in the delay and not a continuous delay of x ms.

View 2 Replies

Flex - CenterPopUp Centers The PopUp But With Delay?

Apr 25, 2010

did someone else encounter this problem? I use the methods PopUpManager.createPopUp() and PopUpManager.centerPopUp() to create and center a pop up window but it looks strange, like the window is created at (0,0) and then reappears in the middle of the screen. how do I fix this?

View 1 Replies

Flex :: How To Cancel Effect During Start Delay In AS3

May 5, 2011

I've got a Glow effect (glowIn) being applied to an object on the roll over which has a startDelay applied. I have another glow effect (glowOut) on roll out. If the user mouses out of the control during the startDelay of glowIn, I want to cancel the effect. How do I do this? In this instance, I'm using a glow effect with a startDelay of 300ms. I want a short pause before the item actually shows the effect, but I don't want the effect playing if the user mouses out during this time. I'm setting the properties as follows:

component.setStyle("rollOverEffect", glowIn);
component.setStyle("rollOutEffect", glowOut);

I don't think it matters much, but the component in question is a Series within a chart that gets created at runtime so I would prefer a solution in actionscript rather than mxml if possible.

View 1 Replies

Actionscript :: Flex - Errorstring Tooltip Delay?

Dec 16, 2011

I've got a simple text input which I want to use the errorstring tooltip on, ie. when you assign a value to errorstring it colours the textinput red and shows an error tooltip when you hover the mouse over it.

This all works fine, but there is a long delay (maybe 10 seconds) between when the mouse is over the offending textinput and when the tooltip appears. Does anyone know how to influence this delay? I've had a good look around, but can't find anything.

View 1 Replies

Actionscript 3 :: Flex - Delay SetStyle Until Next Update?

May 26, 2009

I have a component composed of two parts, let's say two Hbox A and B in a Vbox. On a specific call I want to:

[Code]...

The problem is that the border get drawn before the resizing of the parent Vbox happen, so i end up with a border Around the Vbox with B invisible :

[Code]...

View 4 Replies

Flex :: Play Multiple Sounds With A Custom Delay?

Dec 9, 2009

I need to realize a multiple-track player. The user can upload multiple tracks and mix (play them together). My problem is to allow the user to define an exact start position of each track to allow a synchronization between them, something like this:

Track 1: start at [x] sec.
Track 2: start at [y] sec.
play/stop

where the user can set the x and y. I've tried to realize it with AS2 (using netstream and setInterval) and AS3 (using netstream or sound and timer). Only if I set the same x and y both tracks are playing simultaneously.

View 1 Replies

Flex :: Delay Repeater Until Rest Of View Has Loaded?

May 30, 2010

I have a flex repeater for an accordion inside a TitleWindow that is quite slow, I've already set recycleChildren to true, which has helped, but it's still slow on the first load and causes the animation to stutter when I open the TitleWindow.

The repeater is just one part of what's visible in the TitleWindow, what I would like to do is have the repeater load after the rest of the content in the TitleWindow so the animation of the TitleWindow being opened doesn't stutter (the main problem).

View 1 Replies







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