ActionScript 3.0 :: Controlling Audio In Loaded SWF
Jan 23, 2009
I have several flash swf's that are about 10 - 20 min. each. I load these in a player that I have created as the user selects them from a menu in the main swf (a swf player basically). I can pause start and stop the swf's with no problem, but I can't seem to get a handle on controlling the audio. I have the audio in the loaded swf's timelines because I need to sync the audio with the animation taking place in those swfs. I could, take the audio out of the timeline (after syncing it), and then load it separately, but it would be much cleaner for me to just have it in the timeline.
I've resorted to the SoundMixer of the main swf to mute and change the volume, but I can't get hold of the Sound(), soundTransforms etc. of the loaded swf. To assign a play location for the soundChannel I need to access the loaded swf's Sound().Play() function, but I can't seem to do that. I have exported the timeline audio in it's actionscript, supplied a name (same as it's class name), and then tried to access it, but I can't seem to do it (yes I wrap the loaded.content variable in a MovieClip cast--that's how I can control the pause and play of the animation). Tutorials I have found only seem to work with sounds loaded into variables, and none refer accessing timeline sounds in a loaded swf.
I've a number of audio files and six menu items in my presentation.respond with instruction on how to stop the currently running audio when a new menu item is clicked (launching a new audio file)?
I'm working on a flash project consisting of 25 separate .swf file. each file has a audio narrative in it which is controlled by "play", "stop" button.the way my project works now is every time you unload a current .swf and load a new one, you have to press "play" to turn on the audio narrative. since there are 25 narratives in total, you can see how annoying having to press "play" every time you load a new movie would get.
what I am trying to do is add a global audio control in first "index" movie which would allow a user to globally turn the audio narrative "on" or "off".so for example, if they like to hear the narrative, they can turn audio on and have the audio start automatically each time a new .swf loads. if they choose to turn the audio "off", then the audio should not come on automatically.as a added twist to this, I would like to give my user an additional control over the audio by allowing them to use the "play", "stop" buttons within each of the .swf files.
I am trying to control the audio of an embedded video from a mute button. I can get the audio to play and the mute button to control the volume using the following script:
var my_nc:NetConnection=new NetConnection(); my_nc.connect(null); var my_ns:NetStream=new NetStream(my_nc);
[code]....
The problem I am having with this is that the video is not appearing on the stage and when I place it on the stage the audio is playing twice. how I can get it to appear on the stage and still control the sound as the button is doing at the moment?
i need to ctrl the audio of a video clip, but im not sure how to do itwhat actionscript do i needi imagine i would need something like_root.video_movieclip.soundlevels = 100%
How can I get this flash file to import this audio file and be able to pause and reset the audio?The file I have I was able to get it to play but I can not pause it, it just re-sets it.I also can not figure out how to get a progress bar to match the audios progress.Has anyone done this befor or have a fla with code I can look at and revers enginere? URL...
I've designed a website for a client and it's completed but she's complaining that the music on the website is too loud. I made a button so you can turn the sound on and off, but i have no clue how to make a volume button for an external audio clip and i haven't found a single tutorial on the internet that can help me with this specific issue. Can someone help me with this and give me a step by step instruction, including any code i need.
So I'm trying to get sound on my flex application. Then tried to load an swf movie with only audio in it.But when it loads on init(), it loops non-stop.Here's a sample code:
I want to know if it is possible to use javascript, flash or flex to make a youtube video player that is capable of controlling left/right audio channel volume. For example, mute the left channel and play right channel audio on both left/right speakers.
I'm loading a SWF into a main SWF using the code bellow, from senocular tutorials:
Code: var request:URLRequest = new URLRequest("home.swf"); var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
[code]....
I have buttons inside a movie clip, at the main movie (parent) and I want to control the home.swf movie that I just loaded. How can I do that?I'm trying this, without any result:
Code: function botao_clique(e:MouseEvent):void{ MovieClip(root).window_mc.textos_mc.gotoAndStop(2); }
I'm loading assets from a swc and I need to loop through every frame of the movieclip and find a certain instance so I can colorize it. Is this possible? It seems that with a swc I loose the ability to control the movieclips playback. It just plays and repeats no matter what I do.
the .FLA files are attached at the bottom. intro.swf is the actual movie and introLoader.swf is the preloader and it loads intro.swf into it.the problem with the actionscript previously was that itd start playing the external movie halfway through the preloader bar as if it was streaming..however i found a workaround that doesnt really work.. i used xyz.stop(); and xyz.play(); functions to control when the external movie plays.The problem with those functions is that i need a check for them i.e if(percentage <100) etc. which causes problems like if the flash movie is already watched once and cached and you reload the page it wont play.
I have a button on my main scene which creates the varaiable "soundoff", then if one of the placed swf's when loaded detect the variable it stops all sounds,
if(soundoff == true){ stopAllSounds();
This works fine but does not target sounds placed in movieclips in the loaded swf's timeline. I've tried targeting them with the _root. command and using linkage but I can only stop the sound in the main timeline level.
Is it possible to control one loaded SWF File e.g.,(MOVIE-1.swf) from another loaded SWF file e.g., (MOVIE-0.swf) on a different level? E.g. with a syntax like: onRelease _MOVIE-1.SWF.gotoAndStop (4) or: onRelease gotoAndStop (MOVIE-1.swf, frame4)
I am loading a .swf that a previous developer made (don't have the .fla) but the actionscript at the end of the movie is resolving to home.html. Instead of it resolving to home.html I would like for it to instead have gotoandPlay.
is it possible for a loaded swf to control the timeline of the main swf or even to tell the main swf to unload the loaded swf just by pressing a button in the loaded swf.
i had made a image gallery using xml in flash MX 2004. some of the images are jpgs and some are swfs. i'm trying to get it so that once the external file, be it jpg or swf, is loaded, it would recenter itself in the middle of the page.so i attached the following code to the container clip that the files were loaded into:
I'm creating a flash site, navigation is simple, or so I thought. Buttons along the top load external swf's to the stage. As they are loaded and unloaded the swf's animate in and out again on button clicks so the next one can come in.
I have suceeded in controlling the loaded swf's to get them to animate onto the stage, but what I have added to animate them off again does not work. I don't even get error messages, it is just ignored.
I have indicated below what I have added to try and 'animate out'
Actionscript:
stop(); //////// HOMEPAGE CONTENT LOADS ON PAGELOAD /////////// addChild(loader); var swfloader:URLRequest=new URLRequest('contentboxhome.swf');
[Code].....
This is a sample of two of the 5 buttons, I have tried using both the 'if' function on all buttons and the 'event complete' function on all of them, and both are just ignored. No error messages, no unusual occurrences at all. The code is just skipped over and the swf I have requested to load, just animates in and replaces the one there currently. Only funny thing is that, despite the 'loader.unload();' being WITHIN the 'complete' function, it still seems to be fired. The swf's never overlap each other.
trying to create a universal fla file (shell.fla) in which I can load any swf file and control it from buttons in the shell itself. The buttons being play, pause, rewind, magnify etc.I�ve done all this in AS2 and now I have to do it in AS3. See my website [URL] E-Training - Motor to get a better idea of what I mean.The shell file has three buttons so far with instances called playMovie, stopMovie changeMovie and a dynamic text field - movieNumber. It is bound to the class Shell. The swf files to be loaded are numerical 1.swf, 2.swf, 3.swf etc. If I can get playMovie, stopMovie to work I can then do the rest.Here is my code so far for the class Shell.as:
What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames. think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.In the zip file is an example of what I'm trying to do.
I have a simple swf called site.swf that loads a menu with UILoader called menu.swf, from menu I'm able to navigateToURL but I also need that it goes to frame 50 in menu.swf.
how to assign a volume control component available in the video components library to an externally loaded swf once it's loaded into my main flash movie? I want to feature the volume control at the bottom of my main flash so that when you click a button to load the swf that volume control will be able to start controlling it's volume. Also, I want to be able to load several swfs and once each one is loaded--only one playing at any given time--into the main flash that same volume control can control them. Is this possible and, if so, how do I do it?I'm using CS5.
I have loaded a SWF and attached to a MovieClip which exist in my current movie using the following code, and now I just want to access the loaded SWF to send it orders like play() or gotoAndPlay(); I have tried also: container= MocieClip(loader.content); instead adding child, but it trhows an error
Another question regarding externally loaded .swf's!
In my externally loaded swf.s are a pause and play button which work perfectly using only:
on(release){yanm.play();}
(yanm being the name of my movie file containing my movie!!) and obviosuly the stop is with a stop!
Now I want to add a 'Mute' button so that the user can turn off the audio. What script would I use for this?
I also want to use a 'Rewind' or 'Restart' button to return to the beginning of my movie and begin playback again. What script would be used instead of .play?
I want to communicate with an object within a loaded swf. I know I can use this event listener and function to do so right when the swf has completed loading:
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadSections) function loadSections(event:Event):void { event.target.content.mc.y+=2 }
But I want to be able to manipulate a given object from the loaded swf at any time not just when the loading is complete. So basically as long as the swf is loaded, is there a way to manipulate objects and call functions within that swf?
I have a loaded swf file that is a short animated intro I am using he addChild method. I wold like it to simply move the timeline to a label "menu" after it has played. This is the cde on my main Timeline:
stop();import flash.display.*;import flash.events.Event;import flash.media.SoundMixer; var Xpos:Number=0;