Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Sound Delay/ Immediacy Inconsistent



Hi,

I'm not looking for seamless sound loops.

I'm going for a rhythm-based game and currently trying to make the key presses make sounds, kind of a drum machine.

It works in principle but the sounds are randomly delayed, sometimes the playback feels immediate, but most of the time it does not.

Here's the swf
http://kisd.de/~chen/tmp/test.html

The sound can be invoked by either a mouse click or a key press. The ball is an indicator for the event handling. It's actually being done AFTER the play() command, but the sound often comes later than the ball movement.

Just try to do a rhythm, some short beats, and you should notice that the sound does not reproduce your rhythm.

Here's the code (an external AS file linked as the document class):

Code:
package {
import flash.display.Sprite;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundChannel;

public class SoundDelay extends Sprite {
// sound variables
private var dum2:Sound;

// test object
private var ball : Sprite;

public function SoundDelay() {
init();
}
private function init():void {
dum2 = new dumSound();

// visual support to see the timing
ball = new Sprite();
addChild(ball);
ball.graphics.beginFill(0x0000ff);
ball.graphics.drawCircle(0,0,40);
ball.graphics.endFill();
ball.x = stage.stageWidth/2;
ball.y = stage.stageHeight/2;

//listener
stage.addEventListener(KeyboardEvent.KEY_DOWN,onKeyPressed);
stage.addEventListener(MouseEvent.MOUSE_DOWN,onMousePressed);
}
private function moveball() {
ball.x = stage.stageWidth/2+(Math.random()-0.5)*100;
ball.y = stage.stageHeight/2+(Math.random()-0.5)*100;
}
public function onMousePressed(event:MouseEvent):void {
dum2.play(25);
moveball();
}
public function onKeyPressed(event:KeyboardEvent):void {
dum2.play(25);
moveball();
}
}
}
The playback is offset by 25 milliseconds to make up for the silence-prefix Audacity adds during mp3 export...

Isn't F9 able to handle up to 32 sound channels? Doing a short beat shouldn't be a problem then...

Anyway, I've done searching and experiments all day, hopefully someone here can help me. Many thanks in advance!



FlashKit > Flash Help > Actionscript 3.0
Posted on: 02-18-2008, 03:22 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Inconsistent Sound Position
I'm using CS4 and Flash player 9.

I have an voiceover sound file that I'm using to cue navigating to frames in a movie based on sound position. I'm using a toggle play/pause button to stop and start the movie and sound. When I stop the sound I'm saving the sound position and then I restart it with the sound position as an offset. This works fine in a simple movie with sound alone but in my animated movie the sound doesn't continue at the point where it left off. It starts earlier, repeating part of the track even though the numbers say it started where I stopped it.

Example:

"Slide the cover back and remove it from the chassis"

If I pause the sound at "remove" it should play "it from the chassis" when unpaused.

Instead I'll get: "cover back and remove it from the chassis".

This throws my timing off and the movie action out of sync. Has anyone else had problems working with sound position, pausing and unpausing sound?

Inconsistent Sound Level In Source Files
I'm planning on making songs available via a "jukebox" Flash MP3 player on the homepage of a client.

He has informed me that their songs are not all the same volume levels
because they are coming from different sources.

I am wondering what kind of problem that will pose. We obviously do not want one song to be playing at one level, and then the next to come on real loud or soft.

Is their anything that could be done from the design end, or should I have the client produce and provide equalized and consistent source files for their tracks?

Thanks.

Sound Delay
Hi,

I searched the boards and didnt find my issue, so if I missed it, a link would be appreciated.

I have a flash 9 movie, but its been a problem since 8. For some reason when i tell a sound to .start() it lags for a couple seconds before finishin up the code. On my site this almost looks like a hang up and Id like to be able to play sounds w/o any severe drop in performance.

effectively, this is the code Im using:

startSound = new Sound();
startSound.attachSound("Start");

if (soundsOn){ /////Plays welcome sound, if on
startSound.start();
}

If sounds are on and i run a getTimer() before and after that snippet there is a way noticable gap. For a demo goto http://beta.PhilHarlow.com?e=fk1 click on settings on the desktop or start menu, open performance, and turn souds on and off. An alert that triggers a sound pops up, and by turning sounds off and on you can see the big difference.

Does anyone know why this is, or more importantly, a fix or work around?

Thanks FK!

Sound Delay
Hi

I'm new to flash so any help would be greatly appreciated ,

I have a created a swf file which includes a recorded mp3 voiceover. When I publish the movie and view the swf file the sound plays in time with my animation. However when I view the swf file through a html page there is a sound delay of a few seconds. Could anyone shed some light on why this is happening and how I can overcome it?

Cheers.

Sound Delay
Hi

I'm making a game and I think I'm usuing a pretty standard way of playing sounds, just an example:


ActionScript Code:
wSound = new Sound(this);
wSound.attachSound("fxPistol");
wSound.start(0, 1);
wSound.setVolume(40*_root.masterVolume);

Anyway, the problem is that all sounds have a delay of about 1 second, which sometimes sounds very wrong (the above example is for pistol fire, which requires exact sound timing).

I can't think why there would be a delay, the game itself isn't running slowly. If anyone could just suggest any possible cause I'd appreciate it.

Sound Delay?
I have a button calling an external mp3 to play.

on (release) {
yesSound = new Sound ();
yesSound.loadSound("http://www.myurl.com/yes.mp3", true);
}

Even with streaming on "true" there is an 8 second delay before the song begins.

If I just go to the url in the browser -- the song begins instantly.

What am I doing wrong...any ideas?


Thx!
wnf

Sound Delay
I am incorporating a background music loop to a site im working on but the music delays about 30 seconds before it begins to play. It's an external movie clip which I even load in the very first (techically third because of the preloader script) keyframe and then unload just so the computer can have it ready to go.

~ First of all: is this delay happening on all of your guys computers or just my messed up one....

~ Secondly, how do I get it to come in exactly when the final layout is opened?

See it here:
http://www.rawkandchita.com

Just for clarification: not the original sound but the music that plays with the equalizer at the end.

Thanks guys

~ Seretha

Delay Sound
I have a page that has sound, but I would for it to play about 1 or 2 seconds after the page loads, can someone tell me how I can do this?

Thanks

Sound Delay
Hey guys,

Is there a way to tell a sound to delay a second or half a second before it starts playing?
I know you can set and offset so the sound starts in the middle but what i want is for the sound to start from the beginning after waiting for half a second.

Any suggestions?

Thanks
Tyler

Sound Delay
I am incorporating a background music loop to a site im working on but the music delays about 30 seconds before it begins to play. It's an external movie clip which I even load in the very first (techically third because of the preloader script) keyframe and then unload just so the computer can have it ready to go.

~ First of all: is this delay happening on all of your guys computers or just my messed up one....

~ Secondly, how do I get it to come in exactly when the final layout is opened?

See it here:
http://www.rawkandchita.com

Just for clarification: not the original sound but the music that plays with the equalizer at the end.

Thanks guys

~ Seretha

Delay Sound
I have a page that has sound, but I would for it to play about 1 or 2 seconds after the page loads, can someone tell me how I can do this?

Thanks

Sound Delay
Hey guys,

Is there a way to tell a sound to delay a second or half a second before it starts playing?
I know you can set and offset so the sound starts in the middle but what i want is for the sound to start from the beginning after waiting for half a second.

Any suggestions?

Thanks
Tyler

Sound Delay In Flash 5
(I regret having to start with this, but, as always: don't get on my back about using Flash 5. I'd use MX if it didn't randomly crash on my computer).

What I'm trying to do is have a short intro clip before a loop begins. So the initial sound clip plays, then as soon as it finishes, the loop begins. I can't find a way to do it, but can I either make a sound delay for x milliseconds after the start command, or have an event that is triggered when the first clip stops playing? thx.

Delay Sound File
what i'd like to do...

my mp3 is say 50secs long. what i want is another Mp3 to start at 40secs into the first one so they overlap. So basically 2 mp3 constantly overlapping.

how can i tweek this code

mySound = new Sound();
mySound.loadSound("music.mp3",true);
mySound.start();
mySound.setVolume (50);
mySound.onSoundComplete = function(){
mySound.start(0,999);
}

thnx

Sound To Scene Delay
Hay,

I'm new at this, but would appreciate it if someone can tell me the script i need to write for the following:

A wav sound plays when you click on a symbel and then goes to a scene. I wrote a behaviour that plays the sound and a action that takes you to the appropriate scene.

What I want is to let the sound finish before you go to the scene... a sort of delay until the sound file is done.

any help?

Progressive Sound Delay
Hello,
My site and I recently released part one of our cartoon trilogy. It was more or less well recieved but the biggest comment we got was how distracting the audio syncing. When I test the movie scene by scene in Flash the syncing is dead one but when I test/publish/export the movie and watch it in its completion the audio syncing slowly goes off throughout the movie eventually being almost a full second ahead.

So, if anyone has any suggestions how to correct this please let me know as it looks really bad and any timed gags are completely lost because of the terrible syncing. If you want to see what I'm talking about you can go see the cartoon here.

Thanks,
Dain

Looping Sound Without Delay
Hello buddies
I wanna play a loop mp3 file without any dely between each time that loop wanna start .

for exam with this code
a=new Sound(this)
a=attachSound("mp3")
a.start(0,9999)
------------
But in above each time mp3 wanna play a short delay happen!
Is there any scape from this delay?

Looping A Sound With No Delay
I'm working on a site, and I want the music in it to loop. The original sound file had a slight flat delay before any sound, this caused a slight sound gap between loops, whereas when it looped for about half a second there was no sound.

So i went about editing the sound file, so there was no flat line before it started. I did this and saved it. But when I import it into Flash, it seems to create a sound gap.



So basically, im asking is there anyway to get rid of this so the loops are seemless?

How Set Sound Reload Delay
Okay, I am very new to actionscript and actually I am making my very first flash game so forgive me if this is a really stupid question. I am making a shooter game and the problem is I cannot figure out how make the "Shotgun" sound delay before it plays again. In fact, it would even be an improvement if it would just not be able to play at the same time as itself. As it is now, you can click the mouse really fast and the shotgun just goes off as fast as you can click the mouse. Is there some kind of time delay I can put in after an onmousedown event? Or is there maybe a way to disable the mouseclick for a timeframe after an onmousedown event? Here is the code that I have now for the sound:

onMouseDown = function() {
shotgunSound = new Sound(this);
shotgunSound.attachSound("shotgun");
shotgunSound.start(0, 1);
}

Any help is greatly appreciated. Thanks.

How To Delay Sound From Playing?
Code:
var tl:TheLoop = new TheLoop();
tl.play(2, 1000);
When I have this in the first frame, as soon as I test the movie the sound plays. How do I make it pause for 2 seconds before playing? I thought this would work but it still plays immediately.

Sound Play Delay
Hi all,
I am trying to develop my first flash app. The application emulates a "karaoke" service. It plays a background sound and at the same time records the sound coming from the mic. I use the "sound" class to play the sound (s.play() ) and the "netStream" class to record the mic sound (ns.publish("mysound", "record") ). In the same app, I then try to play these two sounds together. The problem is that I cannot synchronize them. My tests drove me to a conclusion which I am not certain for. The conclusion is that the method s.play() has a delay about 500ms until the sound starts playing. The result is that recording starts 500ms earlier than playback. When, then, I playback both of them the recording sound is 500ms after the backround sound. Is that delay for sure true? How can I overcome this problem?
thanks

Sound Delay In Firefox
I've got some sound objects that play when I click a button and they work fine when I run the SWF from Flash and in IE, but in firefox, there's a two second or so delay for the sounds. Any idea what might be causing this?

Code for the sound:


Code:
var sndMoo:Sound = new Sound(new URLRequest("sounds/Moo.mp3"));
sndMoo.play();

Best Way To Delay A Sound File
Hi,

I'm going to use a small Flash mp3 player to play a narration for each scene in a virtual tour and want to delay the mp3 file from downloading for 6-10 seconds so that we can prioritize image loading. What is the best way to do this?

The flash player is here.

The player is embedded like this:
<embed src="../music.swf?url=example.mp3&mode=play" width="22" height="20" autostart="True" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
Thanks!

Delay Movie Clip Or Sound
i'm using prototype tweens that are delayed, so that clicking a button can cause a series of animations to happen, starting when i want them to. now i want sounds to match up to them. using the prototype tweens, you can use a callback funtion that executes after the tween has completed. however, i want the sound to start as the tween starts. so basically, it would be great to have something that can tell a certain sound (or movie clip with a sound in it) to play, and be able to assign it a delay time, so that it can be played at the same time as the delayed tweenings. is there any way to do this?

thanks in advance for your time and help!

--sound Sync/delay Problem
I've been working extremely hard on a project for a year now
the animation so far goes for 6.5 mins and has 2 scenes. i just made a new scene (3) and put in the song file, and some sound effects (both streamed) , but when exported everything in that scene is completely out of sync.

I've looked everywhere for help on this topic and so far have found no answer as to how this problem can be fixed.
I've tried chopping up the 2 minute song, changing publish settings, and so far to no avail. my computer is a beast, 2 gig of rram and 2 1950 Gforce grafix cards, nothing should be making this happen on MY side, so what is the solution?

worse yet, its due for DVD in july, so i need a solution FAST.
PLEASE HELP!

--sound Sync/delay Problem
I've been working extremely hard on a project for a year now
the animation so far goes for 6.5 mins and has 2 scenes. i just made a new scene (3) and put in the song file, and some sound effects (both streamed) , but when exported everything in that scene is completely out of sync.

I've looked everywhere for help on this topic and so far have found no answer as to how this problem can be fixed.
I've tried chopping up the 2 minute song, changing publish settings, and so far to no avail. my computer is a beast, 2 gig of rram and 2 1950 Gforce grafix cards, nothing should be making this happen on MY side, so what is the solution?

worse yet, its due for DVD in july, so i need a solution FAST.
PLEASE HELP!

Sound Delay Problems Between Frames
Hi there, I'm pretty new to actionscript - any help would be most appreciated as I need to finish this today.

I am working on a presentation where I have 17 frames of different movies, and I'm using the sound of each movie to govern the length of each movie in the main 17 frame scene. To play the sound for each frame I have:

_root.stop();
frame1 = new Sound(this);
frame1.attachSound("Frame1.aif");
frame1.start(0, 1);
frame1.onSoundComplete = function() {
_root.play();
};

The trouble is, there is a very small delay at beginning of each frame, and its messing up the smooth flow of the presentation, making the sound jerk as you move between frames. I've opened all the sound files to check for "quiet" at the beginning, but they are all fine.

Anyone know what the problem is? Is there a better way of doing it?

this is a large file - 1024x768 30fps

Any help would be much appreciated

Sound Play Delay With Windows
hi everyone,

I have been working on a game with quite a few sounds... Most are very small and short, but there are several which are ambience tracks (1 minute each). So I am loading all sounds into global variables so that the audio streams.

On my two apple computers, everything plays flawlessly in Firefox and Safari.. However, I was shocked today when I attempted playing my game on a friends PC with windows XP and there is about a 1 second delay before each and every sound call actually plays... I then came home and pulled out my unused PC and played it and got the same results.. I tried it with IE7, Firefox, and Safari on the PC.

So I am wondering if anyone knows what could possibly be causing this delay?

the relevant code is below.

thank you!
-patrick

Code:
// create global vars with all audio files...
private var channel:SoundChannel;
private var wall_channel:SoundChannel;
private var brick_channel:SoundChannel;
private var level_paddle_sounds:Array;
private var level_brick_sounds:Array;
private var level_wall_sounds:Array;
private var level_death_sounds:Array;
private var level_serve_sounds:Array;
private var active_brick_sounds:Array;
private var invaders_ambience_sound:Sound = new Sound(new URLRequest("mp3/invaders_ambience.mp3"));
private var beach_ambience_sound:Sound = new Sound(new URLRequest("mp3/beach_ambience.mp3"));
private var recognizer_ambience_sound:Sound = new Sound(new URLRequest("mp3/recognizer_ambience.mp3"));
private var paddle1_sound:Sound = new Sound(new URLRequest("mp3/paddle1.mp3"));
private var paddle2_sound:Sound = new Sound(new URLRequest("mp3/paddle2.mp3"));
private var wall1_sound:Sound = new Sound(new URLRequest("mp3/wall.mp3"));
private var serve1_sound:Sound = new Sound(new URLRequest("mp3/serve1.mp3"));
private var serve2_sound:Sound = new Sound(new URLRequest("mp3/serve2.mp3"));
private var serve3_sound:Sound = new Sound(new URLRequest("mp3/serve3.mp3"));
private var death1_sound:Sound = new Sound(new URLRequest("mp3/death1.mp3"));
private var death2_sound:Sound = new Sound(new URLRequest("mp3/death2.mp3"));
private var brick1_sound:Sound = new Sound(new URLRequest("mp3/brick1.mp3"));
private var invaders_brick_sound:Sound = new Sound(new URLRequest("mp3/invaders_brick.mp3"));
private var invaders_paddle_sound:Sound = new Sound(new URLRequest("mp3/invaders_paddle.mp3"));
private var beach_paddle1_sound:Sound = new Sound(new URLRequest("mp3/beach_paddle1.mp3"));
private var beach_paddle2_sound:Sound = new Sound(new URLRequest("mp3/beach_paddle2.mp3"));
private var beach_brick1_sound:Sound = new Sound(new URLRequest("mp3/beach_brick1.mp3"));
private var piano_brick1_sound:Sound = new Sound(new URLRequest("mp3/pianobrick1.mp3"));
private var piano_brick2_sound:Sound = new Sound(new URLRequest("mp3/pianobrick2.mp3"));
private var piano_brick3_sound:Sound = new Sound(new URLRequest("mp3/pianobrick3.mp3"));
private var piano_brick4_sound:Sound = new Sound(new URLRequest("mp3/pianobrick4.mp3"));
private var piano_brick5_sound:Sound = new Sound(new URLRequest("mp3/pianobrick5.mp3"));
private var piano_brick6_sound:Sound = new Sound(new URLRequest("mp3/pianobrick6.mp3"));
private var brick1_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_brick1.mp3"));
private var brick2_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_brick2.mp3"));
private var brick3_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_brick3.mp3"));
private var brick4_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_brick4.mp3"));
private var paddle_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_paddle.mp3"));
private var pacman_brick1_sound:Sound = new Sound(new URLRequest("mp3/pacman_brick1.mp3"));
private var pacman_brick2_sound:Sound = new Sound(new URLRequest("mp3/pacman_brick2.mp3"));
private var pacman_brick3_sound:Sound = new Sound(new URLRequest("mp3/pacman_brick3.mp3"));
private var pacman_brick4_sound:Sound = new Sound(new URLRequest("mp3/pacman_brick4.mp3"));
private var pacman_brick5_sound:Sound = new Sound(new URLRequest("mp3/pacman_brick5.mp3"));
private var pacman_song_sound:Sound = new Sound(new URLRequest("mp3/pacman_song.mp3"));
private var pacman_ambience_sound:Sound = new Sound(new URLRequest("mp3/pacman_ambience.mp3"));
private var pacman_death_sound:Sound = new Sound(new URLRequest("mp3/pacman_death.mp3"));
private var tron_brick1_sound:Sound = new Sound(new URLRequest("mp3/tron_brick1.mp3"));
private var tron_brick2_sound:Sound = new Sound(new URLRequest("mp3/tron_brick2.mp3"));
private var tron_brick3_sound:Sound = new Sound(new URLRequest("mp3/tron_brick3.mp3"));
private var tron_brick4_sound:Sound = new Sound(new URLRequest("mp3/tron_brick4.mp3"));
private var tron_brick5_sound:Sound = new Sound(new URLRequest("mp3/tron_brick5.mp3"));
private var tron_brick6_sound:Sound = new Sound(new URLRequest("mp3/tron_brick6.mp3"));
private var tron_brick7_sound:Sound = new Sound(new URLRequest("mp3/tron_brick7.mp3"));
private var tron_paddle1_sound:Sound = new Sound(new URLRequest("mp3/tron_paddle1.mp3"));
private var tron_paddle2_sound:Sound = new Sound(new URLRequest("mp3/tron_paddle2.mp3"));
private var tron_paddle3_sound:Sound = new Sound(new URLRequest("mp3/tron_paddle3.mp3"));
private var wall_2600_sound:Sound = new Sound(new URLRequest("mp3/2600_wall.mp3"));
private var extra_life_sound:Sound = new Sound(new URLRequest("mp3/extra_life.mp3"));


// in another function, I defined the audio sounds for the level..
level_paddle_sounds = ["paddle1_sound","paddle2_sound"];
level_brick_sounds = ["brick1_sound"];
level_wall_sounds = ["wall1_sound"];
level_death_sounds = ["death1_sound","death2_sound"];
level_serve_sounds = ["serve1_sound","serve2_sound","serve3_sound"];

// then in another function, this ballSpeedAdvance function is called which plays one of the sounds:
private function ballSpeedAdvance(the_obj)
{
if (the_obj == "paddle")
{
this[level_paddle_sounds[randomSound(level_paddle_sounds)]].play(0,0)
number_of_hits += 2;
}
else if (the_obj == "brick")
{
var brick_sound:int = randomSound(level_brick_sounds);
// to avoid the same audio file from playing ontop of itself
if (active_brick_sounds.indexOf(level_brick_sounds[brick_sound]) == -1 || (brick_channel && brick_channel.position > 50 ))
{
active_brick_sounds.push(level_brick_sounds[brick_sound]);
brick_channel = this[level_brick_sounds[brick_sound]].play(0,0)
brick_channel.addEventListener(Event.SOUND_COMPLETE, brickSoundComplete);
}
number_of_hits++;
}

else if (the_obj == "left_wall" || the_obj == "right_wall" || the_obj == "ceiling")
{
wall_channel = this[level_wall_sounds[randomSound(level_wall_sounds)]].play(0,0);

if (the_obj == "left_wall")
{
setPan(-1);
}
else if (the_obj == "right_wall")
{
setPan(1);
}
else
{
setPan(0);
}
}

if (number_of_hits > number_per_speed_increase && ball_speed < ball_max_speed)
{
ball_speed++;
number_of_hits = 0;
}
}

private function randomSound(the_sounds)
{
if (the_sounds.length > 1)
{
return (Math.round(Math.random()*(the_sounds.length-1)));
}
else
{
return 0;
}
}

private function setPan(pan:Number):void
{
var transform:SoundTransform = wall_channel.soundTransform;
transform.pan = pan;
wall_channel.soundTransform = transform;
}

private function brickSoundComplete(e:Event):void
{
active_brick_sounds.splice(active_brick_sounds.length-1,1);
}

Delay On Rollover When Sound Loop Is Off
hello everyone,

I posted yesterday with a issue i was having with a rollover. Basically what was happening was the animations would freeze for about half a second when ever i rolled over a button. I added a sound loop to the mix and that fixed the problem. ( I have no idea why). Today i added a button that toggles the sound on and off. When the sound is on I have no problems but when the sound is off it get the half second delay (or freezing). Anyone have any ideas of what might be causing this?

Oh and they animations are fine on my old laptop but not my new (and powerful) desktop.

Delay Triggering Sound On Key Press
For an upcoming project my client wants a virtual piano in Flash playable on keyboard keys.
In throey this is simple to deliver; load each sample mp3 into Flash as sounds and use KEY_DOWN to track user input - on key down, play predetermined sample based on keycode.

The problem is Flash does not play the sample immediately on key down. There is a small but noticable, variable delay (half a second max).
There's a slight lag between pressing the keys and the sound playing, meaning you lose the responsiveness and the keyboard becomes unusable.
Is this bug fixable? Has anyone had this problem and found a solution?

This issue seems to have been around for as long as I can remember.
Every year or so I come up against it and never find a way to get it working. I am kinda hoping that I'm just missing something...

Flash CS4 - Sound Delay Problem
I wrote an educational tool with Flash CS3 that is using a lot of sounds. Some are streamed and some are preloaded. To control all the sound procedures, I am using the SoundFacade class provided in the samples files of CS3 and that I slightly adapted to my needs.

Since I converted my application to CS4 and Flash Player 10 I noticed after a few minutes running the application (either as a stand alone or with a browser), that the sounds start playing after a delay, even when preloaded. I did not have this problem with the previous version.

I have some actions synchronized with the sound and that are triggered either with the “onLoadOpen” function when streaming sound or with the “onLoadComplete” when preloading… Now that I am running on Player v10, the delay is messing it up!

Is this a bug with Flash Player 10?








Attach Code

// Adapted from class provided by Adobe CS3

// Loads sound file with autoLoad, autoPlay,autoStream,Buffet options...
// Receives the ESNav and soundFile url as first parameters.
// Stores all loaded sounds into nav object (ESNav) so that repeated sounds only load once.

// How to use...
// autoLoad, autoP{lay, Streaming, default buffet
//soundChannel = new SoundFacade(ESNav,mySndFile,true,true,true,-1);
// or // autoLoad, autoP{lay, Streaming = NO, buffet = 1 s
// Plays when sound is fully loaded
//soundChannel = new SoundFacade(ESNav,mySndFile,true,true,false,1000);

// Tell when file is starting to load and can be played streaming
//soundChannel.addEventListener(flash.events.Event.OPEN,onLoadOpen);
// Tell when sound is finished playing
//soundChannel.addEventListener(flash.events.Event.SOUND_COMPLETE,onPlayComplete);
// Tell when load sends an error - NOT NEEDED
//soundChannel.addEventListener(IOErrorEvent.IO_ERROR,playDefaultError);

// Tell when file is fully loaded and can be played streaming
//soundChannel.addEventListener(flash.events.Event.COMPLETE,onLoadComplete);

// ... args allows for now the addition to more parameters...

// Set loop
//soundChannel.soundLoop = 30;
// Set transform
//soundChannel.soundLevel = myTransform;

package {

import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.events.TimerEvent;
import flash.media.ID3Info;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.media.SoundLoaderContext;
import flash.media.SoundMixer;
import flash.net.URLRequest;
import flash.utils.Timer;

/**
* Provides a slightly simpler interface to the sound-related classes in the
* flash.media package. Dispatches "playProgress" ProgressEvents and adds
* pause and resume functionality.
*/
public class SoundFacade extends EventDispatcher {

private var ESNav;
/**
* The Sound object used to load the sound file.
*/
public var s:Sound;
/**
* The SoundChannel object used to play and track playback progess
* of the sound.
*/
public var sc:SoundChannel;

/**
* The URL of the sound file to load.
*/
public var url:String;

/**
* The buffer time to use when loading this object's sound file.
*/
public var bufferTime:int=1000;

/**
* Identifies when the sound file has been fully loaded.
*/
public var isLoaded:Boolean=false;

/**
* Identifies when the sound file has been fully loaded.
*/
public var isReadyToPlay:Boolean=false;

/**
* Identifies when the sound file is being played.
*/
public var isPlaying:Boolean=false;

/**
* Specifies that the sound file can be played while it is being loaded.
*/
public var isStreaming:Boolean=true;

/**
* Indicates that sound loading should start as soon as this object is created.
*/
public var autoLoad:Boolean=true;

/**
* Indicates that sound playing should start as soon as enough sound data has been loaded.
* If this is a streaming sound, playback will begin as soon as enough data, as specified
* by the bufferTime property, has been loaded.
*/
public var autoPlay:Boolean=true;

/**
* The position of the playhead in the sound data when the playback was last paused.
*/
public var pausePosition:int=0;

/**
* Defines how often to dispatch the playback progress event.
*/
//public var progressInterval:int=1000;
// Disabled for Now!
public var progressInterval:int=0;
/**
* Defines the "playProgress" event type.
*/
public static const PLAY_PROGRESS:String="playProgress";

/**
* The Timer that's used to update the progress display.
*/
public var playTimer:Timer;

public var loadError:Boolean = true;

// Define the loop
public var soundLoop:Number = 0;
// Define the soundtransform (level, fade...)
public var soundLevel:SoundTransform = new SoundTransform(1);

/**
* Constructor.
*/
public function SoundFacade(navObj,soundUrl:String,autoLoad:Boolean=true,autoPlay:Boolean=true,streaming:Boolean=true,bufferTime:int=-1, ... args):void {
if (soundUrl != null) {
ESNav = navObj;
this.url=soundUrl;
// ... args
if ((typeof args[0] != "undefined") && (args[0] == "noError")) {
// Do not load Default Missing Sound
this.loadError = false;
if ((typeof args[1] != "undefined") && (args[1] == "loop")) {
this.soundLoop = Number(args[2]);
if (isNaN(this.soundLoop)) {
this.soundLoop = 0;
}
}
}
if ((typeof args[0] != "undefined") && (args[0] == "loop")) {
this.soundLoop = Number(args[1]);
if (isNaN(this.soundLoop)) {
soundLoop = 0;
}
}

// sets boolean values that determine the behavior of this object
this.autoLoad=autoLoad;
this.autoPlay=autoPlay;
this.isStreaming=streaming;

// defaults to the global bufferTime value
if (bufferTime < 0) {
bufferTime=SoundMixer.bufferTime;
}
// keeps buffer time reasonable, between 0 and 30 seconds
this.bufferTime=Math.min(Math.max(0,bufferTime),30);

// Stores playing sounds in object to skip reloading when possible
if (typeof ESNav.SoundsPlaying == "undefined") {
ESNav.SoundsPlaying = new Object();
}
if (typeof ESNav.SoundsPlaying[this.url] == "undefined") {
ESNav.SoundsPlaying[this.url] = new Sound();
if (autoLoad) {
load();
}
} else {
if (autoLoad) {
this.s = ESNav.SoundsPlaying[this.url];
this.isStreaming = false;
this.isReadyToPlay=true;
if (autoPlay) {
this.play();
}
}
}
}
}
public function load():void {
if (this.isPlaying) {
this.stop();
this.s.close();
this.pausePosition=0;
}
this.isLoaded=false;

this.s=new Sound ;

this.s.addEventListener(ProgressEvent.PROGRESS,onLoadProgress);
this.s.addEventListener(Event.OPEN,onLoadOpen);
this.s.addEventListener(Event.COMPLETE,onLoadComplete);
this.s.addEventListener(Event.ID3,onID3);
this.s.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
this.s.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onIOError);

var req:URLRequest=new URLRequest(this.url);

var context:SoundLoaderContext=new SoundLoaderContext(this.bufferTime,true);
this.s.load(req,context);
}
public function onLoadOpen(event:Event):void {
ESNav.SoundsPlaying[this.url] = this.s;
if (this.isStreaming) {
this.isReadyToPlay=true;
if (autoPlay) {
this.play();
// AT THIS POINT, we are ready to synchronize some action on stage with the sound....
// BUT PROBLEM... the sound starts playing after a short delay... WHY?
}
}
this.dispatchEvent(event.clone());
}
public function onLoadProgress(event:ProgressEvent):void {
this.dispatchEvent(event.clone());
}
public function onLoadComplete(event:Event):void {
this.isReadyToPlay=true;
this.isLoaded=true;
ESNav.SoundsPlaying[this.url] = this.s;
this.dispatchEvent(event.clone());

// if the sound hasn't started playing yet, start it now
if (autoPlay && ! isPlaying) {
play();
// AT THIS POINT, we are ready to synchronize some action on stage with the sound....
// BUT PROBLEM... the sound starts playing after a short delay... WHY?
}
}
public function play(pos:int=0):void {
if (! this.isPlaying) {
if (this.isReadyToPlay) {
if (this.s != null) {
this.sc=this.s.play(pos,this.soundLoop);
this.sc.soundTransform = this.soundLevel;
this.sc.addEventListener(Event.SOUND_COMPLETE,onPlayComplete);
this.isPlaying=true;
if (this.progressInterval > 0) {
this.playTimer=new Timer(this.progressInterval);
this.playTimer.addEventListener(TimerEvent.TIMER,onPlayTimer);
this.playTimer.start();
}
}
} else if (this.isStreaming && ! this.isLoaded) {
// start loading again and play when ready
// it appears to resume loading from the spot where it left off...cool
this.load();
return;
}
}
}

public function stop(pos:int=0):void {
if (this.isPlaying) {
this.pausePosition=pos;
this.sc.stop();
if (this.playTimer != null) {
this.playTimer.stop();
this.playTimer = null;
}
this.isPlaying=false;
}
if (this.isStreaming && ! this.isLoaded) {
// stop streaming
this.s.close();
this.isReadyToPlay=false;
}
}
public function pause():void {
stop(this.sc.position);
}
public function resume():void {
play(this.pausePosition);
}

public function get isPaused():Boolean {
return (this.pausePosition > 0);
}

public function onPlayComplete(event:Event):void {
this.pausePosition=0;
if (this.playTimer != null) {
this.playTimer.stop();
this.playTimer = null;
}
this.isPlaying=false;
this.dispatchEvent(event.clone());
}
public function onID3(event:Event):void {
try {
var id3:ID3Info=event.target.id3;

for (var propName:String in id3) {
trace(propName + " = " + id3[propName]);
}
} catch (err:SecurityError) {
trace("Could not retrieve ID3 data.");
}
}
public function get id3():ID3Info {
return this.s.id3;
}
public function onIOError(event:IOErrorEvent):void {
// Loads default MISSING sound...
trace("SoundFacade.onIOError: " + event.text);
if (loadError) {
this.s.removeEventListener(ProgressEvent.PROGRESS,onLoadProgress);
this.s.removeEventListener(Event.OPEN,onLoadOpen);
this.s.removeEventListener(Event.COMPLETE,onLoadComplete);
this.s.removeEventListener(Event.ID3,onID3);
this.s.removeEventListener(IOErrorEvent.IO_ERROR,onIOError);
this.s.removeEventListener(SecurityErrorEvent.SECURITY_ERROR,onIOError);
this.s = new Sound();
this.url="DATA/system/warnings"+this.ESNav.setup.Language+"/soundmissing.mp3";
load();
}
ESNav.SoundsPlaying[this.url] = this.s;
this.dispatchEvent(event.clone());
}
//==============================================================
public function onPlayTimer(event:TimerEvent):void {
var estimatedLength:int=Math.ceil(this.s.length / this.s.bytesLoaded / this.s.bytesTotal);
var progEvent:ProgressEvent=new ProgressEvent(PLAY_PROGRESS,false,false,this.sc.position,estimatedLength);
this.dispatchEvent(progEvent);
}
//==============================================================
// Set transform level
public function setTransform(trans):void {
this.soundLevel = trans;
var myTimer=new Timer(50,0);
myTimer.addEventListener(TimerEvent.TIMER,onTransformTimer);
myTimer.start();
function onTransformTimer(event:TimerEvent):void {
if (this.isPlaying) {
myTimer.stop();
myTimer.removeEventListener(TimerEvent.TIMER,onTransformTimer);
this.sc.soundTransform = this.soundLevel;
}
}
}
//==============================================================
// Fade up or down the transform level
public function fadeSound(level):void {
var myStartTransform:SoundTransform = this.sc.soundTransform;
// Fade sound to level
var myLevelEnd = level;
var startLevel = myStartTransform.volume;
var incr:Number = 0;
if (startLevel >= myLevelEnd) {
// reduce sound
incr = -0.1;
} else {
// increase sound
incr = 0.1;
}
var myTimer:Timer = new Timer(30, 0);
myTimer.addEventListener(TimerEvent.TIMER, onFadeTransformTimer);
myTimer.start();
// Do the fading
function onFadeTransformTimer(event:TimerEvent):void {
this.soundLevel = this.sc.soundTransform;
var myEnd = false;
if ((startLevel >= myLevelEnd) && (this.soundLevel.volume <= myLevelEnd)) {
myEnd = true;
}
if ((startLevel < myLevelEnd) && (this.soundLevel.volume > myLevelEnd)) {
myEnd = true;
}

if (myEnd) {
myTimer.stop();
myTimer.removeEventListener(TimerEvent.TIMER, onFadeTransformTimer);
myTimer = null;
if (myLevelEnd == 0) {
this.stop();
}
} else {
this.soundLevel.volume += incr;
this.sc.soundTransform = this.soundLevel;
}
}
}
// Return transform level
public function returnTransform():SoundTransform {
return this.soundLevel;
}
// Return position
public function returnPosition():Number {
if (this.sc != null) {
return this.sc.position
} else {
return 0;
}
}
}
}

Sound Delay After Button Push
Hi, I have made this little thing, its more or less just to try out some basic scripting, its a button that you would push and when you do so it would play a random sound out of six different sounds, and it does all that, but it delays the sound, so it has a short delay, does anyone know how to fix this?
Here is a link to the page where the button is (test page).
http://bjodeh.googlepages.com/sound.html
Thanks for all responses.

Here is the code:







Attach Code

button.addEventListener(MouseEvent.CLICK, playSound);

function playSound(e:Event)
{
var path:String = "sound" + Math.ceil(Math.random()*6) + ".mp3";
var s:Sound = new Sound(new URLRequest (path));
s.play();
}

Delay On Playing Sound In Actionscript 3 Problem
good day,

My problem is that everytime an object (obj1) hits another object (obj2) a sound will play instantly as the object collides, but the sound will played with a delay of .5sec .

Does anybody know how to make this play instantly?


- newbie here - ^_^


Thanks

Delay: Need Escapable Time Delay Actionscript2.0 Function (Flash8Pro)...
Hi,

I am brand new to Flash 8 Professional. I have many year experiece as a Visual C++ programmer, but am having some troubles learning to code in Actionscript2.0...

I wish to have an Actionscript2.0 function that does the following:
Delay for x milliseconds, but if user clicks mouse in Flash document then delay is immediately over.

Can someone with experience give me some hints on how to code this in Actionscript2.0? I am using Flash 8 Professional.

Thanks in advance!

P.S. - Working on a Flash Tetris game called "TetriCrisis100%".


JeZ+Lee
Silent Hero Productions

Inconsistent Animations
http://hotelsantafeguam.com/new/open.htm

is the url to the site that I am having problems with

click the button to enter the site then click "Rooms"

click "single" or "double" then click "Rooms" again - notice how the room movie doesnt close

but if you click "Rooms" once more - the room movie closes.

Now try clicking "single" or "double" then click rooms again - notice how this time the room movie closes.

The second time is the desired effect that I was going for on the first instance of clicking on rooms - but somehow it will only work after going through this process. Can someone have a look at my fla and see if they cant figure out what I have done wrong please?

http://hotelsantafeguam.com/new/movie2.fla

Inconsistent Preloader
Hello. I have a flash site with a preloader that works most of the time. The file/site is enormous (4.3M). Because it takes so long to load, the client wanted quotes in the preloader. There are four total, after each one there is a little bit of code that says, if you are done loading, play the movie. (Code listed below.) This is what happens everytime I look at it, in fact I have a fast connection, so I only ever see one quote before the movie loads.

Apparently, on some computers, the preloader goes through all four quotes and then just sits without loading the movie. The user can then just press refresh and the site will start right away without the preloader at all. So basically, this may be that the site takes so long to load that it breaks the connection?

Most importantly, it is inconsistent. It doesn't always happen on the same computer, the same browser, operating system, anything.

Any thoughts? Other than make it smaller?

(I know there are lots of ways to make it smaller. It was a poorly made template bought from perfectory and the client didn't want to make anything load externally, I have tried any number of suggestions, but he is completely happy with waiting.)


Here is the URL:
http://www.crphotography.com/


Here is the CODE:
The preloader is in a mc, with the instance name of ball_mc, on the main timeline.

Starting on frame one and continueing through all of the frames of the preloader mc is a box offscreen with this code:


Quote:




onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.ball_mc.allDone = "OK";
}
}





After each quote disappears this code is in an actions layer:

Quote:




if (allDone == "OK") {
_root.gotoAndPlay(11);
}





On Frame 12 of the main movie timeline, those four images fade away and on with the show...

Any help is greatly appreciated!

PippyLu

[F8] HELP Why Is My LoadVars Inconsistent With Php?
I have a few different php documents throughout my site...each loading variables into my flash document. I'm using loadVars to make this happen going something like this:

Code:
var loadPhp_lv:LoadVars = new LoadVars();
loadPhp_lv.onLoad = function(success:Boolean):Void {
if (success) {
loadedVar = loadPhp_lv.phpVar;
} else {
trace("ERROR");
}
};
loadPhp_lv.load("http://www.mydomain.com/myphp.php",loadPhp_lv,"GET");
The issue is once all of the documents are uploaded to my server, the loadVars is inconsistent. It will work on all of my computers in the office (MAC & PC) using any more common browser.

But, it won't work on my computer at home (PC/IE7,FF2) or some other computers I've tested. I know I'm not using any local files...so this just doesn't make sense to me. Also, when I just type the address for the php document into a browser (http://www.mydomain.com/myphp.php) I get the correct response (&phpVar=variable)...so it's not a server-php compatibility issue.

Am I doing something wrong? Has anyone else experienced this problem? Any solutions?

BottomScrollV Inconsistent
Looking at the attached file, why does bottomScrollV give me the wrong value when the text is dynamically embedded and correct when manually embedded?

Here's the code:

ActionScript Code:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoad);
loader.load( new URLRequest("info.xml") );

function onLoad(e:Event):void
{
    var xml:XML = XML(e.currentTarget.data);
   
    _txt.condenseWhite = true;
    _txt.htmlText = xml.entries.entry.main;
    _txt.embedFonts = true;
    trace ("_txt.bottomScrollV = " + _txt.bottomScrollV );
   
    _txt2.condenseWhite = true;
    _txt2.htmlText = xml.entries.entry.main;
    trace ("_txt2.bottomScrollV = " + _txt2.bottomScrollV );
}
output:

Code:
_txt.bottomScrollV = 4
_txt2.bottomScrollV = 5
And the textfields look exactly the same.

Inconsistent Printing From An FLA
I am Using Flash MX and Flash 2004.

When I insert jpgs into a keyframe and then try to print out that page while I am editing the FLA, I get strange results.

Sometimes the jpg prints blank sometimes it is solid blackand sometimes it prints perfectly. This is true if it is a jpg, broken apart, a graphic, or a movieclip.

any ideas?

Thanks,

Inconsistent MP3 Playback
Hello,

I created a music.swf to control the playback of an mp3 that is included in the document's library. The mp3 is set to export for ActionScript, it's got an identifier,etc. ... I'm calling it into play with the soundAttach function in a script in the first frame of the swf. When I test the movie by itself, it works great. The mp3 starts playing automatically, and the stop and play buttons function as planned.

But when I load music.swf into another swf (through a loader component), the music won't play. I was hoping someone could explain why this is happening. Any suggestions? Thanks.

Help - HitTest Inconsistent
Hi,

I need to sort this out quite quickly so would appreciate any help possible.

I am having trouble with hitTest. Sometimes it registers a hit on the object, sometimes it doesnt. And worse, it often registers a hit when no where near the object!


I have included the FLA & SWF below.

flash file (230kb)

swf

thanks in advance

Inconsistent Code
Hey everyone...

I'm trying to do something seemingly simple -- Swap Depths of MCs but I'm getting very sporadic behavior.

I have four MCs which should come on top of each other when a cooresponding button is released. I have the following code:

Code:

// Import
#include "mc_tween2.as"

// Global Variables
var onStage:MovieClip = new MovieClip();
onStage = demo.formal

// Formal Wear
formBtn.onRelease = function() {
   demo.formal.swapDepths(onStage);
   demo.formal.getNextHighestDepth();
   demo.formal._y = - 400;
   demo.formal.ySlideTo(0, .5, "easeOutQuad", 0, function() {onStage = this})
   trace(onStage)
}

// Casual Wear
casBtn.onRelease = function() {
   demo.casual.swapDepths(onStage);
   demo.casual.getNextHighestDepth();
   demo.casual._y = - 400;
   demo.casual.ySlideTo(0, .5, "easeOutQuad", 0, function() {onStage = this})
   trace(onStage)
}

// Outerwear
outBtn.onRelease = function() {
   demo.outer.swapDepths(onStage);
   demo.outer._y = - 400;
   demo.outer.ySlideTo(0, .5, "easeOutQuad", 0, function() {onStage = this})
   trace(onStage)
}

// Athletic Wear
athBtn.onRelease = function() {
   demo.athletic.swapDepths(demo.formal);
   demo.athletic._y = - 400;
   demo.athletic.ySlideTo(0, .5, "easeOutQuad", 0, function() {onStage = this})
   trace(onStage)
}
   

If you keep clicking, it'll work every so often but not all the time. What could the issue be? The traces seem to be working according to my logic so maybe I'm missing something?

Inconsistent LoadMovieNum Behavior
State of the app:

A movie that relies heavily on loading and unloading external clips into designated levels via loadMovieNum/unloadMovieNum.

When running in a frameless browser window by itself, this app behaves as expected in the player -- movies are loaded into levels and they automatically play.

Problem: When running this same app in a frame in a frameset (with Flash content running in another frame), these level-loaded movies do not automatically play as expected. Proof of this is right-clicking on the player and selecting 'play', which forces the expected clips to start.

Why, under this different context, does the player appear to stall out?

What, if anything, can be done to force the player to behave as expected?

Thanks!

Inconsistent Variable Error
I'm hoping that some of you Actionschript gurus can help me out with this one. I'm building a new site for my company entirely in Flash, and its going fairly well - until now. I have 2 scenes in my movie. I am editing the second scene. I have 6 buttons on the stage, instance names 6clip through 1clip. Each button expands to show a menu, so on each button I have a layer called actions, and on one keyframe in this layer I set a variable called 6down = false; The number of each of these corresponds to the number of the button. On another keyframe in the actions layer I set 6down = true; When I export the movie to look at it (Ctrl + Enter) I get the output window, stating that Flash expected to see a ; on these code lines. Here are the catches - All of the code lines are identical, except for the number in the variable. All of the code lines ALREADY have a ; , and I don't get the error for ALL of the buttons. Only 1-3. Sometimes its only 1 & 2. Am I having a memory issue? Someone please help...I don't think I've coded wrong! P4 1.8 GHz, 512M RAM, Flash MX. Thanks!

The Dark One

Inconsistent Audio Playback
Hi There

http://www.leevodra.com/sandbox/audioTest.html

This is the first time I've really dealt with audio of any duration. I'm doing the site for a hearing research group and there are all of these sounds that I'm putting onto buttons.

User clicks on a button and the sound plays. It's important that they play clearly and consistently each time.

Problem is that they don't.

There seems to be interference in ninety percent of the cases. It's in mono, but it seems that there's a shift, not between left and right, but like it's being played in a really echo-ey room. Sometimes it's really clear.

Has anyone run across this and does anyone know how to fix it?

Thanks,

Lee

Inconsistent Behavior With UIScrollBar
Gang,

I am a Newbie to Flash but not to coding and am currently implementing a UIScrollBar (in accordance to documented best practices). Alas, I am experiencing inconsistent behavior.

The scenario is that I am loading XML data and assigning required text to the required dynamic text objects. [Mostly] everything functions as expected with the following behavior (which I can not live with) states that are irregular.

1. sometimes text does not scroll as expected;
2. sometimes text scrolling is incomplete (only scrolls a portion of the text).

My instincts tell me that it is an Event-driven issue but this is the least documented component out of the entire inventory available. It could also be that I do not understand how these components fire and in what order.

Scrollable text only appears in the predominant screen and a secondary screen.

I have coded a variety of methods to stay within the confines of my screen appearances within the scene (statically placing the component onto the screen or coding them to dynamically appear as required). Neither yields a consistent well-behaved applet.

I am attempting to code a consistent expected behavior in that when the initial text appears that requires scrolling that it is guaranteed to scroll and scroll completely. The same applies to the secondary screen.

Problem is (as always) time (i.e. I am out of it). What have you all done to eliminate such erratic behavior? I sure would appreciate any of your thoughts and experiences. TIA

Best regards,
Alex

Volume On A Button - Too Low, Inconsistent
Hi All - I'm doing something very simple (for the first time) adding a sound to a button on the 'over' state. I've looked in the threads here and didn't see any that match my issue.

I have a .wav file of a button clicking (downloaded from SoundRanger) which does play as expected except for two things.

First, the volume is MUCH lower than it sounds when I play the sound from the 'edit' window. I have no other sounds or any sound controls, so my default should still have volume set to 100 (I'd guess?). Also the volume in the edit window is at the top, so I haven't accidentally turned it down there...

Second, the pitch is lower when placed on the button than it is from the 'edit' window. So instead of a 'zip' its a 'zuuuppp' - its subtle but noticeable.

I've followed the instructions in 'Flash MX 2004 - Savvy' on how to add sounds to a button and am running MX 2004 Pro on Windows XP.

Any help with this matter is much appreciated! thnx --bp

Inconsistent Score Recording
I am having problems getting scores to record correctly (I.e., consistently correct) with an actionscript that sends quiz scores to a file. 90% of the times the scores are recorded correctly. But: (1) Sometimes nothing records even though a user can show me a screenshot that shows they successfully completed an quiz; (2) Other times, a score of 100% might record as a score of 50% (again a user can show me a screen shot that says 100% from the final Flash screen). I can't find any pattern to why the errors occur. I am not very familiar with this forum so I don't know where to start looking for answers. All suggestions for why actionscripts might work only 90% of the time would be appreciated.

X-pos Of Mc Inconsistent W/ Property Panel
Hello,

If I draw a square and make it a movieclip, then I go into the movieclip and move that its x position is something like -100 or something. Now go back to the main movie and place this MC onto the stage at x position 200.

Now name the instance test. go to first frame and type "test._x = 200"

The predictable response is that the MC will stay where you placed it since you placed it on x=200 in the developing environment and you're telling it x=200 in actionscript. But the end result is that, if you run it, it will put it in a different spot.

I think what's going on is that it's lining up 200 w/ the little cross of the MC (whatever you call it.. the x=0 y=0 point inside the MC). But the problem is that if actionscript is going to do that, then I want Flash (in the properties panel) to show me the same thing too!

Even if I go into the "info panel" and click the little center thing instead of the top left hand corner thing, it is still a little off... Why is this?

Thanks.

~j.

Copyright 2005-08 www.BigResource.com, All rights reserved