Problem With Dynamically Loading Audio Files
Ok so I have an swf the plays audio clips if I import them into the fla itself. However when I try to load them through a loader with several different external swfs or try to load them using:
ActionScript Code:
myMusic.loadSound("sample.mp3", true);
or:
ActionScript Code:
myMusic.loadSound("Track6.mp3", isStreaming);
They will not play. As in nothing happens.
When they are seperate swf files they play in that file just not in the main movie.
Anyone have any suggestions? Thanks!
MM
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 11-19-2008, 07:26 AM
View Complete Forum Thread with Replies
Sponsored Links:
Dynamically Preloading Audio Files ?
Hi all
My question is:
Is there a way to dynamically preload mp3 files with action script.
The situation:
I ‘m trying to create a “Joke” game. The user hears the first part of a joke. And then has to answer a question to hear the second half of the joke. The problem is there are 300 jokes, for a grand total of 600 mp3 files (one audio file for the first part of the joke and a second audio file for the second half of the joke). I know how to “hard code” audio files with actionscript so they will be “pre-loaded” (the jokes are selected randomly so I thought the best way would be to preloaded the audio files so there is not a pause).
I don’t want to hard code 600 sound objects. Is there a dynamic way to “pre-load” the audio files. I’ve been trying and have had no luck.
Any suggestions???
View Replies !
View Related
Loading Audio Dynamically, Then Controlling Different Tracks With Same Buttons?
I created an audio player. My intent is to load external audio dynamically, and the number of tracks it loads will eventually be controlled by loadVars variables. So I can label the songs in the folders sequentially such as song01.mp3, song02.mp3, etc... then in the text document i can change the variable for the amount of songs to load to tthe number of songs I have in that folder.
I have a regular set of controls to control the audio. Including 2 buttons to move and play the different songs loaded.
The problem is that it appears that I don't know how to attach a dynamically loaded sound to something other than a sound object. Then, if I load all the sounds at once when the audio controller starts, I have to create a different sound object for each loading sound to be put into.
I can handle that fine with the "for" statement.
But the issue is trying to simply control the different songs with the same set of buttons, or displaying the variables for that song withought writing a long script for each sound load object.
for example
I have an external mp3 loaded into seperate sound objects
so
sound object | Mp3 name
sound1 = sound01.mp3
sound2 = sound02.mp3
sound3 = sound03.mp3
sound4 = sound04.mp3
then i created a variable to mimic the sound object number that is targeted, which to start off is sound1.
trackNumber = 1;
So when I want to switch tracks, or stop a certain sound with the same button and not have to write on each button like
if (trackNumber == 1){
sound1.stop();
}
if (trackNumber == 2){
sound2.stop();
}
I want to be able to do something along the lins of
sound[trackNumber].stop();
or
["sound"+trackNumber].stop
so in all, is there a way that I can incorporate a variable into a targeted sound object for a called function on it.
Or is there a way I can load the external sounds, then when I switch track numbers do something like
sound.attachSound("sound01");
sound.play();
sound.attachSound("sound02");
sound.play();
I know the attachSound method only works for sounds that are in the main .swf folder to be loaded into a sound object, But I need someway of simplifying this without writing pages of code to do something that seems should have been incorporated to make the scripting more functional.
View Replies !
View Related
Loading Real Audio Files
Sorry I'm having so much trouble with this project but now I need help with another problem. When I try to load .ram files from a framed site using the getURL function and targeting either (none, _self, or _blank) - I get a blank page on the site-
It worked fine on my server for the client's viewing but I was not using a framed site-the client does-
can anybody help me with this conundrum-
You can see the page at http://www.ralphpeterson.info
-part of the jazzcorner collective
when you click the recordings button and try to listen to a sound clip,...you'll see what I mean.
Thanx in advance if I get some help.
CobyCo
View Replies !
View Related
Loading Audio Files Cleanly
I have several audio links I want users to be able to hear. What would my button actions be to make the sound file open without opening a blank window. I just want the user's media player to start playing the file on mouse release. Thanks if anybody can help.
View Replies !
View Related
[audio] Loading Multiple Sound Files
Hi everyone,
Im having a problem loading in several audio clips using the sound() command. I searched through the boards and there was a lot of posts with no replies, or answers that werent really solutions. Im hoping for a bit of luck with this one.
Problem:
I have a base.swf file that loads an ambient bg track into my scene as well as a function to play voice over tracks when called.
Code:
//voice over audio
function audio(vo) {
myAudio.stop();
myAudio = new Sound();
myAudio.attachSound(vo);
myAudio.setVolume(20);
myAudio.start();
}
//bg audio
bg="BG_Music";
bgMusic = new Sound();
bgMusic.attachSound(bg);
bgMusic.setVolume(100);
bgMusic.start();
I have my timeline load different swf files at various times using the loadMovie() command.
Code:
loadMovie("video_01.swf", _root.video);
Each loaded swf file calls the audio() function and tells it what voiceover to play
Code:
_root.audio("voice_01");
This all works fine and dandy until the second swf file is called, then for some reason it cuts out the ambient bg track.
Any ideas? If you want to take a look at the project you can download it here:
http://vertx.ca/download/Flash/presentation.rar
Any help would be greatly appreciated.
Cheers
Mike
View Replies !
View Related
Loading JPG Files Dynamically
Is there a way to load JPG files dynamically into the library?
I want to load a JPG file (or more than one) into a flash movie, and I want to be able to make instances of that JPG in defferent parts of that movie later on.
Can anyone help me with this problem?
Thanks in advance!
View Replies !
View Related
Dynamically Loading .mov Files
I have a bunch of .mov files that i want to be viewable when different buttons are clicked. Is there a way to upload .mov files using ActionScript without embedding the .mov files?
Thank you for your time and consideration.
View Replies !
View Related
Dynamically Loading Jpg Files
Scenario: we have a button to view special events on our website. these events change on a regular basis.
Issue: I want our adminstrative assistants (no flash knowledge) to be able to upload a jpg (which has all the info for the event on it) to the site and have flash take it and update the "special events page".
Work so far: I have this working using the following code:
specialEmpty_mc.createEmptyMovieClip("specialPicture_mc", 3);
specialEmpty_mc.specialPicture_mc._x=66;
specialEmpty_mc.specialPicture_mc._y=163;
specialEmpty_mc.specialPicture_mc.loadMovie("special-event/special.jpg");
Now I want to get fancy. I need to have "TWO" jpg files alternate back and forth in the loop. Preferrably crossfading using alpha in motion tweens.
For the life of me, I can't get my mind around how to do this. Help?
tom hereford
View Replies !
View Related
Loading Multiple Audio Files Into A Single Frame
What I'm trying to do is just have a song loop continuously in a stopped frame (which is easy enough), but the song I want to use has 12 seconds of intro before the loop begins. The only way I can think of to do this is to split the intro and loop into two different files, then have it load the intro, play it once, then once the intro finishes load the loop file and play it. Unless there's some way I can have the file loop but specify that it should start over at 00:12 each time instead of 00:00. Is there any way I can do this without just having 12 seconds of frames playing the intro and then a stopped frame with the loop?
By the way, I'm using AS2 for this project.
View Replies !
View Related
Dynamically Loading Mp3 Files Via XML - PROBLEM
I am reading the xml file with no problem I have questions concerning my actionscript, am I instatantiating the sound object and calling it correctly, when I trace (bsound)it I am pulling the correct mp3 file from the array however I hear no sound, what am I doing wrong.
Any and all help is greatly appreciated
code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
bsound = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
bsound[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
firstSegment();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(showxmlPath);
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function firstSegment() {
if (loaded == filesize) {
mymusic = new Sound(bsound);
mymusic.loadSound(bsound[0], true);
}
View Replies !
View Related
Difficulty With Loading .jpg Files Dynamically
I'm trying to load a series of .jpg files into movie clips as i create and place them. The code below is my loop. If the "loadMovie" line is commented out, all the movie clips get created. However if that line is present nothing is displayed. Do i need to access these clips by _level rather than by name, or perhapse both?
ActionScript Code:
_global.Xpos = 45;
// This loop creates boxes the hold pictures, then loads them into a box.
for (y = 0; y < _global.pictures; Y++){
//output.text = //used in testing
// Creates a number of boxes to hold each of the pictures.
_root.photoArea.duplicateMovieClip("box" + y, y);
// Places the boxes with no pictures in them on stage
if(y < 1){
setProperty("box" + y,_x, _global.xPos);
setProperty("box" + y,_y, 39)
_global.xPos = 46
}else{
setProperty("box" + y,_x, _global.xPos += 89);
setProperty("box" + y,_y, 39)
}
// load the jpeg with the number of y into the box with the number of y
loadMovie("pic" + y + ".jpg", "box" + y);
}
View Replies !
View Related
Dynamically Loading JPEG Files
I have created a project that loads thumbnail JPEGs into three of four scenes. The thumbnails are MCs that act as buttons which dynamically load text and a larger JPEG image (like a catalog would do). The first scene with thumbnails loads the larger JPEG files correctly, but the subsequent files do not. I tried using the same MC instance name and code for all three scenes.
_root.image.loadMovie("JPEGname.jpg");
What am I missing?
Thanks
View Replies !
View Related
Dynamically Loading JPEG Files
I have created a project that loads thumbnail JPEGs into three of four scenes. The thumbnails are MCs that act as buttons which dynamically load text and a larger JPEG image (like a catalog would do). The first scene with thumbnails loads the larger JPEG files correctly, but the subsequent files do not. I tried using the same MC instance name and code for all three scenes.
_root.image.loadMovie("JPEGname.jpg");
What am I missing?
Thanks
View Replies !
View Related
Preloader For Dynamically Loading Swf Files
I am a 3D artist finishing my demo in Flash. My core file is about 1.7mb, and I have an asset folder of almost 100mb. The asset folder houses my 3D avi renders, which range in sizes from 200kb to 2.5mb. When I call out to load each asset file into the main swf file, I need a preloader to manage the importing of the swf asset files. I cannot figure out how to control the loading of the asset swf into the main site file. Can someone help me out? I am using 2004pro.
Thank you very much. ---J
View Replies !
View Related
Dynamically Loading Different Text Files On Click?
right now i can load a single text file into a text field no problem,..however what Id like to be able to do is when a button is clicked load a different text file into the main text field.
example:
if button1 is clicked the text field would load txtbutton1.txt
if button2 is clicked the text field would load txtbutton2.txt
if anyone can give me at start that would be great
thank you,
Ins
EDIT: I'm using Flash MX
View Replies !
View Related
Dynamically Loading & Playing Sound Files
I am building a morse code training program for my Ham Radio club. I have individual MP3 files for each letter. I have created a virtual keyboard on the program interface so that the user may type a message, the message displays in a dynamic text field, but now I want to be able to have the user select "play" to hear their sentence in morse code. I am uncertain how to script the code properly. I am using Flash MX, but can also use Flash 2004 Professional if I need to do so.
Thank you in advance for your help.
David, WD8PUO
View Replies !
View Related
Dynamically Loading Sequential Text Files
I am trying to create a project list for a site where the client can manage the site via simple txt files (no xml, too bad). I have created a "container" movie clip with three dynamic text fields "pname" "ptype" and "pdescription". I have also created the sequential text files beginning with 1 ... "text/project1_title.txt", "text/project1_type.txt", and "text/project1_description.txt".
Here is where I am at...
________________________________________
var limit:Number = 25;
var xPos = 0;
var yPos = 260;
for (i=1; i<limit; i++) {
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
yPos += this["new"+i]._height+5;
var projectTitle = new LoadVars();
projectTitle.load("text/project"+i+"_title.txt");
projectTitle.onLoad = function(success) {
if (success) {
this["new"+i].pname.htmlText = projectTitle.myContent;
}
}
var projectType = new LoadVars();
projectType.load("text/project"+i+"_type.txt");
projectType.onLoad = function(success) {
if (success) {
this["new"+i].ptype.htmlText = projectType.myContent;
}
}
var projectDescription = new LoadVars();
projectDescription.load("text/project"+i+"_description.txt");
projectDescription.onLoad = function(success) {
if (success) {
this["new"+i].pdescription.htmlText = projectDescription.myContent;
}
}
};
View Replies !
View Related
Problem Dynamically Loading Mp3 Files In I.E. With Flah8
here's the code I'm using.
var my_sound:Sound = new Sound();
my_sound.loadSound("woodenguitar.mp3", false);
my_sound.onLoad = function(success:Boolean) {
if (success) {
this.start();
_root.debug.text += "Sound loaded ";
} else {
_root.debug.text += "Sound failed ";
}
};
here's where you can test it.
http://www.reddoggmedia.com/kabillion/soundTest/
when you go there in I.E. the sound will play fine the first time. The problem is when you refresh the page it doesn't load, it doesn't even fail to load, it just doesn't play. It works fine in fireFox.
Is there some sort of caching issue with flash8 and I.E.? If you clear your cache then refresh it works. Has anybody else had this problem?
View Replies !
View Related
Need Advice On Dynamically Loading Swf/video Files
I'm trying to move from AS2 to AS3. In a previous AS2 project I used loadMovie to load content into an empty mc in a Flash skeleton UI. I'd like to do something along the same lines with a new project in AS3.
Most of the content I will load will be short individual videos where flv = 480x270, 15fps, H.264. (Other content will be .swf animations and/or images, but based on other tutorials, I should be able to noodle that out.)
A button instance needs to trigger loading a specific video. In other words, depending on where I am in the timeline, the user can only select from a video related to that content. (an interactive user guide, not video gallery type of application, so XML doesn't seem to be needed)
I need advice/suggestions on how I should approach this project - component vs. roll your own AS3 player, loading/unloading strategies, Player 9 issues with H.264, other issues.
Thanks.
View Replies !
View Related
Dynamically Loading Variables From External Files And Then Some ...
Okay guys here's my dilema,
i've got this movie clip that im creating empty movie clips inside of to be loaded up by different files . these files are listed in a text file called "Files2.txt"
im trying to make is so that i can dynamically name the instances of each empty movie clip using a for loop and a vairable name... here is my code.
Code:
stop();
for (i=0;i<_root.files.length;i++){
temp = 'Preview'+i;
this.createEmptyMovieClip(temp, this.getNextHighestDepth());
temp.loadMovie(_root.files[i],temp);
this.onEnterFrame = function() {
if (temp._width) {
delete this.onEnterFrame;
temp._x =-112 + (1.5)*i;
temp._y =-112;
temp._width =51;
temp._height =51;
trace("temp: "+_root.temp+" array"+_root.files[1]+"Preview1._width: "+Preview1._width+" | Preview1._height: "+Preview1._height);
}
};
}
the code to populate the array is in the first frame and i know its working because i did do a trace on it.
if i name the instance of the emptyMovieClip using a string value like "preview1" and replace all the 'temps' with "preview1" ... but it doesnt work with the dynamically generated name?
any help would be great
**edit... i've attached my fla and images in this zip folder...
the code im refering to is in the "mc_NavSquare" actions layer
View Replies !
View Related
HELP Dynamically Loading LOTS Of XML Files At One Time
A vendor has offered a data stream for elections coverage that is driving me nuts.
It's a county-by-county data stream for a given state's races. Each race has upwards of 250 XML files -- depending on the state -- one for each county's election returns. Thankfully, the XML files for the counties in a race are numberically ordered alphabetically.
Here's the problem -- I need to dynamically read the each county's candidate vote count from, say, 90 XML files. On the fly. The vote counts will then be used to color individual county movieclips based on the results (e.g. GOP = red, Dem = blue, etc.).
I have a script that I call when everything in the movie loads -- it starts looping to call the XML files (90 or so) and begins to read the data to color the county clips. Problem is, I can't switch to a different race (restarting the loop) without screwing up the XML calls and getting a bunch of undefined values which determine county clip colors.
Here's the function I'm using to dynamically color the county clips (imagine 100+ XML files being pulled in using this looping function):
Code:
var loadLeadersCount:Number = 1;
var loadLeadersTotal:Number = countyList.length;
var loadLeadersData:Function = function() {
tempCountyID = loadLeadersCount;
// prepend zeros and other prefixes for countyIDs
if (tempCountyID < 100 && tempCountyID >= 10) {
tempCountyID = "110" + tempCountyID;
} else if (tempCountyID < 10 && tempCountyID >= 1) {
tempCountyID = "1100" + tempCountyID;
} else {
tempCountyID = "11" + tempCountyID;
}
xmlInitLeaders = function() {
var xPathTemp:String = "/Vote/Race/ReportingUnit/Candidate";
leadersCandidates = new Array();
leadersCandidates = XPathAPI.selectNodeList(xmlDataLeaders.firstChild, xPathTemp);
tempLeaderXMLNode = leadersCandidates;
tempCandidateArray = new Array();
for (var i:Number = 0; i < leadersCandidates.length; i++) {
tempCandidateArray.push({tempParty:leadersCandidates[i].attributes.Party,tempVotes:leadersCandidates[i].attributes.VoteCount});
}
tempCandidateArray.sortOn("tempVotes", Array.DESCENDING | Array.NUMERIC);
tempLeader = tempCandidateArray[0].tempParty;
trace(tempLeader);
switch (tempLeader) {
case "Dem" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x0000ff);
break;
case "Lib" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x00ff00);
break;
case "GOP" :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0xff0000);
break;
default :
tempColor = new Color(this[countyList[(loadLeadersCount - 1)]]);
tempColor.setRGB(0x87676d);
break;
}
loadLeadersCount++
if (loadLeadersCount <= loadLeadersTotal) {
loadLeadersData();
} else {
trace("No more counties to process!");
}
}
xmlDataLeaders = new XML();
xmlDataLeaders.ignoreWhite = true;
xmlDataLeaders.onLoad = function(success:Boolean) {
if(success) {
xmlInitLeaders();
trace("XML loaded!");
} else {
trace("XML did not load!");
}
}
xmlDataLeaders.load(currentRaceXMLPath + tempCountyID + ".xml");
trace(currentRaceXMLPath + tempCountyID + ".xml");
}
Here's the combobox init code that sets up a listener for when someone would switch to a different set of XML files (for a different race):
Code:
// function to initialize race selection combobox
var initSelectRaceCombo:Function = function() {
this.comboSelectRace.dataProvider = raceList;
comboSelectRaceListener = new Object();
comboSelectRaceListener.change = function(event_obj:Object) {
currentRaceXMLPath = event_obj.target.selectedItem.data;
loadState();
loadLeadersCount = 1;
loadLeadersData();
}
comboSelectRace.addEventListener("change", comboSelectRaceListener);
currentRaceXMLPath = this.comboSelectRace.selectedItem.data;
selectRaceClip._visible = true;
comboSelectRace._visible = true;
creditsAltClip._visible = true;
loadState();
initCounties();
loadLeadersData();
}
Any thoughts? There's gotta be a better way to do this, but I can't lock down the combo box and prevent someone from switching to another race while they wait 30 - 90 seconds for the XML load loop to finish.
Thanks,
IronChefMorimoto
View Replies !
View Related
Targetting Links In Dynamically-loading Text Files....
'Ello.
Looking for a wee bit of help in Flash MX....
What I'm trying to do is make a site in Flash that's easily updatable by using externally-loaded text files. It's OK so far, really keeping the file size down, but I've hit a stumbling point that REALLY puts the dampers on the project.
In several of the sections, I want a list of links/content to appear that when clicked on, loads a web page/ html file/ movie file into the browser. The <*A HREF> (* added so that the board software doesn't underline the rest of this post as a hyperlink...) tags work fine in the text files and are recognised by Flash, but they always load the content into the same bvrowser window as the movie, and force the user into clicking the "back" button to view the main site again.... which returns them to the main menu rather than where they left off (I tried adding more anchors, but that got the browser confused and it started doing very odd things).
SO....
is there a way, using externally-loaded text files, that I can make a link in said text file open in a new window (like TARGET=_blank, which doesn't seem to be supported by Flash) rather than iin the same window? Or will I have to bite the bullet and render all the text within the movie, thereby requiring me to re-upload the main movie each time a change needs to be made to the lists (which will be at least once a week!)?
Help...?
View Replies !
View Related
Loading Txt Files Dynamically, Is The Amount Of Text Limited?
Hello,
I've been using a scrolling list of gigs for a website, the text is loaded from a txt file and formatted with html (the font is embedded).
Here* is just the page on its own
(scroller on the right) This has been working fine up until now, I've been required to add more dates to the list.... Only about quarter of it is cut off the bottom, and it is always in the same place which would suggest that there is a limit to the amount of text this can hold !! Is this the case? If so does anyone have any suggestions as to what I can do about it?
Thanks in advance!
Pat
View Replies !
View Related
Audio Player That Requires Access Codes To Play Audio Files. Possible ?
LINK
I've just uploaded this rough piece of website for an upcoming band. If you click LINK you will see two flash movies. The one on the bottom is the audio player. What they want instead of JUST an audio player, is a player that plays certain "secret" audio files if you enter the correct 6 digit number. So imagine a text field and a submit button next to the < || > controls. I'm still getting to know Flash and I have no idea how to create something like this. Anyone have any advice? Any tutorials out there? Info? and finally...this IS possible right?
Thanks
View Replies !
View Related
Audio Player/playing Audio Files Externally (mp3)
I've designed the audio player with all of the necessary buttons. I'm trying to play the mp3 files in an consecutive order. I am having trouble stopping or pausing, rewinding and fast-forwarding the mp3 file. I also have a next button and a back button and I don't know how to get them to work either. I have a slider, but can't get it to work either. Please help! I tried to follow the tutorial on flash kit, but wasn't quite understanding it. I would greatly appreciate this if someone could lend their knowledge and support.
Thanks in advance!
PR Gip
View Replies !
View Related
Dynamically Checking Audio
Does anyone know how to write a dynamic script within the main timeline of which a swf file containing audio is being loaded into, to check the audio as it is playing…and once it is done, have it navigate to a different frame, not within the loaded swf file with the audio, but the main timeline? This is attached to the main timeline, not a button. I appreciate all those that may be able to offer some help. Thanks and God bless.
View Replies !
View Related
Loading Pictures Dynamically To A Dynamically Loaded Clip
Here's the issue. I'm creating a video player and EVERYTHING is working swimmingly except for one thing. On my list of available videos (which is XML driven) everything reads in correctly and the movie clips are added correctly, but I can't get the thumbnails to add to the stage. Someone help!! Here's the code I'm using:
EDIT: Oh yeah, the thumbs are located in a separate directory and the location is indicated in the xml file. the "vidList" variable is my XML list.
PHP Code:
function loadPics():void //this is the first function called...{ for(var i:uint = 0; i < vidList.length(); i++) { var picLoader:Loader = new Loader(); picLoader.addEventListener(Event.COMPLETE, onPicLoaded); picLoader.load(new URLRequest(vidList[i].thumb)); trace(vidList[i].thumb); picLoader.width = 72; picLoader.height = 54; picLoader.x = 0; picLoader.y = 0; picLoader.name = vidList[i].title; } populateList();}function onPicLoaded(e:Event):void //this should be called after each pic is loaded, but the trace statements have yet to appear.{ trace("________________________"); trace(e.currentTarget.name); trace("________________________");}function populateList():void //everything in here works fine{ for(var i:uint = 0; i < vidList.length();i++) { var lItem:ListItem = new ListItem(); lItem.title.text = vidList[i].title; lItem.caption.text = vidList[i].caption; lItem.x = 5; lItem.y = 7+(79*i) lItem.filters = [dsf, bf]; lItem.name = vidList[i].title; list.addChild(lItem); lItem.addEventListener(MouseEvent.CLICK, clickVideo); }}
Can anyone give me any kind of suggestion on how to do this?
Basically, after all the foundation stuff for the video player is done, it calls the loadPics function. That is supposed to load each pic and then upon the pic being loaded, it was going to call the onPicLoaded function and I was going to (somehow) pass them to some type of array. Then, in my populateList function I would just use "i" to put the correct pic with the correct video.
Please help! I can give you more if you need it. I just don't know what else to post.
View Replies !
View Related
Dynamically Loading Images Into Dynamically Loaded MovieClips
I'm read through many of the posts and found several on this topic, none, however, that addressed all that I need addressed. I've tried several of the suggestions but so far nothing seems to work.
What I want to do is alter the width of images loaded dynamically into a dynamically loaded set of movieclips. all of the widths of the images are different, but i want them set to the same width. The width seems to stay at zero, however, and I cannot seem to change it.
Here is my code:
for (var i:Number = 0; i < 8; i++){
var mc = attachMovie("rect_mc", "r" + i, this.getNextHighestDepth());
mc._x = 90 + (i * (mc._width+5));
mc._y = 375;
mc.img_txt.text = "image" + (i+1);
mc.img_mc.loadMovie("myPic" + (i+1) + ".jpg");
mc.img_mc._xscale = mc.img_mc._yscale = (50/mc.img_mc._width) * 100;
};
The last line is the one that does not function properly.
I'd appreciate any help anyone can provide. thanks.
View Replies !
View Related
Problem With Loading Jpegs Dynamically Into Dynamically Created MC's
hey all. I got a problem with loading jpegs dynamically into dynamically created MC's. I've been using NEIL WEBB's tutorial on dynamic creation with event handling through the LISTENER component, which you can see here http://www.actionscript.org/tutorial...MX_2004_Part2/
I have slightly altered the script to accomodate the fact that I want to attach a movieclip with text fields and image holders within it, but the code aint too different I don't think.
Code:
stop();
myMCL = new MovieClipLoader(); //define MovieClipLoader
myListener = new Object(); //define listener
myListener.onLoadComplete = function(targetMC){ //set the onComplete function on listener
trace("targetMC = " + targetMC._name);
targetMC.onPress = function() { //define onPress within function
}
}
//****************************
function initClips(){
//trace(_global.gallery_cnt);
for (i=1; i<=_global.gallery_cnt; i++){
//trace("Attaching Clip - " + i);
this.gallery_TN_holder.attachMovie("TN_Holder", "TN_Holder" + i, i); //attach the movie
this.gallery_TN_holder["TN_Holder"+i]._x = (i-1)*90; //spacing
this.gallery_TN_holder["TN_Holder"+i].TN_Text.text = _global.gallery_array.description;
[i] [i]myMCL.loadClip(_global.gallery_array.main_thumbnail ,this.gallery_TN_holder["TN_Holder"+i].TN_Image);
//load images into clip
}
play();
}
//****************************
myMCL.addListener(myListener); //associate listerer with MCL object
initClips();
The first line ("trace") in bold outputs
Quote:
targetMC = TN_Image
targetMC = TN_Image
which you can see is resulting from the second bold line.
Basically I need some direction with this as to how to reference the clip target for the loaded JPEG, as my output in the movie shows the attachMovie works, as does the text change within the individual "TN_Holder" clips. What the hell am i doin wrong, cos my eyes are kinda starting to go kinda funny looking at this stuff!!!!!
Thanks for any help!
View Replies !
View Related
Pausing SWFs With Dynamically Loaded Audio Within Them
Hi,
I'm creating what's turning out to be a rather long PowerPoint-style presentation in which the user clicks from slide to slide and watches an animated .swf with dynamically loaded audio. Some of the sections are rather long, and I'd like to give the user the ability to pause and play by button click.
I know how to stop and start the container MC that's loading the swfs, but it doesn't stop any embedded MCs within it and more importantly doesn't pause the sound object. Is there a way to pause sound objects on a global level so the button just pauses whatever object is playing? Also, I have a few sections with FLVs loaded into the SWF. I need something that will also pause them.
I'm not looking for someone to write my code (although a short example would be greatly appreciated), just looking for a game plan of sorts. I'm running MX04 and AS2.0 (I think).
Thanks!
-Sandy
View Replies !
View Related
Preloading Multiple Images And Audio Clips Dynamically
Does anyone have pre-exisiting code that would allow me to preload multiple images and audio clips dynamically? I have created a XML-driven image slideshow with audio clips and I would like to preload everything before the slideshow begins, preferably with a progress bar. Please help, this is really urgent!!
Many Thanks.
View Replies !
View Related
Audio Files
Hi I'm pretty new to Flash and I am having trouble with my audio files. I imported a sound file from a shared library but i cannot control it from my main movie. I know that I am sharing it properly because I can drop it in the timeline and it will play. The problem is that I do not want it in the timeline and i only want it to be played when the user pushes the play button. I tried using the same code to play the movie that I would if the file was in the original movie and not the shared one but that didn't work. If anyone can help me with this that would be great.
P.S I am using flash 5
View Replies !
View Related
Several Audio Files
How can I get a play button to play an audio clip from the library and then get it to stop playing? Then I need to have another play button point to another audio clip.
Do I need to have all the audio clips in the timeline?
View Replies !
View Related
Mp3 > .swf Audio Files?
alright, so i have downloaded this simple flash file here: http://www.flashkit.com/movies/Sound...8056/index.php i tried to edit it to make it play my songs, but it keeps giving me an error. anyone know why? and one more question, how to i convert it from .mp3 > .swf to play the files? thanks
View Replies !
View Related
Real Audio Files
Howdy, this is my first post!!
I'm building a website for a local Producer that I know and he wants to put real audio files on the flash site for people to listen to. I'm using shockwave at the mo if thats any help.
Not sure what would be the best way to do this, sorry about the vague question, please help.
Echo_rev
View Replies !
View Related
Preloading Audio Files
I have a Flash movie with 7 Audio files I'd like to have preload before the movie starts playing. I know how to preload frames, but how do I preload Audio files that are in my Flash Library???
Please advise!
View Replies !
View Related
Streaming Non-mp3 Audio Files?
My current web host does not allow mp3 files and I would prefer to keep all my files in one place, rather than storing mp3s on an external file hosting service.
What other formats can be streamed in Flash? I was pretty sure .swf and .flv sound files would work, but they aren't - unless I'm doing something wrong.
Here's the basic code I'm using:
Code:
private var _song:Sound;
private var _songFile:String;
then in an event handler:
Code:
_songFile = _songNameField.text;
_song = new Sound();
var soundFile:URLRequest = new URLRequest(_songFile);
_song.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_song.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
_song.load(soundFile);
I don't see a message from either of my error handlers, just no sound. The sog.swf file itself works.
View Replies !
View Related
Streaming Non-mp3 Audio Files?
My current web host does not allow mp3 files and I would prefer to keep all my files in one place, rather than storing mp3s on an external file hosting service.
What other formats can be streamed in Flash? I was pretty sure .swf and .flv sound files would work, but they aren't - unless I'm doing something wrong.
Here's the basic code I'm using:
Code:
private var _song:Sound;
private var _songFile:String;
then in an event handler:
Code:
_songFile = _songNameField.text;
_song = new Sound();
var soundFile:URLRequest = new URLRequest(_songFile);
_song.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_song.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
_song.load(soundFile);
I don't see a message from either of my error handlers, just no sound. The sog.swf file itself works.
View Replies !
View Related
Audio Files In Flash
I have several wav. files that I have imported into my flash project, which has left me with a huge file when compiled. I have cool edit pro and I ahve converted a few files to mp3 format but when i try to import them into my flash project it says that it can not read the files. Are there certain options I need to change when converting my wav to mp3 files so flash can read them?
View Replies !
View Related
Playing Audio Files
Hi there
I have been out of the flash loop for a while any who...
I am looking to create a flash file that plays external audio files I want to put this on my web site so the user can sample the product before purchase or download. The audio file format shouldn't matter.
So since I have lost most of my scripting skillez "was pretty decent at flash 5" I need to be pushed in the right direction.
Any advice on books sites tutorials etc.
Thanks
View Replies !
View Related
|