ActionScript 2.0 :: Adjusting Volume In External FLV?
Apr 30, 2010
I'm looking for a way to adjust the volume in an external flv. The code below sets the volume, is there any way to have it start at one volume and fade to "0" over the length of the flv?
this.createEmptyMovieClip('snd', 0);
this.snd.attachAudio(this.ns); //attach NetStream
this.audio = new Sound(this.snd); //Set MC as source
this.audio.setVolume(80);
I also tried start/stop buttons, but they start and stop the flv also, any way to set them up so the flv keeps playing without the sound?
AS2 -> AS3 migration: doncha just love it?!have a look at the attached code. selection one makes us anew sound and gets it playting, great. then we need to adjust thevolume so we read in the files that:You can alter the volume and panning while a sound is playingby setting the pan or volume properties of a SoundTransform objectand then applying that object as the soundTransform property of aSoundChannel object.great, so selection 2 in code below should do that, right?
The first is that when loading an external swf in my main SWF I get this in the output window:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at audio_fla::list_1/frame1() at flash.display::Sprite/constructChildren() at flash.display::Sprite() at flash.display::MovieClip() at audio_fla::MainTimeline() TypeError: Error #1009: Cannot access a property or method of a null object reference. at audio_fla::MainTimeline/frame1()
But it still works. Its an mp3 player. The other problem is that the loaded SWF has a volume controller. When I test the external SWF by itself it works fine. When I load it on my main SWF when I start to drag the handle on my volume slider and MOUSE_UP outside the handle it still keep dragging the handle.
The code of my main SWF is: import caurina.transitions.*; var _currentCategory:String = ""; var percent:String = ""; var loader = new Loader(); loader.name="videoLoader"; [Code] .....
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;
I have an external video list (array) that is set up to load and play in an FLVPlayback component. The client wants individual audio control buttons: 1) Up volume 2) mute 3) Down volume. I have AS on each of the buttons but it's not controlling the volume of any of the videos. The only one that works is the mute or "stop all sounds." I'm unsure on how to go about getting what I want.
I have an external video list (array) that is set up to load and play in an FLVPlayback component. The client wants individual audio control buttons: 1) Up volume 2) mute 3) Down volume. I have AS on each of the buttons but it's not controlling the volume of any of the videos. The only one that works is the mute or "stop all sounds." I'm unsure on how to go about getting what I want.
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.
hope i'm explaining this the right way. i'm using the flash flvplayback component to play a video. i've stripped the audio from the flv and am playing it, along with another audio clip, on the timeline at the same time. volume has been set for both clips, but i need to allow people to adjust the volume from the volumeBar that exists inside the video player. it's built in as2.
I've created a small music player with a sliding volume control. I'm having trouble with the volume. Though it does control volume properly, if I set the initial volume to less than 100%, the volume always starts at 100% until I move my mouse over the player. At that point, the volume changes to whatever the initial volume is set to.Is this a flash bug, or am I missing something? Here is the affected code (code for other buttons/functions omitted for brevity):
var song_initvolume:Number = 100; slider_1._x = groove_1._x + song_initvolume; playSong(0,song_play);[code]....
I'd like to be able to set the volume at say 50%, but the above mentioned behavior happens each time.
I'm building a video player and am kinda stuck at the volume slider part. It's a YouTube style vertical slider, meaning if the slider is in the top position volume should be 100% and if the slider is dragged to the bottom position sound should be 0. Currently it's doing the opposite of what I want :(
Dragging the slider down will make the sound louder, while dragging up lowers it.
Here is my code below dealing with the volume slider.
[Code]....
The (-4) is an offset value so when you drag it all the way to turn it off, it's 0 and not 4. I need to reverse this somehow, so the traces above will swap... going down will make userVolume = 4 and going up will make it 30.
I've got a serious of games which in turn load off a main main swf.I have mute and unmute buttons on the main menu and the same buttons in each game.When I unload/load a game I want the volume to stay as it is so they player doesn't have to keep turning the volume off. AudioOff is the button shown when the volume is off and AudioOn is the button shown when the volume is on.The code I've got now keeps the volume on or off through the games but the buttons aren't showing up correct with this code..
if (SoundVolume.volume == 1) { AudioOn.visible = false;[code].....
It seems right to me but I don't know. The movie button slides down the slider bar but it just doesn't affect the volume. Going to try to attach my FLA to offer better insight. Just tried to upload it and no matter if it's FLA or zipped FLA, it says it failed.
I have a movieclip and what i'd like to do is once a button is clicked id like the clip to play a double speed (or maybe more).Is it possible, by way of adjusting the FPS maybe?
Basically this is it: I have a movieclip with four frames with this script on it:
Code:
onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { if (_currentframe != 1) { gotoAndStop(2);
[code]....
Basically this is how i want it to work: If you're at frame 1 (which you start in since a layer above have a stop on it) and press and hold left you go to frame 2 and if you stop holding down left it goes back to frame 1. If you're on frame 1 or 2 and press and hold right you go to frame 4 but if you stop holding right it goes to frame 3
I was wondering if there is a simple way to control the "Adjust Color: hue" - filter of a MovieClip?. Is it possible to adjust it with a single variable(with AS2)?
I have a grid of 9 columns by 3 rows (so each column has 3 slots). A minimum of one slot in every column must be marked and no more than 3 can be marked. A mark is represented by a 1,2 or 3 digit.There must always be 15 marked slots in total. To achieve this I tried the following:
I have a container movieclip and i am attaching thumbnail images to it to form a slideshow.
The problem i have is i need the container to scale to the stage width, and then add the images, but if i scale the container it also stretches the attached images.
Is there anyway i can change the width of the container without effecting the attached images?
I have this function inside a this.onEnterFrame function. What I need it to do is that every time I hit Q, the variable (_dropAdjust) should decrease by 1, and every time I hit A, it should increase by 1.
What it is doing, is that every time I hit either of the buttons, the variable decreases or increases by a increment dependent of the time that has passed, but I still need to have the function inside the onEnterFrame, because if not I can only hit the button once.
ActionScript Code: this.onEnterFrame = function () { var _adjustListener:Object = new Object();
one of my homework assignments for a begginer Actionscript/flash class. The goal of the assignment is to draw a shape then have it continuously drawn until it reaches the vanishing point in the center of the stage. I am pretty new to actionscript since this is the first class I have taken for it and I really dont know how to explain it better. I am trying to write the code for. This is the code I have so far it basically just draws the shape I am using and I am lost on what to do next:
I am new to XML and I have tweaked a mp3 player from a [URL] file to do exactly what I need it to except for one small thing.... I need for each song to be able to load different album artwork independently, right now the jpeg is assigned to all the songs in the playlist. I did the tutorial and while it made sense. this "final" example goes far beyond the scope of the tutorial (he leaves it as an example of what could be done if you know what you are doing (I don't))
I need to read two image locations from a file and join it together. For this i used the following code.
[Code]....
With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.
Does anyone know how I can adjust the speed of Cladio's scroll bar so when the arrows are clicked the scroll runs faster? Attached is Claudio's original file if needed. The speed variable has no effect on this? I tried adjusting the interval property of both the (up_btn and down_btn) to a lower number from "18" to "0" Like so...
[Code]...
This seemed to work when previewed in the player but once uploaded for some reason the scroll slowed down again? something to do with the frame rate? movie is set up at 30fps. Also, the content being scrolled is dynamically loaded via XML... Would this have anything to do with the lag?
I have a timeline slider part to my animation which starts at frame 1089 and ends at frame 1173, I have a script which allows me to do this and works perfectly when I build it in a new flash file starting at frame 1, I need this code to work for the animation I have built at frame 1089, I dont know which number "1's" in the script relate to the frame number, I have tried changing them all to 1089 but that doesn't work! at the moment as soon as I click on this it jumps back to frame number 1 - which I believe as the code stands is exactly what it should be doing. Please could anyone edit this code so that it realises which frames I want it to work in?
var numOfFrames:Number = 85; // number of frames in the timeline to scrub var widthOfScrubber:Number = 500; // width in pixels of scrubber bar var widthOfScrubberSlider:Number = 25; // width in pixels of scrubber slider[code].....
I need to read two image locations from a file and join it together.For this i used the following code.
Part A:
//this reads from the file images.txt and puts in an array "images" //the size of the array "images" is 2 // m = new LoadVars(); m.onLoad = function(ok) {[code]...........
With this code I can load two images but I can't adjust the position of the second image with respect to first i.e: iam unable to capture the width of the first image.
I have a sound loop that plays perfectly and I have a volume slider that works great. Here's my problem, I need to control a seperate movie clip -an animation- with that same slider (the volume controller).. It needs to adjust the height of this mc up and down... like when the volume goes down, the height of the seperate mc gets smaller and vise/versa..
this seems like a fairly straightforward thing to accomplish, but like I said I'm not all that great at AS...
m using Flash 8. And I'm trying to adjust two sounds files using action script. First I set a sound file to 100, then I tried to set another file to 25 but when that happens, it also sets the first sound file to 25.
How do I adjust the second sound file so that the first one doesn't get changed as well.
By the way, here's the action script I was using for both sound files: