ActionScript 2.0 :: Handle Two Separate Sound File?

Feb 9, 2010

I am facing a problem with multiple sound file in one flash file. I have added a background music in my flash and on one of the page, I have published a video. However both sound files are clashing with each other. If I will do stopAllsounds(); on the video frame then while moving on next section the sounds still remains stop.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: SoundManager - Pausing Sound By Referencing Code In Separate File?

May 22, 2009

I wanted to have this Zombie Penguin enemy use a walk sound (it would be odd if he moved and was silent) but because it is initializing the whole world, simply coding the sound into his animation state won't work because it will play the sound for every existing Zombie Penguin in the world, not just the one on the screen.

Now I've tried to get around this problem by using a SoundManager class [URL] to load and play/pause the sound when necessary. I've got this working by placing a movieclip above the world and hittesting everything and when it finds a Zombie Penguin activates the SFX. If it finds the enemy and you leave the room or kill the enemy (basically any way it is removed from the screen) it will pause the sound (not stop) and then unpause if you go back/find another instance of that enemy.

The problem is, though, that if I STUN the enemy (not kill it) it plays it's dizzy animation (which consists of hit sitting down with stars spinning around it's head) the walking SFX continues to play as the enemy is still on the screen.Now in the Zombie Penguins .as file it has a boolean that for being stunned or not (bStunned), and a function (public function getZPStun():Boolean -- returns bStunned). this bStunned boolean is set to a default of false.I figure that I just have to reference that somewhere in the following code, but I'm not sure where. The Zombie Penguin's .as is ZPEnemy, so I'm calling it like so:

ZPEnemy.getInstance().getZPStun()

I've tried calling it as part of an if statement a in a number of placesin hopes that calling it will relate the current state of the bStunned boolean, but I can't seem to get it to work.

Code:

var bNotPenguin = true;
for(var i = 0; i<this.numChildren; i++) //** Sound Manager Coding (May 15)
{

[code]....

View 4 Replies

Media Server :: Use A Separate Video Hosting Company To Handle My Mobile Videos?

Dec 14, 2010

- Is there a benefit to hosting FLV files on a Flash Media Server when they are under 2-3 minutes?I've been working on a couple different video projects as of late... some are simple web player with 30 second ads and others are working with longer videos like 2-3 minutes. I currently have an FLV hosting provider running Flash Media Server but with videos so small don't they download for the user as progressive anyway and there is no real benefit whether I am using my FLV host or my traditional web host?

i also use a separate video hosting company to handle my mobile videos mainly because I am a bit naive on how that works as well. I had a project with straight links to play video on mobile phones (with three different version served up based on OS). But it seems like most of those were progressive downloads as well.

View 1 Replies

ActionScript 2.0 :: F8 - Attach Sound Object To A Separate Mc To Control Independently From All Other Sound / Root Volumes

Mar 15, 2008

I have been at this for about 19 hours straight! I am going to go to bed immediately after this post, but for crying out loud, I have NEVER had this problem before today! Before anyone reads ahead and says 'you have to attach your sound object to a completely separate mc to be able to control it independently from all other sound/root volumes.' see if the following code accomplishes just that:

[Code]...

View 2 Replies

Actionscript 3 :: Menu Bar Control In Flex , Handle Separate Method For Individual Menu Item?

Jun 26, 2009

i need to fire separate method for individual menu item clicked ,so that individual item can handle separate method.and i need know what all the properties are available in menu item like type="radio".

<mx:MenuBar id="jj" labelField="@label" itemClick="MenuItemClick(event)" x="23" y="228">
<mx:XMLList>
<menuitem label="File">[code]......

View 2 Replies

AS2 :: Handle Missing Sound Card

Feb 25, 2010

In my AS2 Flash game, I play a number of sound files and wait for the "onSoundComplete" message/function before proceeding.The problem is if there is no sound card in the system (or it is disabled in device manager) - everything acts like it is working (no errors, onLoad handler gets "true") - but the sound never actually gets played, and as such, my event never gets triggered.I had planned on dealing with this by hooking into my sound code, and if I detect no sound card, just kick off a timer to wait a few seconds before manually firing the "onSoundComplete" function.The only problem is that I can't reliably find a way to determine if there is a sound card in the system! AS3 seems to handle this quite nicely by passing back a NULL soundchannel - unfortunately I am stuck in AS2.0

View 1 Replies

ActionScript 3.0 :: Get A Handle On Embedded Sound Files?

May 7, 2009

From the Sound Class information, it says to use the SoundMixer Class to handle embedded Sound Files.  I have two sound files embedded, that I have setup in 2 separate layers, starting at frame one in the main timeline.  I needed to do this so I could see the wave files, and coordinate text with the waves.  I do not want to load these files into the .swf file at runtime using URLRequest.  How do I get a handle on those as they exist, to make each controllable by separate volume and mute controls for each sound?
 
This will be a challenging question, because, "it can't be done" doesn't work for me.  I managed to create a way to use an external classfile to control the main timeline, the ROOT timeline, without having to create a sub movie to root.  I can use my component to call play(); as though it were in code in a frame.  But it isn't, it's in an external classfile.  I passed root to the classfile and told the classfile to think of it as a movieclip - that put the handle on it.  I tried similar way with root as a Sound, but that isn't detailed enough - I need to get a handle on the frame that contains the embedded sound file.  I embedded, attached it, using the properties view for the frame.
 
I've attached, or whatever you want to call it, these sound files to a frame, and this frame is or should be attached to the layer I've created.  So, under the assumption that the ROOT has everything attached to it in some manner (it is after all the foundation for the COM), the stage of the root contains the visual components, so ROOT has to have the layer objects attached to it, which should have the frame objects attached to the layers.  I have two layers that each have a .wav file attached to frame one.  Somehow Flash keeps track of that - I want to know how Flash does it so I can read what flash reads.

View 1 Replies

Actionscript 3 :: Create Global Classes - Handle Sound?

Jan 20, 2012

I know global variables are supposed to be bad but is it possible to create global classes? I am creating an application and I want to have one class that handles sound. From any class I would like to be able to say soundhandler.playSound(); without having to pass references all over the place. It should just know it is there.

View 1 Replies

ActionScript 2.0 :: Handle Multiple Sound Through One Volume Slider?

Sep 24, 2004

[URL]

can i handle multiple sound through one volume slider by passing parameters and MC instance name?

View 1 Replies

ActionScript 2.0 :: How To Get Sound In Separate SWF

Mar 29, 2003

One thing bothers me when I visited one site. I noticed that the sound is in a separate swf, how did they do that? [URL]

View 2 Replies

ActionScript 2.0 :: Loading Sound From Separate .SWF?

Dec 5, 2007

I know it has been done in Madness Interactive, which I did check up on and looked through the code and found nothing, as well as Googled a bunch of stuff, and still nothing.

View 3 Replies

ActionScript 3.0 :: Controlling Sound From A Separate Class

Apr 7, 2009

Is it possible to start and stop a sound file from a separate class? In the first class, "House", I have called the MP3 using the following:

[Code]....

View 1 Replies

ActionScript 3.0 :: Controlling Sound From Separate Class?

Apr 7, 2009

Is it possible to start and stop a sound file from a separate class?In the first class, "House", I have called the MP3 using the following:

Code:
public var mySoundReq:URLRequest = new URLRequest("tune.mp3");
public var mySound:Sound = new Sound();

[code]......

View 1 Replies

ActionScript 3.0 :: Play A Sound File And Show The Progress Of The Sound File Being Played

Mar 16, 2009

I have to play a sound file and show the progress of the sound file being played. I am using import flash.media.Sound; import flash.media.SoundChannel; But the PROGRESS event gives theprogress of loading of file. I want to know of much of the song has been played and how much more is left.

View 3 Replies

ActionScript 2.0 :: Multiple Sounds - Creating Separate SWF Files To Represent Each Sound

Sep 20, 2002

I've created a small application that links various Sound Clips to corresponding Sound variables, and the individual start and stop commands work fine. However, when I try altering the volume, the controls affect all the sounds in the movie. I'd like to refrain from creating separate SWF files to represent each sound, but I will if I have to.

View 1 Replies

ActionScript 2.0 :: Flash Scrollbar Gallery - Replace The Rectangular Handle With Own Customised Handle

Feb 6, 2010

I'm creating a scrollbar gallery from a tutorial on this site. Though I've completed the tutorial, and customised the gallery to my own needs, however I'm trying to make a very small change to it - and no matter what I do, keep running into problems. I'm trying to replace the rectangular handle with my own customised handle - a (20 x 20) 'circular' png image that I've imported into Flash, made a graphic and stored in the library (though I understand it can be imported using actionscript, like the other images in the gallery).

[Code]....

View 7 Replies

ActionScript 2.0 - Flash - Export From .fla File Symbol's (frames) To Separate File And Use It

Nov 17, 2011

I am very new to ActionScript. I have a .fla file which contains the AS2 code for the frames. What I need to do is that I have to export this code as a separate file. There may be a separate file(or class file) for each frame code. Is it possible to me do it automatically without losing animation interactivity and functionality? Or is there any other way?

View 1 Replies

ActionScript 2.0 :: Export Text From A Flash File Into A Separate File?

Mar 22, 2006

Is it possible to export text from a text field, which has been created in Flash and export it into an external file such as a text file or Word document?The idea is that information will be collected by the user into a text field within the swf. Hopefully, this information can then be exported into an external file which will allow the user to work on and edit at a later stage. It needs to be a separate editable document. Is this possible? I'm using Flash 8.

View 1 Replies

Flash - How To Handle Large MXML File

Mar 8, 2011

I am currently working on the largest Flex / Flash Builder 4 application I have ever built. I am acustomed to keeping all of my MXML programming in one file. What are some best practice procedures for keeping large MXML files readable?

View 4 Replies

Handle Cue Points In An Audio File (from Microphone)?

Mar 30, 2011

I'd like to record audio from a microphone and I'd like the user to be able to add cue points during the recording so when he loads the file afterwards, he can jump easily to a specific position.

I don't really know what file format I should use and how to store the metadata (cue points)

I thought about

encoding a wav/mp3 and stores metadata in a .cue file (easy to do but 2 files to store)storing XMP data in a mp3 file (seems a bit harder but standard metadata embedded in 1 file)flv/f4v with audio only and standard cue points but I'm not sure I can create them directly from the client

View 3 Replies

ActionScript 3.0 :: Combine Separate .AS File And .FLA File

Feb 23, 2010

I am wondering why is there a seperate as file in a zip I downloaded? There are the files slider.as and slider.fla. There is only one frame in the fla file and I was wondering if I can combine the fla and as file to make it work, since I will be combining it with another file. This is the Slider.as file:

[Code]....

View 2 Replies

ActionScript 3.0 :: Controlling Sound Of Separate Html Files Within Same Html Page

Sep 11, 2010

I need to allow users to preview audio files for purchasing. I have CF pages that return records form a SQL database. Each record contains the same swf file however, each swf file points to a different mp3 for previews of different audio examples. So far, everything is working fine. My problem is that I need to be able to stop the sound from one swf when I click to play a second swf .The only solutions I see in Flash forums deal with loaded swf files. These are not loaded files they are separate files within a page. The question is: How do control one swf from another swf in the same page.The following items have not worked: soundChannel.stop();,soundMixer.stopAll()

View 2 Replies

Actionscript 3 :: Handle An Event In A File That Was Dispatched From A Mobile Spark Component

Jan 11, 2012

I have an mxml file called HomeView.mxml in a mobile app built using Flash Builder 4.6. In that HomeView.mxml I have an HSlider, which is dispatching events when the thumb is moved. What I'm trying to do is to listen for that valueCommit event in an .as file elsewhere in the project.

Whenever the thumb moves, an event is dispatched in HomeView.mxml:

hSlider.dispatchEvent(new FlexEvent("valueCommit", true));

I can handle that event in HomeView.mxm, but not in an .as class called view.as

In view.as I import the FlexEvent and I then have, in addedToStageHandler:

stage.addEventListener(FlexEvent.VALUE_COMMIT, commitHandler);

Then there's a simple Handler:

private function commitHandler(e:FlexEvent):void
{
trace("committed!");
}

But this code never runs. I do have a handler in the HomeView.mxml file which handles the event, but for other reasons I need to handle it in view.as as well.

View 1 Replies

ActionScript 3.0 :: WAV File - New Sound.extract() Function To Get Two Seconds Of A Sound Into A ByteArray

Nov 11, 2009

I'm having some trouble getting the following code to work - trying to use the new Sound.extract() function to get two seconds of a Sound into a ByteArray, and then create a new bytearray with a WAV header, and then output the file. The resulting 'test.wav' file sounds very wrong although slightly recognisable? I think I may have some of the WAV header settings may be wrong but I'm not quite sure what's the matter and after a long time scratching

[Code]...

View 5 Replies

Actionscript 3 :: HTML: Start Sound Playback From URL Mid-file Without Buffering All Sound Data To That Point?

Nov 21, 2010

I have a long mp3 file hosted on a standard apache server (30 minutes long so far, but I would like it to work with longer sounds too).I'd like to start playback of this audio within at a specified point. When attempting to use Flash Actionscript 3, my basic tests show that ALL the audio from the start to the position I choose is buffered before playback (Sound.bytesLoaded was my friend here). If I start one second in, it takes about 3 seconds to start playback, 30 seconds in, takes about 25 secondsObviously with a really long mp3, like skipping playback to the middle of a 3-hour audiobook, this isn't going to be practical.Here's the ActionScript 3.0 code I'm using:

button.addEventListener(MouseEvent.MOUSE_DOWN, function():void {
var s:Sound = new Sound();
var req:URLRequest = new URLRequest("http://example.com/audio.mp3");

[code].....

View 1 Replies

ActionScript 3.0 :: Separate (.as) File From .swf?

Jun 13, 2011

I don't know how to separate actionscript(.as) file from .swf

View 1 Replies

ActionScript 3.0 :: Create Dynamic Sound To Play Sound-file?

Oct 14, 2009

It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.

But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!

View 9 Replies

ActionScript 3.0 :: Assign 5 Separate Dynamic Text Fields To 5 Separate Buttons?

Apr 18, 2010

What I need to do is assign 5 separate dynamic text fields to 5 seperate buttons and at the same time to those same five buttons i would like to add 5 images that i would  be able to change merely by swapping out the images in the file theyre in on the server.I would also like to get a nice transition between the images...ALSO i want to dynamically load the images for the buttons that will be used for switching from picture to picture(which im thinking i will be able to do after i know the how to do point the aforementioned things.) 

Through tutorials I've found around the net I've been able to get most of the parts together... but i get lost because what they show you for AS2 they don't for AS3 and vice versa, at least that ive seen.so... I guess my question is... would i need to set up 5 seperate dynamic text fields on the stage and then set each one of them to one of the corresponding button. If so what AS code would i need to use to do so.  And if not what would i need to do?
 
The other part of the question would be I know about the UILoader... would i be able to use it as my buttons and images, if so would i need 5 seperate ui loaders for both the Thumbnail buttons and the images or is there a way that would be better to do it?  and once i do that would i do the transitions using frames and tweens like with AS2?

View 2 Replies

ActionScript 3.0 :: Using A Preloader In A Separate File?

Apr 28, 2009

I've appropriated a preloader I created previous where it existed on the main timeline. For my new project, I placed it in an external AS file, but something's off. I keep getting this error message, referencing line 16 in my line of code:"1046: Type was not found or was not a compile-time constant: Event."

The code is below:
package {  import flash.display.MovieClip; import flash.events.Event.ENTER_FRAME;  import flash.events.MouseEvent;  import

[code]........

View 10 Replies

ActionScript 3.0 :: Calling A Separate .swf File Within Another Swf?

May 23, 2010

I am trying to make a website that you can press a link in flash that opens up a external swf file within the same area but in a overlay effect... similar to lightbox image viewer.
 
I have linked in already with the requestURL function but that just opens in a browser window.

View 8 Replies







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