ActionScript 3.0 :: Manage Sound From An External SWF?
Feb 3, 2009
I wrot a FLA in AS3 which is basicaly a nicly designed Loader which loads little cute SWF games. Each game is built a bit differently and has its own 'thing'.I was wondering, how can I control the sound of the SWF's from the Loader File?
Which leads me to a wider issue of how can I control variables of a loaded SWF.
View 0 Replies
Similar Posts:
Oct 12, 2010
Part of a larger presentation I've made, there is some background music. What happens is an XML file is read to get a file to play. It plays. When it finishes, it reads the XML again to get the new file. It can also stop when a video plays elsewhere in the presentation then I pick it up where it left off and start the process again. Trouble is, the presentation randomly stops. The music stops and the slides in the presentation stop. The music and slides come from a single XML file. There's also a third part of the presentation (a text crawler) that never stops.
This comes from a totally separate XML file. I never get an error, the presentation just stops on a slide and no more music plays, but the crawler keeps crawling. I've removed all the code for the music and it runs perfectly so it's obviously related to how the music is managed. So, finally, my question is how do I manage sound objects? If I need to create new objects for each sound I load and play, I'll need to do manage the sound from a single function, right? Something like:
Code:
function whatever():void {
if song is not loaded {
read xml, load and play song;
} else if video is playing {
pause the song;
} else if video has stopped playing {
resume song;
}}
View 4 Replies
Jun 27, 2007
In a code im currently working on, I have 3 sounds that I need to maintain constantly, but It seems flash can only manage 1 sound per frame.
How can I manage the volume of more than one sound in flash per frame?
View 10 Replies
Mar 24, 2012
I'm having trouble trying to manipulate music using buttons. I can't seem to make music1 autoplay and loop when the movie starts. I want to stop music1 and play music2 when I press a button:
music1 in main timeline button to change music is inside a movie clip so far here is the code I found on the internet but I'm not sure how I can change it to do what I need:
var mySound:Sound;
var myChannel:SoundChannel;
var isPlaying:Boolean = false;
var isPaused:Boolean = false;
[Code]...
View 2 Replies
Dec 6, 2008
I'm creating a movie object using images. I'm using PNG file types with an alpha channel. Each frame is approx 640 x 480, each single pitch image is 36 frames creating an image 23040 x 480. If it's a multidimensional image it is 23040 x 11520. I load the image in using "img_name".loadMovie("imageFileName", 1);
The problem is it only seems to load around 2880 pix of the image.
How can I get it to load the whole image? How can I choose it to load the next section of the image?
View 3 Replies
Feb 6, 2012
I have 2 AIR applications (A and B) that are able to communicate via a LocalConnection object. I've verified that messages are definitely being sent/received appropriately.
I want to be able to have A tell B to come to the front. Both applications are full screen:
stage.fullScreenSourceRect = new Rectangle(0, 0, 1080, 1920);
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
I've tried several permutations, but as of yet nothing seems to work.
private function initSlave(channel: String): void {
conn = new LocalConnection();
conn.client = {
[Code]...
If I leave both applications in windowed mode (stage.displayState = StageDisplayState.NORMAL), then toggling alwaysInFront actually works. Calling activate() or orderToFront() still do nothing. If I try to toggle alwaysInFront and then set the application to fullscreen, the application ends up fullscreen behind my windowed app. Maybe there is an event I should wait for before setting the app to fullscreen?
I found a thread mentioning that orderToFront() only works relative to windows within the same application, which explains why it doesn't seem to do anything.
Does anyone have any insights into pulling this off? Maybe there is a way for me to embed B into application A so they are actually the same application? I am not sure how to do this with an AIR application as simply as just loading the SWF due to requiring external resources.
View 1 Replies
Jul 19, 2010
I am working on controls for an external swf. The external swf loads an external sound file. The structure at the moment is extswf.swf contains mcSound which loads soundfile.mp3. extswf.swf automatically starts playing when invoked. movieController contains the icons for the play/pause buttons. This is assigned CntlClass. CntlClass loads extswf.swf and controls the play and pause buttons.
So far, the play and pause buttons stop and start and stop the movie but not the sound. I know I need to access the sound channel from the external swf and use the sound transform to change the volume. How to access that channel is unknown. The examples I find have imbedded sound files. Also, the examples seem to use the main class for the external swf. My external swf doesn't have a class file, so I have no idea what the main class would be.
View 5 Replies
Jul 23, 2010
In trying to activate the remainder of the pause button, I find that using MovieClip(loader.content).channel.position always returns 0. I've tried numerous other combinations to access the position of the sound for the play function to resume correctly. The visual part of extswf.swf stops and starts exactly as it should.
In CntlClass:
public var loader:Loader;
public var movie_mc:MovieClip;
public var soundResume:int = 0;[code].........
View 2 Replies
May 13, 2010
when i load external swf inside main swf through loadClip then sound of external swf does not play.
View 3 Replies
Oct 11, 2010
I have created a Flash container movie (mainContainer.swf) that cycles through an array loading in several external swf files (animation1.swf, animation2.swf, animation3.swf, etc.). Once the user clicks the next button, the next swf is loaded, and so on...
What I need to be able to do, is to control the sound of the external swf files from the main container. Specifically, I need to be able to pause and play/resume the sound of the external swfs, but not quite sure how to access the external swf's soundChannel from the main container swf. My client recently wanted to add in a "pause" feature, and while I have been able to pause the external swf's animation, I cannot target the external swf's sound - it just continues playing while external animation is paused.
I can successfully pause/resume the sound (song.mp3) if the soundChannel is defined from within the same swf (using code below); however, I cannot seem to figure out how to communicate between the parent and child swf, if the parent is requesting the pause action, and the child swf is the one that loads in the song.
[Code]...
View 4 Replies
Aug 26, 2010
I'm trying to set a volume to my external sound. I'm using the following code, there're no errors, but the volume is not affected...
var req:URLRequest = new URLRequest("squeeak3.mp3");var sound:Sound = new Sound();var controller:SoundChannel = new SoundChannel();var myTransform = new SoundTransform();myTransform.volume = 0.2;controller.soundTransform = myTransform;
View 3 Replies
Jan 11, 2011
I'm trynig to control an sound of a external SWF but I can't seem to get it right,here is the code i'm using to import the sound
mport flash.media.Sound;import flash.net.URLRequest;import flash.display.Sprite;import flash.media.SoundChannel;import flash.events.Event;import flash.events.MouseEvent;var _som1:Sound;var _channel1:SoundChannel;var _playing1:Boolean = false;var[code]...
View 16 Replies
Jun 17, 2009
Urgent help me load a external sound in action script
View 0 Replies
Nov 11, 2010
I am trying to control external swf sound and I have created volume slider. But when I am running the code I am getting following error..
ArgumentError: Error #2068: Invalid sound.
at flash.media::Sound/play()
at volumeControl_fla::MainTimeline/volumeControl_fla::frame1()
[Code]....
i.e. when I load theexternal swf..how to catch the sound embedded in that swf
View 5 Replies
Jan 10, 2011
I'm making an application and I can't seem to find a way to control my sound of an external SWF(SWF2) from the main one(SWF1).Here is the code I'm using to control the timeline of external SWF that is placed inside of the main movie
Code:
var loadAnimBox:Loader = new Loader();
var vid_mc:MovieClip;
function startLoading():void {
[code]....
View 2 Replies
Feb 1, 2009
I'm using external swf in a project, and I got one swf with startup audio play, I can't stop the sound to play when I load another swf via this code :
Code:
clearButtons();
TweenLite.to(m.target, 0.5, {tint:0xcc0000});
m.target.mouseEnabled = false;
[Code]....
View 4 Replies
Oct 7, 2010
I have created a Flash container that cycles through an array loading in several external swf files. What I need to be able to do, is to control the sound of the external swfs from the main container. I would like to be able to pause and play/resume the sound of the external swfs, but not quite sure how to accomplish this, as I am newly migrating to AS3. Some of the sound is embedded in the external files, while others load it in via AS.
I was able to successfully pause/resume the animation of the external files, but cannot get the sound to pause - it just continues playing while the animation is stopped.
How can I pause and resume the sound of my external swfs from my main container?
View 6 Replies
Apr 4, 2005
i am trying to control sound on an external swf.
the sounds that i have is on a swf file that has my "container" MC that loads up all of my external swfs.
the sound controller is on my external swfs.
View 1 Replies
Aug 18, 2009
I have a Loader that loads external SWF. The external SWF has sound. I'd like to stop, pause and play the sound.
[Code]...
This only mute the sound only and the sound is still runnung.
View 4 Replies
Feb 26, 2011
Is there any simple way you can access a very short sound file in flash without having to play it in an flv player. its just a ding sound to play when the user hits a button in the presentation.Also is it possible to access an external pic file and then convert it in to a symbol to be used within my presentation.I just don't want to store these files to keep my main swf small.
View 3 Replies
May 3, 2011
I am pretty dense about flash, pretty new to the software so bare with me. So on the main .fla i have linked to a button to open the external swf mp3 player. That Mp3 player is streaming a song with the code var req:URLRequest = new URLRequest("mysong.mp3"); snd.load(req);
the mp3 is in a folder which is located in the same place as both the .fla and .swf mp3 player. Streaming the mp3 works when testing the swf. but there is no sound when testing the linked swf mp3 player in the main .fla. It's like the file path messes up but i dont know how to go about fixing it?
View 7 Replies
Sep 6, 2011
I have the following program to play a .flv movie on a webpage made by myself:
var Xpos:Number=0;
var Ypos:Number=0;
var swf:MovieClip;
[Code].....
When I publish the preview, it works well and I can unload it and kill its sound by clicking on the close button. When I publish the page on the website and load the movie through "loader_btn", it works well, and when I click the close button, the image disappears but the sound is continued.
View 3 Replies
Oct 14, 2010
I have a flash application, some kind of a play-list that loads external SWF video player (I don't have code access to that external file), so users can watch the video or skip to another one. When user switches to another video new SWF file is being loaded.
The problem: If user didn't finish watching the video and skips to the next then I unload previous SWF file (unloadAndStop()) and load a new one. And because the previous SWF was playing it is not actually unloaded, it is still playing on the background (I hear two audio tracks: current and previous).
View 1 Replies
Jul 10, 2009
On a button click the page loads and external swf using the add child function. Once loaded the user can close the "pop up" at any time by clicking the close button. The swf appears without a problem first time round, it is if they go back to click again that causes the problem. If they then try and click the button to view the external swf for another time then no visuals appear - you can hear sound but the videos never appear. I have tried to see if it is hiding behind something to no avail.
Edited code is below!!
ActionScript Code:
var multiPlayer:Loader = new Loader();
var playerRequest:URLRequest = new URLRequest("vgallery_multi.swf");
function showQAMultiple(Event:MouseEvent) {
[Code].....
View 2 Replies
Dec 29, 2009
I'm loading an external swf file that has some sounds in it (to the main swf). The swf contents never leave the movie but it does get pushed to the site when it's not in view.
The user can bring it back in view by pressing on a left/right button. So when it's not in view... or tweening out of view I need the sounds to stop.
Since the loaded swf is never unloaded, what should I look at to accomplish this... communicating with the loaded swf, etc?
View 5 Replies
Nov 15, 2010
So I have a sound file loaded externally in my flash file and I inserted my .swf into my dreamweaver web page but the sound doesn't play, just the animation I have in the flash file. The sound plays fine when testing it out in flash and previewing it in html through flash but when the .swf is inserted into an html page on dreamweaver and then previewing the page in a browser, no sound plays..
View 5 Replies
Mar 12, 2008
I have created a flash header that is pulling some external sound from a server and am running into an interesting issue. Here is the code that I am using.
[Code]...
And here is what is happening: I have a preloader on the first frame and after everything is loaded it goes to the second frame and begins playing. If I just preview the movie in flash (Ctrl + Enter) then everything works fine; the music plays my text field is created (the time counts correctly), and the start/stop button works fine. If I then go up to "Simulate Download" to test the preloader and everything, when it loads and goes to the second frame, the music will sometimes play (and cut out), the text field isn't created, the start/stop button doesn't work, and I don't know what the problem is.
I think I have pinned it down to my my_sound.onLoad() function (that I don't think is getting run in the simulated download), but I can't figure out why it would work with a live preview, and not a simulated download.
View 6 Replies
Feb 4, 2009
this works when I test it on my computer. But when I put it online, the bytes progress becomes undefinable / NaN.. I don't know why being online makes a difference.
[Code]...
View 2 Replies
Apr 18, 2010
I am making a set of image galleries which will have looping background music. What are your opinions about the recommended method to bring music in? I am happy with the attachSound and loadSound methods, but wondered whether attaching a soundtrack.swf using loadMovieNum would be better. If so, I only know how to stop and start the music, not pause it and restart where it left off, which is important if I add a narration. Sound Objects seem more versatile because they let you use "position/1000", but from what I have found on the forums I have searched through, I may have to load the swf into a Movieclip or perhaps use _level somewhow?
Here is the code, which works well, but does not "pause" the music, it just stops and starts at the beginning. Code is in the root timeline of my soundControls_mc (play/pause button).
[Flash 8 - AS2]
loadMovieNum("includes/number10.swf", 100);
soundOn = true;
this.onRelease = function() {
if (soundOn == true) {
unloadMovieNum(100);
[Code] .....
View 2 Replies
Sep 2, 2011
I have a main swf that would eventually call out to another SWF file. Both of them have background music playing in them. Both swf runs fine without any error when I tested on them individually(both test movie and running the swf files themselves). But when the main swf calls the sub swf, the music doesn't play which is strange....
this is how I load my music(in both swf):
Code:
private var myMusic:Sound = new Sound(new URLRequest("main_music/myMusic.mp3"));
private var myMusic:Sound = new Sound(new URLRequest("sub_music/myMusic.mp3"));
All the swfs and music resides in the same folder. I am confused, I do not see the reason why the sound doesn't play on sub.swf when the main.swf calls the sub.swf when the main.swf works perfectly fine.
View 3 Replies