ActionScript 2.0 :: Loading A Swf One After Another Randomly?
Feb 14, 2006[URL] how I might go about loading the swfs randomly instead of 1. 2. 3. 4. etc. [URL]
View 1 Replies[URL] how I might go about loading the swfs randomly instead of 1. 2. 3. 4. etc. [URL]
View 1 RepliesURL...that has videos in the work section (click work, then the tv icon or the radio icon at the bottom of the page) that will randomly not load.THe weird thing is that the files have never moved, and yet, the same computer on the same ISP using the same browser that could view the videos 2 days prior, suddenly cannot.I'm also having an issue where the flash won't even load on startup randomly.This had happened one time in the past, and I took the page from a test area of the site and put it live, and it solved the problem. So my last ditch plan z is to make a mirror to link to in case the videos aren't loading for a user.
View 2 RepliesMy site loads a .swf into a blank movie clip when the site loads.target.loadMovie("coachGameDay.swf");
When a viewer loads the site again, I want a different .swf to load. Or if I hit the refresh button on the browser, I want different .swf to load. Giving it the appearance of .swfs loading randomly.
i can now load my movies randomly.however new problemo. they load half way down the page, so i only see the left corner edge. This seems like a registration problem?
View 2 RepliesI want to make a navigation bar that loads image buttons randomly. Ex: (you can see the non-random version at the bottom of the page onI have 5 slots. I want to randomly load an external swf into an empty button in each of the slots. I do not want the same button to load in more than one slot. I'm thinking I need to use arrays? (which I don't know too much about.) Can anyone point me to a useful tutorial?
View 1 RepliesI am trying, with this code, to first, shuffle the order of the images in the array so their loading sequence is never the same when the page is reloaded.Then, im trying to have the shuffled array open one at a time, image by image, at a set interval.
Code:
Array.prototype.shuffle = function() {
for (i=0; i<this.length; i++) {
[code].....
I am currently trying to load a movie clip in the main SWF. Got that done.Then call and replace the first movie clip with another, got that done too.This is for a menu i am making, I am not too great in action script. I am working in AS2.Problem is after I call the second external movie clip into the main SWF, it all stops working.Is there a way I set this up that no matter what it keeps loading and unloading the external movie clips? This is what I have so far.[code]This starts with the "king_menu.swf" already loaded, i have it unload it and load "dqueen_menu.swf" to the call point named "load_king".I am guessing I need to have a universal call point for all my external movies to load and work in a random chain.
View 10 RepliesI want to create an array of loaded xml for the following:
ActionScript Code:
var xmlQuestions:XML = new XML();
System.useCodepage = true;
[Code].....
What I want to achieve is so I can load 5 different xmls and place them into an array. All 5 random xmls will be placed in an array then I wish to trace them
I have a FLA site built in AS2 that once you get to the home page it plays one song and only one song. If I want to set up so that when the user clicks back to the home page from anywhere else in the site it plays a different random song (there are 8 total).
So in other words when you initially land on the home page it will play Song 1 every time. But when you click back to the home page from anywhere else on the site, it randomly plays the 1 of the 8.
I have it so that Song 1 plays every time initially but I don't know how to set it up in AS2 to have it randomly play songs when you click back to the home page from deeper in the site.
problem with loading images randomly and putting them in the right _x and _y coordinates.I have a swf file with in the first frame a button with this code :
on (release) {
filename = ["image-01.jpg", "image-02.jpg", "image-03.jpg"];
path = "images/";
[code].....
I am trying to create a movie clip that loops and on each loop it loads a random little .jpg banner from a directory. The banners are named 0.jpg, 1.jpg and so on, a script on the first frame of the loop saying
Code:
_root.randomnumber = random(_root.bannernumber);
_root.bannerloop.bannerholder.loadMovie("[URL]");
"Bannernumber" is a variable from an external text file specifying how many random numbers to cycle through (how many banners). This works just fine and loads up a new banner after each loop cycle. The problem lies in trying to make each banner go to its own url, I have another external text document with variables
"click0=url, click1=url etc"
Where I want the number in each variable to equal the random number variable in flash, then use an
on(release){getURL(urlvariable)}
Function to have it retrieve the url that is somehow in the url variable. Basically, how would I make the urlvariable be equal to the "click0" variable to get the url of the click0 variable into the getURL function? While having the number in the "click0" variable be equal to the random num variable? If I'm going about the random banner thing completely wrong.
I'm running through the tutorial on this photo gallery, but I would like to modify the code some. Instead of loading the first picture in the XML array, I'd like to have it randomly load one of the pictures. Below is the code that loads the first movie:
Code:
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0; picture.loadMovie(image[0], 1);}}
I don't know much, but I'm thinking there should be some variant of "math.random" around the
"loadMovie(image[0],1);"....
I have a list of countries that are in an xml document. I was wondering if here was a way to randomly load ten of these and place them on the stage in random places. I want to get the effect of this intro: [URL]. (not the one with the black background)
View 8 Replieshow to get movie clips to play randomly? Here's what I want to do:
I have four movie clips already created and I want to make it so that when someone visits the page and accesses it for the first time, one of the four is randomly selected and plays (I also want to be able to tell it what frame of the movie clip to go to)!
I need to make something that mimicks The Dancer over at[URL]I've created all the movie clips but I don't know where to start with the loading and unloading of the dancing bits The buttons at the bottom scroll through movie clips with different movement. So the "arms" button would load arms01, then when it's clicked again, it would load arms02, clicked again it would load arms03, and then repeat when it reached the end.
View 2 RepliesI have designed a homepage that has 4 boxes on the right hand side that are of different size. I would like to have a movie loader that loads .jpgs randomly from a specified folder into each box. At the same time I don't want any repeats in any of the 4 boxes. Also is it possible to resize the images according to the box size without having to resize them outside of flash? I can have all the images in the external folder the same size, but then if I can just shrink them with whichever image falls into the box the random script assigns.
View 2 RepliesI have a problem with loading images randomly and putting them in the right _x and _y coordinates. I have a swf file with in the first frame a button with this code :
on (release) {
filename = ["image-01.jpg", "image-02.jpg", "image-03.jpg"];
path = "images/";
i = filename.length;
[Code]....
the image gets loaded and placed correctly when played from the harddisk. the problem starts when i upload the swf to the internet, then the image won't be centered but the left upper point of the image is placed at x=640 and y=230
Basically, I have movie1, movie2, movie3, movie4 in the library, with linkages.
These are just 5 frame clips, with a single dummy_mc moving statically over the 4 frames.
I need these to be picked randomly and placed (each has its own set of co-ordinates where it should appear) on the stage at a random set interval (ie, every 2-3 seconds).
There are also 7 items (item1, item2, etc) in the library.
So once one of the 4 movies has been placed on the stage, I need one of these 7 items to randomly attach itself to the dummy_mc within that movie (and, I guess, generate instance names etc)
i can't seem to figure out this:
I have 3 coordinates on a stage.
Coordinate1 (x50;y50);
Coordinate2 (x150;y150);
Coordinate3 (x250;y250);
How to make a movieclip (or button) appear on one of theese coordinates randomly when loading flash?
Coordinates don't change but movieclip (or button) goes to one of theese positions upon flash movie starting.
Onmy stage I have a MC, and when I click it a random MC from the Library should appear and move around randomly.
I'm using this to make it move around randomly [URL]
how to make the random MCs appear from the library. And should I put the random moving script on each of my ten MC?
I have a movie clip divided into three scetions. The first section starts on frame 6, the next on frame 11 and the last on frame 16. Is there a way to get flash to choose randomly between only those frames (6,11,16)and not the frames in between(1-5,7-10,12-15)?
View 4 RepliesI'm trying to place my mc's at a different position each time the game starts but within a certain area. I've used random before...
random(300);
...but I want it to be randomly between the coords
_x 150 and 450
_y 250 and 350
I need to call external SWF's so they randomly appear within my main SWF. When one ends, the next will start and so on. I searched the forum and found a thread with the code below and have run in to an issue.
Each of the external clips is set up exactly the same... same length, same tweens, etc.
The code below is sitting the first frame, on the top layer within my main SWF:
randomClips = new Array ("Journey.swf", "Doobies.swf", "LedZep1.swf", "PinkFloyd1.swf", "Stones.swf");
function randomBackground() {
[Code].....
The main movie is one frame long and has three layers. The top layer has the Action Script (above), the bottom layer has my background image, and the middle layer holds the empty movie clip named mtClip
When loaded to the server, the movie plays and one of the external SWF's will load. When it ends, I need one of the other SWF's to load. What happens is that rather than randomly playing one of the other SWF's, it repeats the original external SWF. If I refresh the main SWF, it randomly selects one of the external SWF's and it will constantly repeat.
The external SWF's have no Action Script. I tried it with putting a Stop on the last frame, but that didn't help.
I've 3 movieclip on stage which is mc1,mc2,mc3at first they are alpha=0What I want is when i click on revealBtn, 1 of them will show up as alpha=1.But with my code below, sometimes I need to click about 5 times or more only can make all those mc show up.Is there any solution for what I wanted? I've try splice but it's still not working well.
var mcArray:Array = [mc1,mc2,mc3];
for (var j:int = 0; j < mcArray.length; j++)
{
[code].....
How can I mix an array randomly in as2? I have this code so far:
Code: Select allfunction startGame(){
for(i=1;i<=52;i++){
cards_array.push(i)
I gues you see this is for a card game (hearts).If I want to mix the cards I have to mix the array...
I want to have a few movie clips moving randomly over my flashsite. They will look bugs. And I want them to move in the direction the head is pointing.I have tried the random movement tutorial here on Kirupa but can't get the mc to rotate in the direction it's moving.
View 14 RepliesI have this function that moves the cursor automatically to random points. I want to know how I can make them move to 4 specific points (x,y coordinates) instead.
I am assuming I need to create an array of the of some sort with the x,y points and tween them but have no idea how to go about this.
Code:
function autoMoveObject() {
if (!mouseControl) {
var moveObjectX:Tween = new Tween(cursor, "_x", Regular.easeOut, cursor._x,
[Code]....
I have 4 buttons that I have made invisible. After a random time, one of 4 buttons should randomly become visible.That button then will lead to another frame.How do I enable one of them randomly (and make it visible at the same time)?
View 1 RepliesI have the following XML
Code:
<countries>
<country>
<name>foo</name>
[Code]....
am trying to make a mp3 player by using actionscript3.In this , am trying a upload a mp3 file and play that particular file. Am also using the computespectrum() to display the graphics.Now the problem am facing is with the computespectrum . Randomly , the computespectrum is failing for the same file and is throwing error.The error is as follows [code]Am actually uploading the file into a folder named "mp3files". The "mp3files" folder and the swf are lying in the same domain.
View 1 Replies