I'm trying to use an array adapted from AS2 script to load random swfs called "koan_1.swf" or "koan_2.swf" etc into a "koan_loader_mc" on the stage. Each "koan_#.swf" has code in its last frame to both advance the "shuffle" array in the action script in the first frame of the stage and to load the next koan swf. The code below -- almost -- works, but....?
Frame on main stage:
// creates function called at the end of koan_#.swfs function shuffle(a:Array) { for (var ivar = a.length-1; ivar>=0; ivar--) {
I don't think I'm as familiar with arrays as I need to be to complete the following project - I've read about 60 posts and no one seems to be doing exactly what I am. Here's what I need to do: From a main swf (home.swf), I need to load 7 consecutive swfs in random order, (movie01.swf, movie02.swf, etc) from an array, into level 1. I need all seven to play without repeating, then repeat them in the same order in a loop.
But I ALSO need the user to be able to navigate through the swfs by using next or previous buttons (or by selecting individually 1-7, but that may be asking too much from my limited knowledge).Here is the code I'm using to generate a random ordered array:
for some reason escapes me: using AS3 how can a swf load another swf to replace itself in the same loader on the stage, while simultaneously calling a randomizing function in the first frame of the main timeline, to randomize the next swf?At the end of each swf (called "koan_#.swf") there is the following old AS2 code...it was used to randomly select and then play a swf from koan array:
I'd like to make a "main" flash movie to load external .swfs. It's not a problem to make it load a random external .swf but how could I make the loaded .swfs randomly load another .swf on the root at the end of its timeline?
I've got a small issue with attachMovie. I've got an array with references to movie clips which I want to place at random locations on the scene. Here is my function:
[Code].....
The thing here is that the trace of "mc" in the beginning returns the correct movie clip reference, but "mc_clothes_holder.mc" after the attachMovie returns "undefined".
supposing there is a movieclip in stage.. let's say its a circle with an instance name of "theCircle"..
the circle has to move / go to / animate to a random location on stage every 5 seconds... basically, the circle should move to the random location, stop and wait for 5 seconds, then move again to another random location.. again and again...
the code below is untested and incomplete.. but it is what i am trying to do.
Code: var randomXPosition:int; var randomYPosition:int; var positionTimer:Timer;
[Code]....
on the moveCircle function, i can simply set the X and Y of the circle equal to randomXPosition and randomYPosition... but that would just change the location of the circle, not move it.. i am trying to make the circle animate towards that location at a constant speed..
The basic area: add 5 circles on random locations on stage... and animate them to random locations on stage without touching each other...
The problem:: The code below works perfectly (up to a certain point). It succeeds in making the circles animate to random points on stage. It also succeeds in detecting if once circle comes to close proximity with another circle... Code on main timeline:
Code: var enemyArray:Array = new Array(); var timeToCreateEnemy:Timer; // set up timer that will fire every 2 seconds, 5 times timeToCreateEnemy = new Timer(2000, 5) timeToCreateEnemy.addEventListener(TimerEvent.TIMER, createEnemy); timeToCreateEnemy.start(); [Code] ......
add 5 circles on random locations on stage... and animate them to random locations on stage without touching each other... THE PROBLEM: the code below works perfectly (up to a certain point)... it succeeds in making the circles animate to random points on stage... it also succeeds in detecting if once circle comes to close proximity with another circle... only problem is, i dont know what i should do next...
I typed out a function in an attempt to make two MovieClips appear on the stage in random locations onClick but I think I either forgot to add something or forgot to take something out.
I am loading eight external swfs by way of eight buttons with actionscript to remove the swfs and sound after a new button is clicked. This works fine except that as soon as you get to the frame where the actionscript is all the swfs load at one time on top of each other. I don't want any to load until the button is clicked for the right one. MouseEvent listener works but only after all the swfs have loaded. How do I get the swfs to load only when the buttons are clicked. I can't figure out what I am doing wrong.
I want a movieclip consisting of a dynamic text box that, from the time it's loaded onto the stage, loads a randomly selected text string from an array, and continues to loop until the clip is removed from the stage. I also want the text strings to appear in the text box for random intervals between 500 and 3000 milliseconds.
While I've found tutorials here and elsewhere on loading one element from an array, usually triggered by a button, I don't know how to combine/alter it with the other elements.So I want this movieclip on the stage randomly flashing phrases from an array, some for a barely perceptible time, and others for a readable time.
I've been putting data into an array via XML, and then selecting at random an image string to load in a pic at random. But whilst doing this, I wanted to remove the String from the Array that I have just used, so I don't get repetition of the same image in the output. I initially thought that pop would remove the string I had just used - But of course it Removes the last value in the Array instead, which doesn't really help.
Ok - so how about randomizing the data once inside the Array, after it has been pulled in from XML!? That way I can load in the 'last' image, and then pop it out! Keeping a randomized selection of images each time 'it' is loaded
I have a Master SWF file that needs to load one of five different content SWFs on a random basis. In other words, I would like the visitor to see a different one of five content animations each time he/she visits the page. Is there a way to just call one of five different URLs on a random basis? Here's my code so far:
var swfLoader:Loader = new Loader(); swfLoader.x = 12; var swfURL:String = "b2bAnim1.swf"
[code]...
I would like to randomly differ the URL variable (swfURL) to select one of the following five URLs:
im playing with the load random movie (but loading a random xml file instead) based on the wonderful tutorial from front page and was wondering whether anyone can show me the work around/upgrade to AS2 for this bit of script since im publishing to Flash 8 /AS2 and it doesnt work:
I have this code that I am using to randomly load in external swfs. It seems to be working but, as I know very little about coding I just wanted to ask the experts and see if its ok? or should be done differently. I added the preloader code from watching the tutorials but not sure if its even in the right place?
I have a page that loads loads of swfs*. I'm loading in them all at the same time, Sequentially which is slowing down the intro animation. Is there a way to load swfs sequentially? Or if not load them on a timer (half a sec would do the trick I think)
*there lots of different dynamically generated Flex graphs so it's not possible to have them all in one.
randomly start an ordered list of SWF's.I have my main SWF calling up external SWF's. I have 2 groups of external SWF's From my main SWF Actionscript, I want to randomly play one SWF in Group A and continue cycling through Group A (in order) until it is finished.Then I want to randomly play one SWF from Group B and continue cycling through that list (in order) until the list is cycled through. Then repeat group A (random start, but staying in order), etc.
My current ActionScript works for Group A to randomly select and play in order, I need it to stop after it gets to the random starting point (so it doesn't repeat) and start up Group B (which isn't in there yet)
ActionScript Code: var logos:Array = new Array(); logos[0] = "logo1.swf";
[code]...
I need it to completely play through the Group A list before it goes onto Group B
I've got a Flash file that displays a series of .swfs one after the other and I'm trying to figure out how to encorporate a preloader into this script that takes into account the fact that I'm randomly selecting which of those .swfs to display first.
Here's what the attached script does so far:
1. Call external XML file and put .swf path names into an array.
2. Randomly select one of those .swfs to display first.
3. Once that .swf movie has played through (each one is about 6 seconds long) --OR-- if the "next" button is clicked, load the next .swf file.
4. When we've reached the last .swf file in the list, start back at the beginning of the list.
I have looked at a BUNCH of preloader scripts but just haven't grasped actionscript enough to know how to encorporate them into my file.
I'm loading (and unloading) external swfs into a holder in my main document. However, they seem to load perfectly the first time, but after that, they load at a different x and y. I've seen this happen before in someone else's file, but I'm not sure what the solution is.
Okay so I am trying to load external swfs which load videos dynamically.
I can load the swfs into the parent fla fine (if I remove all the code and just place a circle or something on the stage of the swf), and the swfs are also loading their respective videos correctly. But when I try to load the external swfs, if they contain any casting related code in them, I'm getting an error
[AS]TypeError: Error #1009: Cannot access a property or method of a null object reference. at swf1_fla::MainTimeline/frame1()[/AS]
Is there some specific method to casting within external swfs?
My code for loading the videos is this:
[AS]var vc:NetConnection = new NetConnection(); vc.connect(null); var vs:NetStream = new NetStream(vc);
I think what I am looking for is a random action script. I want to make a swf (mainmovie.swf) that would call up random swfs. What would be ideal is that every time the person goes to the site a different file is called up out of the files I created. So what I have done is put my (mainmovie.swf) into a folder with all of the other swf files I want to be random. It does not need to load to any specific level or anything it could even just replace the original move (mainmovie.swf) what ever is the easiest.
I'm having a problem with embedding a Flash movie that loads an array of SWFs- specifically, ones that exist in the same movie as the .fla loader file. When I move the external SWFs and .swf load_movie file into a separate directory from the HTML file, they do not load properly. I get just a white window. [URL]. When I keep the SWF movie clips and load_movie.swf in the same (root) folder as the .html file, then everything loads properly, though. But this would extremely clutter up my directory!
The code is as follows: MovieClip on Stage onClipEvent(data){ //test to make sure it's completely loaded, when swf's load this way onData is called with each 'chunk' of data if(bytesLoaded()==bytesTotal()){ this.onEnterFrame=function(){ if(_currentframe==_totalframes){ _root.loadNextMovie() [Code] .....
I 'm not sure if there is a way in loadMovie to specify another folder, or the best way to solve this problem. I'm relatively new to Actionscript.
detailed as possible. Took basic Flash classes, but no AS other than searching online, taking a couple Kirupa tutorials, so it's all greek tho recognizably so. I have 10 individual "scenes" currently in one swf file, but would love to break these apart individually, and load each into a "container" swf with a "random" code (so each visit to my site starts differently) which I've located and tested with Kirupa's super "Loading random movies" tutorial. Question is: currently I have active buttons in each scene which advance playhead to the next scene. How can I code these to load another swf into the main "container" file and kill/replace the current swf?
Another tutorial "Transitions between external swfs" suggests "if your buttons are not located on the main timeline, you will have to change the path to the container movieclip" - but doesn't show exactly how to do this, and I have to say I can't figure the "path" out! Another issue I foresee is that I'll need the script to automatically pull in the next swf file when the current one finishes, if the visitor doesn't click the button first... Haven't been able to find this with a few hours searching, though some threads come close.
I have 20 external .swfs im trying to load into 20 blank movieclips . i am trying to load them randomly into each blanck movieclip without the external .swf's duplicating.
so far I have this code
[Code].....
Im trying to load all the movieclips with all the external .swfs without any of the .swf's repeating.
I have a website im working on and I have it load multiple swfs etc. But although the site will load in the beginning it takes time to load each swf. Although I grasp the logic behind that is there a way to make them just all load at once? Like an AS code to include in a preloader of sorts?