Dynamically Loading Sounds And Movies
Hi! I haven't seriously done flash for a while now because I've focused more on other things and I'm now a bit out of the flow when it comes to Flash 8. Now, previously I had made an image viewer by making a PHP file parse the contents of a folder to XML and then a swf file interpreted the XML and dynamically loaded any images etc. Here's the thing in action http://blippo.addr.com/img Pretty cool. Now what I'd like to do is also expand that so it's able to dynamically load sounds and movies too. So if you click on a picture there it loads it and if you click on a sounds, it plays it. Now, can anyone point me to some functions, tutorials or existing code of the best way to dynamically load sounds and movies? Basically anything you can find helps. Thanks a lot.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-23-2006, 05:43 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Sounds Dynamically?
I want to have a few different sound loops for background music that the user can select from. I would have 3 buttons called sample1, sample2 and sample3. Is there any way to load the sounds from a URL instead of importing them as part of the flash movie? This way, I can change the sounds periodically and just replace the sound on the server keeping the same URL to pull the sound from. Is this possible and if so does anyone know how to do this?
Thanks.
Dynamically Loading Sounds From A .swf's Library
Is it possible in Actionscript 3 to have a bunch of sounds in your .swf's library that you can load dynamically? The Sound.load seems to want a url of something external. I would like to put a whole collections of Sounds in one swf 's libarary and then dynamically chose the one I want to play at runtime.
Dynamically Loading Movies Into Movies With Variables
This might be a kinda tough one. I'll explain the best that I know how.
I want to load jpg images into a movie/button (movie clip with a button instance inside of it with another movie clip inside the button), but I need to do it dynamically.
I was thinking about naming all of the files the same but just change the numbering at the end. Then I can just use an i value to obtain the next file.
Code:
for(i=1;i<5;i++){
loadMovie("something"+i+".jpg","mv_btn_"+i)
}
so, basically I have 5 buttons with 5 images to import. The buttons already have the proper numbers on them, I just need to import the clips into the corresponding button.
Loading Movies Dynamically
Hi,
Can you load movies that are inside the library dynamically?
I know that you can load external .swf's using loadMovie() method.
Thanks.
Loading Movies Dynamically
Hello to all of you guys,
Could someone tell me where to look for a solution on my task.
I have main timeline.
One of the mc's loaded into it on frame X and out of that mc it calling to load external .swf's to the upper portion of the main timeline. Ok, it loads and runs.
Now I have to script these mc's to load different .swf's onto the same portion with unload of previos .swf.
This is where my knowledge stops.
Do I need to set label "true" in frame 1 in "dummy" mc where all these .swf's will be loaded and then onMouseDown it'll evaluate boolean?
Any suggestions, please
piktograf
Loading Flv Movies Dynamically
i have 9 flv files which i've created swf files for
each swf is just the standard flv player component put on the stage and linked to the appropriate flv file
they all work individually and when i put them on an HTML page they work fine
now i want to create a container movie that when a button is pressed it will load an swf
so on the button i put this action
Code:
on (press) {
_root.container.loadMovie ("toload/1A.swf");
}
then when i play the container movie and press the button it loads the appropriate swf file, but the flv doesn't come in and play.
how can i fix this?
should i maybe put the component in the container movie and somehow on(press) change what flv file the component player is linked to?
is there another way to stream / play flv files?
thanks
Loading Movies Dynamically
question, can a movie that has been uploaded to youtube.com or video.google.com, can they be put in the XML file and used in the tutorial that Lee did?? Would it be the same thing just put the movie link in the proper XML spot??
Thanks
Loading Quicktime Movies Into SWF Dynamically
I am making a website for a company that has a bunch of clips of commercials, music videos, etc in quicktime .mov format. When the button is clicked I want to load the quicktime into the swf. The quicktimes need to open in the same spot and replace the old movie. I have tried a bunch of different options, nothing seems to work. HELP! please
I need help with the scripting and making an instance if one is needed.
FMX & Coldfusion - Loading Movies Dynamically
We have a library of swf movies we are trying to load into swf interface, but the movies movies don't seem to load.
loadMovie(MOVIENAME, "movie"); - located in the first & only frame of the interface.
MOVIENAME is the name & path of the swf we load into "movie", the holder for the swf from the librabry.
Coldfusion writes the html page. It assigns the name & path of the swf to MOVIENAME, but obviously we are missing something.
Does anybody have any examples of how the variable is supposed to appear in the html so that Flash will know to load the path & file?
I'm attaching the zipped fla.
Thanks,
AC
Working With Dynamically Attached Movies Inside Dynamically Attached Movies
I'm trying to work with a movie I dynamically attached inside of another movie, what is wrong with this code for setting the _x and _y of the inner most movie, and how do i fix it?
Code:
this[iButton].attachMovie("More","M"+iButton,1000+iButton);
this[iButton].["M"+iButton]._x = 10;
this[iButton].["M"+iButton]._y = 10;
Sounds And Movies
Ok, I'm trying to make an intro to a "Game" im making called Whack-A-Cow. ANyway. I have an intro with fading text and such and peaceful music. Then I want it to stop and this rock music comes on and the logo for whack a cow drops down. Now I can get the whole part with the peaceful stuff, but how do i make the next music stay while keeping my stop action so that my movie clip will play...and then play the next music...*sigh*. I'm jsut plain old newb.
Sounds In Different Movies
Hi Hope somone can help with this. I have attached sounds to my movie via
vo1 = new Sound();
vo1.attachSound("can11");
and playing with vo1.start();
This is working fine a the movie when I test it on it's own, however it is part of a bigger project and when it's is called into the main movie the sounds do not work.
Would really appreciate being put on the right track with this one.
dabush
Dynamically Loaded Sounds
Am I missing something really stupid here?? All I'm trying to do is load a sound into a var (non-streaming) and then play it.
This is what I have:
var s = new Sound();
s.loadSound("click.mp3");
s.start(0,1);
But it's not working! No sound is played, but the object does exist...
Help?
-----------------------------------------------
www.liquidfuzion.com
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
[MX04] Sounds & Movies
what are the codes that could control sounds and movies? how to play, puase and stop them (each seperatly) if we do have more than one sound/movie in the same fram?
could anyone help with a perfect code?
Controlling Sounds In Sub Movies
Hi Hope somone can help with this. I have attached sounds to my movie via
vo1 = new Sound();
vo1.attachSound("can11");
and playing with vo1.start();
This is working fine a the movie when I test it on it's own, however it is part of a bigger project and when it's is called into the main movie the sounds do not work.
Would really appreciate being put on the right track with this one.
dabush
Dynamically Loaded MP3's As Event Sounds
Ok, the below AS works like a charm on my local machine both in test movie and as a standalone .swf. But when I transfer to a web server it does not work.
_global.gCurrentTrack = new Sound();
gCurrentTrack.loadSound("test.mp3", false);
gCurrentTrack.onLoad = currentTrackLoaded();
function currentTrackLoaded () {
gCurrentTrack.start();
}
After doing a little debugging I found out a few things.
On a remote web server........
1. the .onLoad function (currentTrackLoaded) is called immediately for some reason as soon as the mp3 begins to load (not after the load is complete).
2. even if i confirm that the entire mp3 is loaded by other means and then try to start it, it will not play.
3. If I change it from event to streaming (TRUE) it plays just fine. Streaming is not a good solution however because the files are massive and the streaming time will vary depending on the user's connection so i need it to be an event sound and play when completely loaded.
Any ideas?
Statusbar For Dynamically Loaded Sounds
hi all,
i have a small problem: i am dynamically loading sounds into a MC:
onClipEvent (load) {
snd = new Sound(this);
}
on a button i start the sound when klicked:
on(release){
_root.bsp.snd.loadSound("sounds/loop1.mp3", true);
}
now the thing is, because the sound is being streamed it takes a little while until enough data is downloaded to begin playback. therefor i need a status bar of somesort, to let the listener know, the sound is being loaded.
anyone got any idea or anyone know of any tutorial??
Dynamically Loaded Internal Sounds
In both as1 and as2, sounds called with the mySound.attachSound(linkagename) only appear to play if they reside in the root of _level0.
Is that correct? (I haven't read this restriction in tutorials)
If it is, where can I include a preloader for the sound-containing swf?
thanks
Dynamically Preload X Amount Of Sounds
HI, I'm having a hard time getting help with this thing.
I'm loading items from a database which will populate a scene. The items and their placement is given by the values in the database.
So each item must play a sound when moused over. These sounds will be given by the database also.
I need to preload all the sounds when the scene opens, and have the sounds play instantly when you mouse over an item.
How would I do this??? I can't use
Code:
mySound = new Sound()
Since I need to give Ids to the sound items, like Sound1, Sound2 etc. Since I don't know how many of these there will be, and the related button should be able to trigger it with it's similar ID...
Thanks for any help in advance
Dynamically Stretch Sounds In Flash
Hi guys,
I think this might be a tough one:
Is it possible to stretch the playback of an MP3 file using Actionscript?
Time stretch is when you slow a sound down but don't change its pitch. Basically, it works by chopping up the sound into milliseconds and splicing duplicates of the bits in, thereby stretching the sound.
Anyone heard of doing anything like this in Actionscript?
I'd love to know!
Multiple Dynamically Attached Sounds
I have 3 sounds, clickSound, overSound and introSound are the sound object names. The intro sound works.
ActionScript Code:
var introSound=new Sound(intro);
introSound.loadSound("lightawe.mp3",false);
Then I have it play after the whole flash file is loaded and moves to the next frame; this is the code inside that
ActionScript Code:
introSound.start();
But the other sounds, clickSound, and overSound never work.
I found out if I tell introSound to load another mp3 itll work, but I dont want that.
ActionScript Code:
var overSound=newSound();
overSound.loadSound("over8.mp3",false);
myStuff_mc.onRollOver=function(){
myStuff_mc.gotoAndPlay(2);
overSound.start();
}
I've tried overSound.start(0,1) also, but that didnt work either. Can anyone help me out?
Thank you!
-TJ
Can I Dynamically Link And Play Sounds?
I am building a morse code training program for my Ham Radio Club. I am wondering how to script the code that would allow the user to type (via a virtual keyboard on the program interface) a sentence, linking each dynamically selected letter to a sound file (MP3), and then play the setence in morse code when the play button is selected? Displaying the typed text in a dynamic window is the easy part, but linking each selected letter to a sound file, and playing them in sequence is where I am stuck.
I cannot find any help for this type of script via manuals and help files. Thank you in advance for your help.
Sincerely,
David, WD8PUO
Multiple Dynamically Attached Sounds
I have 3 sounds, clickSound, overSound and introSound are the sound object names. The intro sound works.
ActionScript Code:
var introSound=new Sound(intro);
introSound.loadSound("lightawe.mp3",false);
Then I have it play after the whole flash file is loaded and moves to the next frame; this is the code inside that
ActionScript Code:
introSound.start();
But the other sounds, clickSound, and overSound never work.
I found out if I tell introSound to load another mp3 itll work, but I dont want that.
ActionScript Code:
var overSound=newSound();
overSound.loadSound("over8.mp3",false);
myStuff_mc.onRollOver=function(){
myStuff_mc.gotoAndPlay(2);
overSound.start();
}
I've tried overSound.start(0,1) also, but that didnt work either. Can anyone help me out?
Thank you!
-TJ
Stop Sounds In Multiple Movies?
I have a page with multiple movies that load sound.
The sound loads and stops fine with one movie.
When two are pressed the sound overlaps.
Is there a way to stop the first sound when the second begins?
Each movie is an individual file on the page.
Sounds In External Movies Dont Play
so i have this multi-layered app
one layer is a splash
another is a list of games
yet another would be an actual game
if i play the game individually, the sounds play
if i load then in one of the other layer, using loadMovie, they dont
uh...
why?
my sounds have linkage set, export on first frame, so they 'should' be contained
but not when loaded into another movie?
Stopping / Muting Sounds From LoadMovieNum Movies
Hi I've got a main movie which in the beginning starts som sound like this
_global.sound1 = new Sound(mcBackground);
// loaded into a MC called mcBackground
_global.sound1.attachSound("soundOne");
_global.sound1.setVolume(20);
_global.sound1.start(0, 9999);
I then on frame two stop the movie (music keeps playing)
But now my new movie is loaded at frame 2 - how can i from this movie stop AND start the sound1 object at the main movie?
Cheers, Mads
AS3 Dynamically Changing Play Rate Of Streamed Sounds.
I'm wondering if this is possible, I'm making an animation and I want to add a degree of interactivity. Basically when the viewer presses and holds a specified key the sound rate would resample from 44100khz to 22050khz, and the frame rate would also play back half speed. A friend showed me a AS3 "scratch table" which leads me to believe that it may be possible, but my main problem is that that was an external single sound and I need to global effect and de-effect all my sounds that are being streamed into a slower rate and back at key press.
The scratch table i was talking about is here: http://lab.andre-michelle.com/scratching
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.
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.
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!
Loading Movies Inside Other Movies In An Ext Movie Holder?
Here's one for you:
I've got my main movie that has a movie holder on it (entitled movieholder.) The buttons on the left control what goes in the movie holder. In one of the movies there is a list of songs that are actually buttons. These buttons call up another movie(with MP3s). How do I get the MP3 movies to go into "movieholder" when they are being called by a button inside 'movieholder'
I'm using MX
Hope that made a slight bit of sense!
Thanks for any help,
Graeme
Loading Movies Into Movies With Scroll Bars O_O
I have a site where I'm showcasing my talents (Obviously figuring scripting out won't be one of them) and I load movies into the central area by using simple commands, and it all works. Now I need to have of of those movie to scroll around, because I'm showcasing banners and have more than 400 pixels of height can fit.
I was thinking of using the same textField system that I used for my news section, but replacibng the textField part was a different thing for Movies.
There's got to be an easier way though. Can anyone help me?
Ummm... Loading Movies Inside Movies.... Help?
I posted a question about this a month or so ago, but now (I've had to work out problems on other sites in the meantime) I'm totally ready to figure this out!
I have a VERY large Flash Web site. So, it was suggested that I chop up the site into a few smaller movies. From there, I would set up a main page with a ["target"?] movie clip nested in it. Then, when a button has been pushed, the corresponding swf loads inside the movie clip. I think I can handle that... (although a nice tutorial would be great!)
The problem I'm having is... These swf's can be 'called' from each other, meaning the same buttons will be in each movie. However, the buttons will trigger different frames in each movie, depending on which movie you're already in. I'm betting this is confusing...
EXAMPLE: Every page has 4 buttons, "Who We Are", "Success Stories", "Portfolio", and "Contact". From the Home page you can push any of these buttons and it will go to the first frame of the corresponding movie and a quick, little animation displays as it takes you into the page. That's great. The problem is that, if you were in the "Who We Are" page and clicked "Contact" it should NOT go to Frame 1 of that movie... It should go to Frame 30, because there is a specific animation that connects "Who We Are" to "Contact" that is not the same as the connection animaton between "Home" to "Who We Are". So how do I get the code to be more specific?
HELP!
~Vik
http://www.explorecore.com/index3.html
Sound Linkage When Loading Movies Into Movies
I have an intro.swf file that is basically a movie with sound that is exported for actionscript but not exported in the first frame. I just stuck it in a movie on my timeline and it works great and the preloader works because it doesn't load the sound before the preloader. I use :
musicSound = new Sound();
musicSound.attachSound("music");
musicSound.start();
to play the sound in intro.swf.
However, now this intro.swf gets loaded into an index.swf and everything works fine and the sound plays as long as I have the sound included in BOTH the intro.swf and the index.swf and the sound is exported on the first frame in the index.swf. I was hoping I could remove the sound entirely from my index.swf since it already loads into the intro but so far I haven’t been able to figure out how without breaking the sound. Any advice or help would be greatly appreciated.
Frustrated With Loading Movies Inside Movies.
Ok here's my sight:
http://www.fantim.org/811/index2.html
This is my second attempt at making an all flash site. I got two questions.
1. Lets say I have three movies. Movie1.swf Movie2.swf and Movie3.swf
Movie1.swf has Movie2.swf loaded inside of it. Is there anyway to make Movie2.swf load Movie3.swf inside Movie1.swf ? Does that make sence?
2. Is there anyway to load only certian parts of a movie into another movie? For example:
I have this file http://www.fantim.org/fantimshow/movies/movies.swf (Don't mind the chopiness of it) As you can see it has excess stuff on the sides. Is there anyway to load this within another movie without showing this excess stuff?
Any help would be appreciated.
Thanks
Loading/unloading Movies In Loaded Movies :|
Yeah, I know that sounds confusing. Lemme explain:
- interface.swf it's my main movie;
- interface.swf load section1.swf in a specific container called containerMC (duh! );
- section1.swf load other movie, section1a.swf;
- I need a button in section1.swf that load section3.swf in the same main container (containerMC in interface.swf), unloading section1.swf and section1a.swf.
Well... I need some tips about the action of my 'overloaded' button
Sorry about my english
[]'s
Edu
Frustrated With Loading Movies Inside Movies.
Ok here's my sight:
http://www.fantim.org/811/index2.html
This is my second attempt at making an all flash site. I got two questions.
1. Lets say I have three movies. Movie1.swf Movie2.swf and Movie3.swf
Movie1.swf has Movie2.swf loaded inside of it. Is there anyway to make Movie2.swf load Movie3.swf inside Movie1.swf ? Does that make sence?
2. Is there anyway to load only certian parts of a movie into another movie? For example:
I have this file http://www.fantim.org/fantimshow/movies/movies.swf (Don't mind the chopiness of it) As you can see it has excess stuff on the sides. Is there anyway to load this within another movie without showing this excess stuff?
Any help would be appreciated.
Thanks
Resizing Movies Dynamically
How can I resize my flash movies when the browser window resizes? Is this even something that ActionScript can do?
Dynamically Creating New Movies
what i am trying to do may be quite simple, i could just be overlooking some cool new flashmx feature.
i want to create a bunch of new movies, or actually just attach a movie to new instances. but i don't want to have to access each of the new movie clips by the id names i give them.
this is what i want to do (not correct code, but you will get the idear )
_root.attachmovie (people, count, 0 ) /* people is the id of the movie clip i already have made, count is what i want to use instead of a name, and 0 is just the level. */
now to access the movies i made i want to do something like
for (i = 0; i < something; i ++)
{
_root.i._x = something;
}
but i know that i can't use the i there, i am trying to find an alternative.
so if you know what i need please feel free to email me or just post back. thanks.
scott nadeau
(i am eating turkey soup right now)
hardrocksr@hotmail.com
Dynamically Controlled Movies
Ok I am trying to make a site that when your on one page and click to go to another a little animation will play and then an entrance animation will play for the next part. My problem is i can figure out how to tell flash to look at were its at in the timeline currently and then load the corresponding exit movie and after that plays the new entrance movie. If I didnt explain this very well here is an example of what i'm talking about.
http://www.whoswestudios.com/flashsite.html
Any help or links to help would be greatly appreciated.
Dynamically Creating Movies
I created a movie clip of a dotted line that follows the path of a rectangle. I want to dynamically create a bunch of these movies.
this.attachMovie("RotatingDottedLine", "dl_mc", 80);
Isn't this all there is to it? The movie is "RotatingDottedLine", I want to assign it to the variable dl_mc and the depth (80) shouldn't matter. This is in a single framed flash document so there isn't much to it.
Accessing Dynamically Placed Movies
Just wondering if anyone can point me in the right direction on this one.
To cut a long story short I'm using ASP and an Access database to load in different swf filepaths, loading them into Flash, converting them into an array and then loading in the relative file. The variables loaded in are named thus:
swf1=h40_1.swf&swf2=h40_2.swf&swf3=h55_1.swf and so on.
And this is my code:
Code:
onClipEvent (data) {
machine = new Array();
//j is the total number of files from the database, loaded from ASP page
for (i=0; i<j; i++) {
machine[i] = eval ("swf"+(i+1));
loadMovieNum (machine[i], i+5);
}
}
Which strangely enough, considering I wrote it all myself works really well.
BUT...
I obviously need to position these loaded swfs on the stage exactly where I want them, which is where Im stuck.
I can't even work out how to do it with an empty MC that I attach beforehand.
If someone could shed some light on the subject I'll buy them the best cappuccino in the world!!
How Can I Dynamically Attach Movies In A Loop? Help
hi, im getting a bit stuck with trying to attach movieclips according to a randomized array (for a card game)
all it seems to do is writeover every card with the next one so all im left with is the last card of the hand being shown
below is my code:
tempx = 210;
tempy = 315;
for (i = 0; i <13; i ++){
trace((hand1[0][i][0]*10)+(hand1[0][i][1]));
j = new String(i);
//the element in the array give the linkage number
//i have tried to assign a variable j that increments every time
// so that can be the reference name on stage
//have tried to assign i to be the layyer
this. attachMovie((hand1[0][i][0]*10)+(hand1[0][i][1]),j
, i);
this._x = tempx;
this._y = tempy;
//so is positioned right slightly every time
tempx = tempx +10;
}
any help would be very much appreciated!
thanks
chimpo
Dynamically Attaching Movies (attachMovie)
Hey,
I am trying to biuld a dynamic navigation menu in flash (5) and the menu buttons are based on some PHP I am loading to flash. I can load the content fine. Determine the number of buttons needed. I can even attach one movie kind of successfully. It attaches the first one to the right area, but does not move to new coordinates. So my question is, if you look at my code, can you see if I am doing anything wrong? Or forgetting something? I've been stumped for a while. This is my first time working with attachMovie, so thanks in advance for any help
// CODE
// For this example, _root.section_2_primary_count = 4
var sub_nav_path = _root.sub_nav_main.sub_nav;
if ( _root.section_2_primary_exist != "0" ){
// set initial coordinates
var attachedMovie_x = 6;
var attachedMovie_y = 10;
i = 1;
while( i <= _root.section_2_primary_count ) {
attachedMoviePath = "sub_nav_section_" + i;
sub_nav_path.attachMovie( "nav_point_template", attachedMoviePath, i + 1 );
sub_nav_path.attachedMoviePath.attachedMovie_x = attachedMovie_x;
sub_nav_path.attachedMoviePath._y = attachedMovie_y + 18;
attachedMovie_y = attachedMovie_y + 18;
i++;
}
}
// END CODE
Thanks,
-c
Dynamically Created Movies Not Showing Up
I am having trouble getting a movie to work.
I'm creating an mp3 player that uses an xml file for all of its information. When it loads, it reads through all the band names and creates empty movie clips for each one, and creates a textbox in each movie clip, and puts the name of the band in the textbox. That works fine, the bands show up.
The problem is that when the user clicks on one of the bands, i want it to delete all the mvoie clips with the band names in them and recreate a new list with all the album names for the bands. This is where I am stuck. When I click on the band name, I get it to delete all the movie clips with the bands... but then the movie clips for the albums wont show up. I have used traces, and the movie clips are there, and the text that is supposed to be there exists, but they dont show up.
If I dont delete the band names first, then the albums actually do show up... but if there are less albums than bands in the list... which there will be, then it will show bands down below the albums!
Please help if you can! I have included my files as both flash 8 and mx 2004. the fla is commented!
Kyle!
[F8] Masking Dynamically Loaded Movies
I'm trying to dynamically load images into a container "bg", then use a mask layer on the container. The mask is an animation that acts as a transition for the images. If I place a sample image as "bg", the whole mask/transition works. But if I try to load an image into container "bg", then it doesn't work.
Here's my AS for trying to make this work dynamically:
PHP Code:
bg.setMask(mask);
btn1.onPress = function () {
bg.loadMovie("image1.swf");
mask.gotoAndPlay(2);
}
|