ActionScript 2.0 :: GetBytesTotal For Sound File Undefined?
Jul 23, 2010
Why do my preloaders never work? I'm looking to develop a system which reads mp3 files from xml and loads them all with loadSound during preloading phase, the idea is to add all the totalBytes into one var so I can display one percentage for preloading all the files. However, no matter what I try Sound instances getBytesTotal() methods always return undefined when swf is run from host, even though I can hear sounds playing when they load. Of course in test movie everything works fine. In this method of my PreloadManager class I wait for sounds to load:
Code:
public static function waitForSounds() {
PreloadManager.timeline.debug.text += "
waitForSounds()" ;
[Code]....
View 1 Replies
Similar Posts:
Sep 13, 2008
What's the purpose of the getBytesTotal() method of the Sound object since it returns the same value as the getBytesLoaded() method? Note that I mean streaming mode here.
View 7 Replies
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
Dec 11, 2003
I'm doing my portfolio in FlashMX using Actionscript. Everything in that sites has a preloader.
Anyway, in the actual portfolio section I use variables form a .txt to load each work (that way I can add in a more easy way new content). The .txt contains location of images, text shown, titel, and some other variables. Each .txt is aprox. 350bytes.
The problem is that if the variables aren't loaded fast enough the content of each work is shown wrong.
Is there a way to calculate getBytesTotal() for variables ?
View 11 Replies
Feb 20, 2009
I currently have my preloader set to getBytesloaded getBytesTotal (etc.), before it plays the 1st frame of the entire Flash file, but I only want the preloader to load the first (let's say) 500 frames, then play them accordingly.
View 2 Replies
Jul 22, 2009
I am using Flash CS3 with ActionScript 2 and am having a problem getting getBytesLoaded and getBytesTotal to work properly. Probably I am taking the reading in the wrong spot, but I can't figure out where I should be doing it. The code will read an xml file which contains pictures and url links to where I want each picture to go, and then loads and shows a picture for 3 seconds, then goes on to the next one. I am trying to show the preloader bar "LOADING" by adjusting the _xscale as a percentage of BytesLoaded/BytesTotal. The code should work, but my getBytesLoaded and getBytesTotal is either showing 0% or 100% and nothing in between. Here is my code and I have left some of my trace statements in the code below as well. The problem occurs in the this.onEnterFrame = function() which is about half way thru the code:
[Code]...
View 6 Replies
Dec 13, 2010
I am dynamically loading an image into a movieclip using a preloader but cannot successfully calculate the percent loaded since I cannot get the getBytesTotal() method to work. I understand why it is not printing the percentage but what I do not understand is how getBytesTotal is behaving. Here is a segment of my output. l means loaded and t means total.
Code:
l = 0
t = -1
[code]......
View 9 Replies
May 31, 2005
I'm using this code to load a .jpg into a movieclip with the instance name picholderCode:_root.picholder.loadMovie("pic.jpg");How do I get getBytesTotal() or getBytesLoaded() to work with this picture? I've tried to get the total and loaded this way:
Code:
_root.picholder.getBytesLoaded()
But it doesn't seem to work
[code]....
View 11 Replies
May 13, 2008
The XML file of the image list is created from DB and images are fed to flash through script which creates images on the fly with PHPs GD library. Images are shown and browsing through pictures works.The thing not working is the preloader. the loaded bytes are never equal to total bytes so the preloader never gets shown.
When I trace the getBytesTotal inside enterFrame I get two different numbers. First two frames the total bytes equal to 4 then on the other frames function returns the right size value of the file.This issue persist only when I feed the FLASH with GD images. If I pass the normal image file, the preloader works great.
I'm assuming the issue is when GD creates the image the fileSize is uknown. I tried getting the file size of GD created file by caching the created file, checking the filesize and passing it through headers but the preloader still won't work and getBytesTotal still returns 4 before giving the right size...
View 2 Replies
Oct 7, 2009
I am working on a website that has a preloader that loads another swf called TSH. preloader loads TSH into a movieclip called holder_mc no, on the first frame of TSH I have this:
[Code]...
however, soundpos.text is returning undefined and no sound is playing. When I remove the "holder_mc" from the code and load the TSH file by itself, the sound plays fine.
View 1 Replies
Mar 24, 2010
I have installed Flash CS4 upgrade successfully with Flash CS3 full. I have also installed Flash CS3 full and then CS4 upgrade, but it made no difference. I cannot test an example that uses sound.extract() method. When I test the movie, I get an error message stating "Call to a possibly undefined method extract through a reference with static type flash.media.Sound".
View 4 Replies
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
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
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
Nov 13, 2010
I need to have the array I've created play sequentially and load accordingly after they've moved from frame 1 to 2 to 3 and so on. Here's the code that I have. All my songs are embedded in my swf.
[Code]...
I would really like the Pause, FF, and RW functions to work too. I got an error of "A term is undefined and has no properties" I'm absolutely sure it has to do with the var index:int = sounds.indexOf(this.currentTarget); line.
View 1 Replies
Sep 8, 2009
I would like to attach a sound to a .fla file that starts to play when the file is opened. I have created a button and would like to be able to use this button for a visitor to the site to mute the sound. So, I'm trying to accomplish two things, first attach a .wav file, then get the mute button to work.
View 1 Replies
Dec 15, 2009
I have a problem that I have not found a syntax error or logic error to explain. It appears to be an obscure problem related to playing a sound file and graphic positioning in the same file. My next step is to look for any known bugs. I have posted the file at. URL] When the page loads you will see a list of selections. Do not click any of the html Play buttons In the graphic arrow pointing to the right is the play button click it and a default file will start. Click the pause button (which will be green while the selection plays) Then click the play button again. The knob that moves while the song plays, will begin moving from the position it was at the time pause was clicked.
Click the stop button (arrow facing left with vertical line at tip) Choose a selection from the html list by clicking the Play button next to it. Then click the play button in the player display. The title of selection will appear in the title area. repeat the original steps (play, pause, play) This time the knob that moves while song plays, snaps back to the start and moves from start, rather than from the pausedposition.
[Code]...
View 7 Replies
Jan 21, 2011
I have AS3 project, made with FlashBuilder. I'm using MovieClips from an external .SWC-file. In a MovieClip from the .SWF-file, I want to use an audio-file. Is it possible to preload a sound-file (e.g. .MP3) in my FlashBuilder project, and access it in a MovieClip inside the .SWC?
View 1 Replies
Sep 1, 2003
Whenever i try to display anything returned by LoadVars.getBytesLoaded or Load....Total, it gives me NaN.
View 14 Replies
Mar 8, 2007
I want to create variables using the length of an XML childnode as the iterator. I would like to create vars named[code]...
View 2 Replies
Sep 13, 2010
I've been working with flash on and off for about 4 years now so I'm used to the interface but I've never worked with actionscript that much.I'm working on a flash photo gallery that uses XML to load each images title text, and the filepath to each thumbnail image and full size image.It all seems to be working fine, however when I test the movie I get the following error message in the output:Error opening URL 'file:///Z|/20930AliWebb/FlashGallery/fla/undefined'The images are stored in a folder named gallery_images and the thumbnails in a folder called gallery_thumbs, both within the fla folder. The fla folder also contains the xmlphoto.xml file and my flash file.Here's my actionscript:
Code:
spacing = 60;
//create a new xml object
[code]......
View 1 Replies
Feb 2, 2009
I have this little code, just loading text from a file, but as the title says, the variable s seams to remain unchanged :S
Code:
var s:String;
var loadText:LoadVars = new LoadVars();
[code]......
View 9 Replies
Mar 25, 2010
undefined error link is not working from xml file
[Code]...
View 0 Replies
Mar 11, 2008
I am using a dynamic nav menu edited using xml, when the corresponding button is pressed I want it to display some text in the text box and load a .swf into the loader m.c. It sort of works, however which ever button I click on it displays the content text and .swf for the last button listed in the xml file, when I try to set a var equal to the instance name of the button clicked on it shows the text as undefined and does not load the m.c? If I leave out the var 'currentIndex' I get a message in the output Error opening URL file undefined. I've checked everything and there are no typos.
Code:
var yPosition:Number = 0;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
var links:Array = new Array();
var names:Array = new Array();
[Code] .....
View 1 Replies
Feb 2, 2009
I have this little code, just loading text from a file, but as the title says, the variable s seams to remain unchanged :S
[Code]...
View 1 Replies
Mar 1, 2012
In the following code take 4 errors on 2 bold lines[code]...
View 10 Replies
Jun 5, 2011
I want to get my flv file looping within the swf. I've used the FLVPlayback Component. I've given the flv file the instance name of "vid". Actionscript is as follows:
import fl.video.*;
vid.addEventListener(VideoEvent.COMPLETE, rewind);
function rewind(eventObject:VideoEvent):void {
vid.autoRewind = true;
vid.play();
}
The error message I get at runtime is: 1119: Access of possibly undefined property COMPLETEthrough a reference with static type class.
View 3 Replies
Mar 14, 2011
I am trying to write a piece of code to retreive data from a SOL file : this is my code :[CODE]//get External interfaceimport flash.external.*;
[Code]...
How can that be ? what can I do ? What am I doing wrong ?(bear with me, as I said, I'm kind AS newbie).
View 4 Replies
Oct 12, 2010
im having problems getting some as3 generated (not drawn on stage) movie clips moving across the screen.
Code:
package {
import flash.geom.ColorTransform;
import flash.display.MovieClip;
import fl.motion.Color;
import flash.display.*;
[code]....
View 7 Replies
Jul 12, 2007
i am using flash, .Net, and MySQL and have elements (text fields) posting in flash.Question is, if the table in the data base is not holding the var char how can I set the text field in flash to not show undefined and just be blank?
View 6 Replies