Professional :: Loading External Audio File In Array?

Dec 7, 2011

I have figured out how to load an external video file - and I can play an imported audio file, but I can't seem to use either method to load an external audio file into an array.

Here is my audio code:
var tour_audio:Array = [tour1, tour2];
var my_num:Number= Math.floor(Math.random()*2);
var ChosenSound = tour_audio[my_num];
var playing:Sound = new ChosenSound();
playing.play();

Here is my video code:
var my_videos:Array=new Array ("link1.mp4", " link2.mp4", " link3.mp4", " link4.mp4");
var randomIndex = Math.floor(Math.random()*my_videos.length);
my_player.source = my_videos[randomIndex];
I tried "var tour_audio:Array = ["link1.mp3", "link2.np3"]; - but that did not work.

View 9 Replies


Similar Posts:


Professional :: Loading Audio File In Flash?

Oct 23, 2011

When i load the audio as mp3 file some time it will throw error.The error is "one or more files cannot be imported" Then i convert the audio file as wav file,but the quality of the audio is not good.

View 1 Replies

Professional :: Turn Off Audio When External FLV File Is Closed?

Jul 19, 2011

This is part of my ongoing issue with 6 video files in six Scenes.I have 6 videos there were imported as enbedded, one in each scene. the first four play but the second two do not.whichever order i place the scenes, it is always the last two that pause at the first frame.o try another approach, I linked instead to a video externally. This seems to work, but, when I click a button to go to another scene the audio from the previous scene is still playing when the new video starts.

View 22 Replies

Professional :: Next Button In Array For Loading External Swf Files?

Jan 5, 2011

Someone here recently helped me immensely with a question I had about creating a previous button in my flash file that would allow the user to click on the button and view the previous swf file.  I'm hoping someone can help me with making the Next button now, too.

I have a movieclip that loads an array of external swf files.  I thought making the next button would be as simple as changing just a select few things to the previous button.However, that's not working.  When I try that, the movieclip doesn't even load the swf files.  Below is my AS2 code for my file.  I bolded the part at the end that is for the previous button.  Does anyone know how to make the previous button?

[Code]...

View 16 Replies

ActionScript 2.0 :: MyArray.length [MX] - Loading An External Array From A Text File

Feb 9, 2003

I am loading an external array from a text file like this.

file = new LoadVars();
fileURL = "PhoneBook.txt";

I then trace fileURL.length and I getting a number much greater then my fileURL array length.

The array I am loading into flash looks like this. firstName0=zzzzz&lastName0=zzzzz&phoneNumber0=zzzz zzz firstName1=zzzzz&lastName1=zzzzz&phoneNumber1=zzzz zzz Is there a problem with using myArray.length for an external file?

View 14 Replies

Professional :: Loading External Text File Into Animation?

May 6, 2010

I'm a total rookie working with flash and i'm wondering if theres a way to call in text from an external file. I'm building a news feed on my companies home page, and I'd like to be able to have my boss edit it easily 'cause he doesn't know how to use flash.
 
you can see it here... [URL]

View 1 Replies

Flash :: Actionscript - Remove The Audio - Put The Audio Into A Byte Array And Then Re-add The Audio To The Flv Video?

Aug 6, 2010

If I import an FLV video is there any way to remove the audio, put the audio into a byte array, and then re-add the audio to the flv video?

View 1 Replies

ActionScript 3.0 :: Stopping Audio In An External Swf File?

Nov 18, 2008

I managed to use a loader to load an swf that has a video/audio track encapsulated within it. It starts and plays fine. Because of property rights considerations, I must use the provided swf with the video within it rather than converting it to an FLV.

And using the unload command I get the video portion to stop, but not the audio.

I know that I need some kind of audio stop to stop the audio, but haven't been able to figure out exactly how.

The parent swf is pretty simple, no buttons, it just plays 6 external swfs under control of another program that starts it and stops it with no other interaction.

View 6 Replies

ActionScript 2.0 :: Make External Streaming Audio Sound File?

Mar 8, 2007

Is there a way to make external streaming audio sound file "mp3" loop. my understanding is that streaming audio won't loop, only works for attached sounds...

var my_sound:Sound = new Sound();
my_sound.loadSound("jazz.mp3", true);
my_sound.start.(0, 99)

This actionscript works but it won't loop..

View 3 Replies

ActionScript 3.0 :: End Of External Audio File Triggers Movement On Main Timeline?

Aug 12, 2011

I have a few external audio clips in MP3 format that I bring in to my SWF by creating different Sound Channels for them. However what I would like to do it when the end of the MP3 file is reached, it will dispatch an event to make the playhead on the main timeline move to a certain frame.

View 2 Replies

Professional :: Importing Audio File Into Flash?

Mar 29, 2010

I am trying to import an audio file into Flash, but do not know what file extentions it recognizes. The file is .m4a that was created in iTunes. I can see how Flash would not recignize it, so what does Flash recognize, and I'll see if I can convert the file.

View 2 Replies

Professional :: Unsupported Audio Codec In Flv File

Aug 29, 2010

I've been sent a link to an FLV file that plays in the browser and when downloaded plays in Adobe Media Player.
 
However, when I try to import it into Flash, I get the error message
 
unsupported audio codec
 
It'll bring in the video no problem.
 
I've tried to use Adobe Media Encoder to convert the file but it doesn't see the audio either.
 
Is this some kind of protection on the audio? What am I missing?

View 1 Replies

Professional :: Stop Audio Of An Embedded File When A New Swf Is Open?

Oct 18, 2010

Here is the issue I am running into. I have built my site in CS3 and I have used a loader.On my site I have embedded video links, when the other video links are pressed, the audio from the prior swf keeps playing. The site[URL]

View 1 Replies

AS3 :: Loading External Swf In Array Using Wildcard?

Sep 27, 2010

I can use the following code to load in a specific swf:
 
var clips:Array = ["001/001.swf"];
 
but how do I tell Flash to load whatever file is in the 001 folder without stipulating a specific filename?

View 1 Replies

ActionScript 2.0 :: Loading An External Array?

Jan 6, 2010

I am building a jukebox for a website, which has a genres, bands, and tracks list.These are all populated from a MySQL DB. The info is dumped into a listbox component.ll of the lists are working, but on the tracks list, i need to pull the track name,and its filepath. So that I can assign the track name to the lable property, and the filepath to the data property.My problem, is that I cannot get a multiple value array from php to flash, it keeps coming up as undefined.

PHP Code:
echo "&testArray=[["track1","filepath"] ["track2","filepath"]]";// i have not put the query in i dont think the problem is there

[code].....

View 2 Replies

Professional :: Whole Audio File Doesn't Show Up Immediately In New Layer That Have Created

Jan 21, 2011

I'm making videos for an instructional program. This involves importing audio, images, animating those images, etc. I'll be exporting to flv format at the end, and then converting them to MP4 for downloads online.H

1.) Should I be using ActionScript 3.0 or ActionScript 2.0 for this?

2.) When I try to import audio, the whole audio file doesn't show up immediately in a new layer that I've created. It only goes in the blank keyframe that I've inserted. How do I import the audio so that the entirety of it shows up?

View 1 Replies

ActionScript 2.0 :: Loading External Textfile Into An Array?

Dec 21, 2009

I have scoured the internet in search of an answer but everything I find doesn't work. Take this example:

Code:
myData = new LoadVars();
myData.onLoad = function(done) {
if(done){
var wordsArray:Array = words.split(",");

[code]....

When I run the above code the Output window displays Undefined.

View 3 Replies

ActionScript :: Loading External Array Without #include?

Feb 20, 2011

I have created many games using a set of mutidimensional arrays. It is now time for me to make them external arrays to simplify some things. I did so, at first, using the #include. However, this loads the arrays at compile time.My goal is to house the arrays in an external file that is called when the game is loaded, NOT when it is compiled. In this way, the same game could be used with multiple different arrays without me constantly having to recompile it each time. It could just look for a file called "yourArray.as" or something and use that when it is run.

I am not very familiar with XML or javascript, so was trying to figure out how to do this with the arrays that I have already created without having to decode them and put them into another language first, only to have to change them back to actionscript later.

View 3 Replies

ActionScript 3.0 :: Loading External Variables To Be Split Into An Array?

Apr 22, 2009

I'm migrating an old project to AS3 and I'm having some problems make the conversion.

I have a text file called "variables.txt" formatted like this (note the jump form p9 to p11) Quote:

&p0=1|0|4|1|8|0|0|29|14|1|6|0&
&p1=1|0|4|1|8|0|0|29|14|1|6|0&
&p2=0|0|11|0|25|6|1|125|86|3|8|0&
&p3=0|0|1|0|0|2|0|26|17|0|2|0&
&p4=4|1|3|1|17|5|1|33|15|3|4|0&

[Code]....

What I'm trying to do is convert all those text variables into an array that will be accessible throughout the presentation.

View 5 Replies

AS3 :: Flash - Loading Multiple External Images Into An Array?

Apr 2, 2011

Trying to pick 4 images randomly and load them into and array and then show them using a timer when all 4 images are shown 4 more images will be loaded again. here is the code:

var images : Array = new Array();
var rndNumbers : Array = new Array();
var imageLoader : Loader;

[code].....

View 1 Replies

ActionScript 2.0 :: Loading External Sounds Stored In An Array

Sep 11, 2007

I want to write a function that will load all of my external sounds stored in an array which are just strings of their filenames ie:

var soundList:Array = new Array();
soundList = ["sound1.wav", "sound2.wav", etc];

And create a new array with sound Objects that will have the sounds loaded in them (for later execution). After loading all of the sounds in the soundList array, the function should return or just set a _root value to 'true' ie:

[Code]...

View 1 Replies

ActionScript 2.0 :: Loading Array From External Data Source Possible?

Aug 13, 2004

Possible to load an array from a external data source. I.e. like from a .txt file? I tried putting this in the external text file:
mytest = new Array("dadada")
It loaded, but not as a array, just as text. I am using LoadVars.

View 3 Replies

Streaming Audio / Loading Audio Into Swf First / Then Playing It?

Jan 28, 2012

I think it is loading the whole audio first into the swf, but I would like to get confirmation from someone more knowledgible.[code]I want it to stream the audio when the button is clicked only so that 100 of these swf will not slow down a whole webpage from loading.[code]I only start getting concerned when I noticed that on FF and Chrome, the page loads really quick but when I open the page in IE, it takes a very long time for the page to appear.

View 3 Replies

ActionScript 3.0 :: Loading External Data To An Array Syntax Error?

Jan 25, 2009

I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like

ActionScript Code:
array[0] = event.target.data.uid1_name;

I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:

ActionScript Code:
for(var i = 0; i<20;i++){
fArray
= event.target.data.uid_name;
}

This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out. I've also tried the following:

fArray
= event.target.data["uid"+i+"_name"];
fArray = event.target.data.["uid"+i+"_name"];
fArray
= event.target.data."uid"+i+"_name";

All three of those also give me errors. For the first one the trace statement outputs "undefinded" instead of "Doug". For the second I get "syntax error. Expecting identifier before left bracket". And for the third I get "syntax error, expecting identifer before uid.":

syntax to iterate the number after uid(uid1_name, uid2_name, uid3_name, etc)?

View 3 Replies

ActionScript 3.0 :: Loading External Data To Array (Syntax Error)

Jan 24, 2009

I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like:
ActionScript Code:
array[0] = event.target.data.uid1_name;

I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:
ActionScript Code:
for(var i = 0; i<20;i++){
fArray[i] = event.target.data.uid[i]_name;
}

This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out. Why syntax iterate the number after uid (uid1_name, uid2_name, uid3_name, etc)?

View 3 Replies

ActionScript 2.0 :: Loading External Text Files With Variable Containing Array

Sep 6, 2005

I'm using LoadVars to load an external file that has one variable containing an array with a few sub arrays.
Code:
var externalData:LoadVars = new LoadVars();
externalData.onLoad = function() {
var sectArray:Array = externalData.sectArray;
};
externalData.load("portfolio.txt");
But every time I try to get one of the values I get "undefined". is there another way?

View 2 Replies

Html :: Flash Audio Player For M4a (AAC) Audio File Embedded?

May 15, 2007

I'm looking for a (free) flash player that I can embed in my site and use to play a .m4a (.mp4 with AAC audio) file that will be obtained using a URL (i.e. it's not local to the server hosting the web page).I've tried searching on google for one, but either I'm searching wrong or no one has made such a thing. Ideally this would be very simple (small user interface with play button and maybe a progress bar) and it would be easy to have multiple instances of on an html page (can create the player with an <object> tag).

View 7 Replies

ActionScript 2.0 :: Loading An Array From .txt File?

Jun 23, 2006

how to load an array from a .txt file into my flash presentation. The point is that people need to be able to edit a list of products without needing the .FLA movie (or they will mess it up).

The .txt file looks as followed:

PHP Code:

[["Company1","3"],["Brandname1","Productname1","Productname2","Productname3"],["Brandname2","Productname1","Productname2"]],[["Company2","4"],["Brandname1","Productname1","Productname2"],["Brandname2","Productname1","Productname1"]] 

And this is where I want it to be. But I know I can't just open a file and put it down there, so does anyone have a suggestion how to do this?

PHP Code:

var LIST:Array = [  *SHOULD BE IMPORTED HERE*]; 

View 1 Replies

Professional :: Loading External Swf From Within An External Swf?

Dec 20, 2010

everything was going fine on a website project I've been working on, until yesterday. I'll try to explain the whole scenario first, and I'll put the code in here too so anyone can try to figure out what is wrong. Here's the breakdown of the site:
 
1) There is a MAIN SWF file that plays an intro and then stops on the last frame with the "Main" Navigation buttons.
 
2) Inside the Root folder where the MAIN SWF resides, there is another folder called "swfs" which contains six main external navigation pages, as well as another folder called "galleries" which contains additional external swf files for six gallery pages.
 
3) On one of the layers of the MAIN SWF, there is a movie clip called "mySWFLoadingClip" that the "Main" Navigation buttons load and unload the external  swf pages onto. These all work perfectly. The problem start on the next step. This is the code I used for the navigation buttons on the MAIN SWF timeline:

[Code]...
 
If anyone can help me figure this out I would be really grateful. This is a very important project and the deadline is coming up very soon. Please help me figure out how to load an External SWF onto the main time line and then load an additional external swf from within the first external swf. I'm stumped.

View 3 Replies

Professional :: Array For External Swfs

Jan 5, 2011

I have a menu files that loads all the swf clips I have in another folder.I did it in an array so that it calls to the clip and then plays it in the movieclip I have in the menu flash file.And yes, I use Actionscript 2.0.My question is, how can I make a player control that will skip to the previous swf that has been played.I have a rewind button already, but it doesn't rewind through the previously-played swfs.I'm trying to think of a code that will load the previous swf file played in the array when a button is clicked.Similarly, I would like to do that with a forward button and simply have it move to the next swf in the array line up.I'll just tweak a little bit of the code I'd have for the previous swf button.I just don't know where to begin.It seems like I almost have it figured out, but I'm just missing a key element.

View 16 Replies







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