ActionScript 3.0 :: Simple Load Sound Within A Class File?

Nov 19, 2009

Does anybody have a simple "load sound" example to show me the proper way to load the sound within a class file?

I tried

ActionScript Code:
import flash.events.*;
import flash.media.*;

[Code].....

Quote:

1067: Implicit coercion of a value of type String to an unrelated type flash.net:URLRequest.

I also tried declaring a "loader" variable, and then setting my sound variable to = my load variable, but that didnt work either ....

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Load And Play A Sound From Within A CLASS Definition File?

Aug 3, 2009

I need to know how to load and play a sound from within a CLASS definition file. I know the normal way of doing this, but Flash MX rejects that syntax, so there must be some special way of using sounds in a class file.

I need to know how to code for "if the score increases by any value." So, if the score goes from 0 to 1, the sound plays ONCE. If it increases from 1 to 2, the sound plays ONCE again.

View 0 Replies

Professional :: Simple Sound Player - Visitor To Hear The Sound And Be Able To Apply Simple Controls?

Aug 1, 2011

Flash is not in my toolset, but I am an old Director jock and have spent some hours dipping my head into the Flash manual.  I suppose that makes me a promising beginner-level poster. I'm working in CS5.
 
I need to make a simple Flash-based sound player for a website for a newly-released novel (http://www.bearriverbooks.com/index.html).  I want the user to click on what appears to be an icon (or image), which kicks open a simple controller and starts playing a sound file (a radio interview, which I will probably export using Flash's voice compression).  Nothing fancy.  Just want the visitor to hear the sound and be able to apply simple controls (stop/start/rewind/volume).
 
I can learn ActionScript, I suppose, since I used to dream in Lingo, but my life would be a lot simpler if I could just publish a controller without having to roll my own.  I'd like to think there's a magic button somewhere that can do this, but I haven't found it yet.

View 4 Replies

ActionScript 3.0 :: Error #2000 Can't Load A Simple Swf File

Jun 18, 2011

Actionscript Code:

import flash.events.MouseEvent;import flash.net.URLLoader;import flash.net.URLRequest;var homee : Homee = new Homee;var pagsegurooo : Pagsegurooo = new Pagsegurooo;var duvidass : Duvidass = new Duvidass;var carregador : Loader = new Loader;var arquivo : URLRequest;btn_duvidas.addEventListener(MouseEvent.CLICK, cClick);btn_home.addEventListener(MouseEvent.CLICK,

[code]....

View 2 Replies

ActionScript 3.0 :: Error #2000 Cant Load A Simple Swf File

Jan 30, 2012

Actionscript Code:
import flash.events.MouseEvent;import flash.net.URLLoader;import flash.net.URLRequest;var homee : Homee = new Homee;var pagsegurooo : Pagsegurooo = new Pagsegurooo;var duvidass : Duvidass = new Duvidass;var carregador : Loader = new Loader;var arquivo : URLRequest;btn_duvidas.addEventListener(MouseEvent.CLICK,

[Code].....

View 7 Replies

ActionScript 2.0 :: Randomly Load A Simple Quote From An Xml File

Feb 14, 2008

I am trying to randomly load a simple quote from an xml file. Here is my AS:

[Code]...

I can't figure this out. Probably because I really don't know what I am doing.

View 2 Replies

ActionScript 3.0 :: Create A Simple List Menu That Will Load .swf File Is A Scrolling Panel?

Feb 4, 2010

I'm trying to create a simple list menu that will load my .swf file is a scrolling panel.

////////////////////////////////////////////////////////////////////
import fl.controls.List;
import fl.data.DataProvider;
import flash.net.navigateToURL;

[code]....

View 2 Replies

ActionScript 3.0 :: Class Is Loading The File But When Return It To A New Xml Object In The Document Class It Doesnt Load It?

Aug 18, 2009

I found myself loading a new XML file every day and so decided to create a small class that will load the xml file and return it.The class is loading the file but when i try to return it to a new xml object in the document class it doesnt load it.I think that it's something to with the return being in a nested function but i tried a few ways and non seems to work.
 
[DOCUMENT CLASS]
loadXML:LoadXML = new LoadXML();
myXML:XML = new XML(loadXML.loadXMLFile("gallery.xml"));[code].....

View 1 Replies

Flash8 :: Simple Sound On / Sound Off Button

Nov 10, 2011

basically i simply want to give the option of turning of the sound in my flash via a button (If you press it sound goes mute, press it again sound unmutes) I searched around in the tutorials but i could only find (for this purpose) complicated pan sound control stuff.

View 1 Replies

ActionScript 2.0 :: Load This Sound File Into The Flash?

May 9, 2007

For example, I have a sound file in the same folder of my FLA/SWF. How can I load this sound file into the flash?

View 1 Replies

Actionscript 3 :: Load SWF Data Without Loading Sound, Then Load Sound Later?

Jan 2, 2011

I have an SWF that's 30MB. Sound files (music) make up 25MB, art and other things make up the remaining 5MB.

Would it be possible for me to load the 5MB of necessary art and other things first to allow the user to operate the app, then after that's all loaded and they are operating the app, load the remaining 25MB of sound files in the background?

UPDATE: Loading SWF (or other entities) externally is not an option.

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 3.0 :: Simple Roll Over Sound CS4

Oct 2, 2009

Im trying to do a simple roll over sound on a nav button for my website, I thought this would be simple, iv got loads of simple code like

[Code]....

Which I imagine works perfect, but I cant find where I give the sound in my library the instance name "my_sound" or whatever ?

View 1 Replies

ActionScript 3.0 :: Class - Load The Audio File In Frame

Oct 10, 2009

I made a doc class and a sound class. the sound class purpose is that if ever add sound i can just recycle easily the code to use and via the doc class just load it intot he correct frame. Issue: I made the sound class and it loads correctly for the first frame... But i want to add ANOTHER audio file, how would i alter my code setup so i can load the new audio file but instead on frame 1 always... i want to be able to load the audio file in frame 3 or 5 or 25.... How do i do that with the code i have setup??

[Code]...

View 1 Replies

ActionScript 3.0 :: Sound Class Type - Cannot Convert C$ To Flash.media.Sound

Oct 25, 2009

I have some sounds in my library. They are all exported and have been given class names like C, D, E etc. I have another class that represents a button. This class stores a reference to one of the Sound in my library. I set the type for this variable to Sound. When I try to set it I get the error: cannot convert C$ to flash.media.Sound I try as Sound, for example key.note = note_array[p] as Sound; The value ends up as null.

View 2 Replies

ActionScript 3.0 :: Load A File Over The Local Network With Loader Class?

Aug 24, 2011

I try to load a file over the local network with Loader Class but I get the error "URL Not Found". I use a path like this  "file://///myPCnetID/pubilcFolder/pictures/mypic.jpg" which refers to a folder on the same PC I compile and run the Air flash file.
 
When I copy the adress into the browser the jpg-file ist displayed corretly.

View 6 Replies

ActionScript 3.0 :: Advanced Sound - Missing Properties Not Available In The Sound Class

Apr 23, 2010

I use this class as a base for all my streaming sound. It gives you two missing properties not available in the Sound class: a reliable soundchannel always available for referencing and a latency value indicating how long it took for your last call to play() to actually play the sound. I'll probably post it on my blog when I get the time but here it is:

[Code]...

View 8 Replies

ActionScript 2.0 :: Random Sound Load And Start Is Speeding Up The Sound?

Dec 16, 2005

I'm trying to load sound dynamically into a clip and then play it randomly. The AS I came up with works great if the sound is embedded and I use the .attachSound() method instead of loadSound(). Now, when I load it dynamically and use the code below, the sound plays very fast and at a higher pitch.

Code:
var crows = new Sound(this);
crows.loadSound("Raven.mp3", false);
crows.setVolume(100);

[Code].....

View 1 Replies

ActionScript 2.0 :: [FMX] LoadSound - Sound To Keep Playing While The Rollovers Load Sound

Jun 22, 2003

I am loading small sounds dynamically with the loadSound command. These small sounds are activated with a rollover. see script below. This works ok. however. i want the first sound to keep playing while the rollovers load sound. a bit like playing the piano. This works ok when i import all the sounds into the library and place them on their very own button. however the size of the flash movie increases to 140k. whereas when i load them dynamically the size of the movie is 20k. obviously i want to load dynamically.

But with dynamic loading each sound stops when another sound is rolled over, so that there is only ever one sound playing at once. I need to load the sound into a different level or something, so that the first sound can keep going while the smaller, shorter sounds play over the top. this is my script below. The first sound loads when the movie starts. This is the one i want to keep playing. Then there are the smaller ones with rollovers. does this make any sense? there's actually 13 little sounds.

[Code]...

View 3 Replies

ActionScript 3.0 :: Make Run A Doc Class That Load An XML File And Output The Results On Trace?

Mar 1, 2009

I am trying for first time actionscript as package document.And I am trying to make run a Doc class that load an XML file and output the results on trace.I don't know where are my errors:

Code:
package
{
import flash.display.MovieClip;
import flash.events.*;

[code]...

View 2 Replies

ActionScript 3.0 :: Dynamically Load A SWF That Was Compiled From An Fla With A Linked External Class File

Apr 6, 2009

I am dynamically loading external SWFs in a Main Fla in response to clicks on a menu.

The loading code is standard and works fine for all of the SWFs except one. When I try to load it I get the following error: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

I am certain that the URL to the problem SWF is correct. The SWF itself doesn't load any other SWFs or images. The problem SWF is linked to an external class file and compiled with it. i.e. in the properties panel of the main timeline of the problem SWF's Fla I have entered the path to the external class.

1. there is no problem compiling this SWF with the class (it works fine by itself)2. if I remove the external class from the properties panel and don't use it the resulting SWF imports without a problem into the Main Fla mentioned before So the problem seems to be the fact that the external class is linked in the properties panel. Is this a path problem?

View 3 Replies

ActionScript 3.0 :: Create A Simple Sound Playlist At Runtime?

Dec 15, 2011

This is what I try to do: I am creating a game with spoken sentences. These sentences are loaded dynamically from an XML file, which contains the paths to mp3-files.This is what is currently happening: All sentences are spoken at the same time.I want them to be spoken one after another - how to I obtain this requirement?This is my (simplified) code example:

import com.hydrotik.queueloader.QueueLoader;
import com.hydrotik.queueloader.QueueLoaderEvent;
_oLoader.addEventListener(QueueLoaderEvent.ITEM_COMPLETE, onItemComplete,false, 0, true);

[code].....

View 3 Replies

ActionScript 3.0 :: Generating A Simple Waveform Of A Sound Object?

May 28, 2011

How do I go about generating a simple waveform of a sound object.

View 5 Replies

Actionscript 3 :: Sound Class Unloading Sound?

Dec 27, 2011

There must be a simple solution to stop the sound and unload it in as3.

This is not all of my code, but in short I am loading random sounds. I need certian vars to be outside of the function so I can reference them with other functions for a progress bar.

How do I unload a sound so I can load a new one using the same names without getting an error the second time its called?

I have two buttons in this test. A play Sound and a Stop Sound Button.

here is my code:

var TheSound:Sound = new Sound();
var mySoundChannel:SoundChannel = new SoundChannel();
PlayButton.addEventListener(MouseEvent.CLICK, PlaySound);

[Code]......

View 1 Replies

Actionscript 2.0 :: Create A Basic Flash Script To Load An External Swf File Using MovieClipLoader Class?

Mar 17, 2009

I am trying to create a basic flash script to load an external swf file using MovieClipLoader class. Here's my code:

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myMCL.loadClip("splash.swf",5);

I simply copied it from a tutorial. Unfortunately it throws an error message as follows:

1046: Type was not found or was not a compile-time constant: MovieClipLoader
1180: Call to a possibly undefined method.

PS: I have CS3 professional in my machine but I am following Flash 8 book. But my CS3 application supports AS1, 2 and 3.

View 4 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 :: 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 :: Implementing A Simple Class

Jun 15, 2010

I cannot believe that implementing a simple class should be so hard. I am trying out the simple example outlined on the Adobe website: url...I copied the class code from here to file Greeter.as in subdirectory Learning. Then I created a dynamic Text field on the stage.

View 3 Replies

AS2 :: Flash - Simple Class Not Working?

Jul 1, 2011

So I'm trying to learn to create a public class, and this is what is in my class file:

class com.RCN.Menu.Menu{
public var title:String;
public var menuItems:Array;

[code]....

and in a seperate SWF I use the code:

import com.RCN.Menu.Menu;
var Accountability:Menu = createMenu("hello",[a,b,c,d]);
trace(Accountability);

yet Accountability traces as undefined?

View 1 Replies







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