ActionScript 2.0 :: Loading Random Images Into Array On Homepage - Clock Stops

Nov 18, 2006

I have 2 different pieces of AS for my full flash homepage but i can't get them to work at the same time properly. This first piece is to load random images onto an array on my homepage.

Code:
var myImages = ["IMG_1318.jpg", "IMG_1316.jpg", "IMG_1317.jpg"];
var rand = random(myImages.length);
loadMovie(this.myImages[rand], container);
//trace("image loaded is "+this.myImages[rand]);
stop();

That part is currently working as intended. The problem is since the stop bit was added at the end my random image array works as intended but at the same time it also stops my clock. Here is the AS for my clock.

Code:
mytime = new Date();
s = mytime.getUTCSeconds();
m = mytime.getUTCMinutes();
h = mytime.getUTCHours();
[Code] .....

Is there something else simple I'm missing that will keep my clock working but not mess up my picture array?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Clock - The Digital Clock Works Fine, But The Analog Clock Just Starts From A Random Time?

Apr 12, 2011

I have to make this analog clock for a university assignment and despite some really good efforts last night and tonight I just can't work out how to get it fully working. There is both a digital and analog clock; the digital clock works fine, but the analog clock just starts from a random time whenever I play the test movie. I am supposed to use the date object, not the timer object. And I am also supposed to add a sound every minute - I have added the sound to the minutes layer and selected but I don't know where to go from there. I seem to be able to find lots of example code for the timer object but not the date.

this.addEventListener("enterFrame",clockHandler); false, 0, true;
function clockHandler(e:Event)
{[code].....

View 3 Replies

ActionScript 2.0 :: Loading Random Images In An Array?

Aug 30, 2007

I am developing an advertising site and the site has three seperate flash areas. on the top of the page i have created a movie clip and successfully managed to get the images to load randomly. GReat...Here is my dillema in the other three areas that consist of seperate movie clips i want to load images that have been numbered sequentially like p1.jpg etc... what i want to do is to have the images load randomly, and be positioned in the movie clip where i want them to appear dynamically... then if the user clicks onto the next set of images, i need to be able to tell whether one of the previous images has been displayed, if it has, not to show it again.

View 2 Replies

ActionScript 3.0 :: Loader+Math.random - RandomNumber Not Loading Random Images?

Feb 26, 2012

why is this code NOT loading a random image, despite tracing random number?
 
package {
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLRequest;
import flash.display.MovieClip;

[Code]...

View 3 Replies

Loop Fading Random Image On Homepage

Jan 19, 2010

The loops fades a random image, which works great the first time round, if I go to another page and then back the home page (which is where this code is on frame 1) the first image loads but the random image code does not continue. I think it has something to do with nextHolderBool.

var numbers:Array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
var numRemaining:Number;
var randomIndex:Number;
var currNumber:Number;
var nextHolderBool:Number = 1;
[Code] ......

View 7 Replies

ActionScript 2.0 :: Random Images In An Array?

Nov 19, 2009

I've been using the following script to randomly display options for a quiz similar to who wants to be a millionaire:

Code:
var answersArray:Array = new Array("Geography", "Maths", "English", "French");
var correctAnswer:String = answersArray[0];

[code].....

View 2 Replies

Professional :: Swap Images On Homepage With A Control?

Oct 15, 2010

I am looking to create an area on my homepage that swaps images every 5 seconds and also has a play/pause and next feature for the view to choose if they want to click through or pause on an image. I am looking to create swaping images just like the following link under 'Top Stories'I am using Flash CS4.

View 2 Replies

CS3 Loading Random Images Into Slideshow?

Jan 12, 2010

i am using a slideshow template that I purchased and I wanted to get the images to load randomly, I contacted the author but he wants me to pay him extra for this and I have no money left for this project.basically, I'm looking to add a line to this as2 file that would make the images load randomly without repeating and then start over when the cycle completes. I tried putting in an array but it caused all kinds of errors.

View 8 Replies

Tween Function - Loading Random Images

Nov 27, 2009

I have a .fla with 5 pics on my timeline and using tween function to roll them from bottom to top, what I need to get those images random from o folder or something.

pics= ["images/pic1.jpg",
"images/pic2.jpg",
"images/pic3.jpg",
"images/pic4.jpg", "images/pic5.jpg"];
[Code] .....

View 15 Replies

ActionScript 1/2 :: Loading Random Images From Dir On Server

Sep 18, 2011

I've recently inherited a project which needs to load random images from a dir on the server.
the previous developer has this code on every swf (there are over 40):

pic_arr = ["images/randoms/1", "images/randoms/2","images/randoms/3", "images/randoms/4", "images/randoms/5", .....
ranNum = Math.floor(Math.random()*pic_arr.length);
pic_hold.loadMovie(pic_arr[ranNum]+".jpg");
unloadMovieNum(1);

I need to update this as the number of random images is set to increase to about 1000 and I don't fancy hand coding the above to include "images/randoms/999" , "images/randoms/1000" !!! Where I can keep a single .as file on the server which handles this and then a line of code in each swf which imports it? The site is built in php with a Flash fornt end so easy to use php to count the contents of the "images/randoms" dir and pass that number as a flashVar.

View 1 Replies

ActionScript 2.0 :: Loading Random Images From A Folder

Feb 25, 2007

I have a little Flash header and each time it loads I want it to load one of six images randomly, onto the stage as a background... The images will be sitting in a folder in the same directory as the Flash file so they can easily be updated, anyone ever done this?

View 6 Replies

ActionScript 3.0 :: Random Images Loading On Refreshing Website

Jun 1, 2010

I'm trying to load random images every time the website is refreshed. I currently have some actionscript that makes my random image appear but it appears at the top left of the screen. and the movie continues to load the very first image in the layer. So I have 2 images loading and the random image is off center.

Here is the actionscirpt:
//imports
import caurina.transitions.Tweener;
//var
var _loader:Loader = new Loader;
var _pictureArray:Array = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg"];
[Code] .....
The foreground portrait is random and fades in but is in the wrong spot. All of my random images are centered in the layer. And the image in the background loads since it is the first image in the layer. but it shouldn't.

View 2 Replies

ActionScript 3.0 :: Loading Random Frame From An Array?

Apr 21, 2011

Alright. I have been over every inch of the web to find something that works, and nothing seems to. So let me see if I can't explain this as best I can.
 
I have a simple flash movie with six images in the timeline. One image shows up for a few seconds, then fades into another image. These images are NOT embedded in a movie clip, they are just in the main timeline.
 
The frames where these images start are at 2, 110, 220, 330, 440 and 550.
 
When someone first browses to the website, I want the movie to start at one of those frame numbers and then continue to loop through the rest. So if the movie randomly begins at 330, it will then proceed normally to 440, 550 and restart at 2 and continue.
 
Obviously the code will go into frame 1, but every code I try, the movie will always start at 2 when the person first goes to the site. If the person selects another link on the website, and then goes BACK to the homepage, THEN the movie will pick one of those numbers, but not on the first visit.
 
Any idea why this is happening? I can only think because the movie hasn't loaded every frame yet.

View 5 Replies

ActionScript 2.0 :: Array Loading Random MovieClips?

Jun 26, 2009

I have a main Movie and on certain frames I need to play a random MovieClip which contains a quiz/question...drag/drop...multiple choice..or whatever...so.I'm wondering out of the many ways my mind wants to do this...which would be the smartest.

1. Put all those MovieClips into a main Movie...and have the Array jumble up the frame number to jump to...when it's been used...take that frame number out of the pool...

2. Have just the Actionscript on that frame when you land on it in the Timeline...have the Array jumble up the external movies...and then pick one and load it on that frame...and then remove that choice out of the pool..

View 0 Replies

ActionScript 2.0 :: Loading Random Movie Clips From An Array?

May 2, 2011

My project has about 30 movie clips in the library. With an action that comes up every few seconds, I'd like to randomly load one of those 30 clips onto the stage and have it play until it's done.

BUT - once a movie clip is already out, I don't want it to reset or come out again. I'd like the next action to randomly call out one of the remaining 29 clips.

Once each movie clip is done, I need some action to make it go back to the "available" list so that it can be called out again.

I'm guessing that I need to use attachMovie to call out the movie clips, and an array (maybe two) to make sure that I only get one instance of each movie clip. But after lots of searching and various dead ends, I'm just not finding exactly what is needed.

View 2 Replies

ActionScript 2.0 :: Loading A Random Movie Clip From An Array?

Nov 6, 2007

How do I load a movie clip randomly from an array? Do I need to use a container movie clip to load them into? I've tried a few methods that work for external swf's - but I want to load movie clips that are already in my library.

View 1 Replies

ActionScript 2.0 :: Loading An Array Of Images?

Sep 14, 2006

Right now I am working on a game where I need to have 19 pieces revolving with 19 different MCs in them. The code I have can accommodate the movement and 19 pieces, but how to get 19 different ones in there - just one with 19 duplicates.

I thought if I addressed them in an array, I could tell my emptyMovieClip to load them into itself with individual MCs. I'm sure I'm on the right path, but it's not working yet.

My array:
anames = new Array (mcAnniePiece,
mcAlbertPiece,
mcAshleyPiece,

[Code].....

View 2 Replies

ActionScript 3.0 :: Loading Images From An Array?

Dec 17, 2009

I know there are tons of tutorials out there about loading images from an xml file and creating a slide show. I can plug and play with those pretty good. However I would prefer it if I could start writing code myself. I am starting basic and each day working on adding code to a project.

Here is a made up app. Basically I have created three loaders that add an image to each one which I put into an array, cause why not. I have two event listeners one for an on stage click to load an image, and one a timer to load an image. The next thing I would like to try and do is load one image for a period of time, then load another etc.

So would I need a loop that loops through the array somehow connected with a timer?

public class array extends Sprite
{
//Create Loaders
private var imageOne:Loader= new Loader;

[Code].....

View 1 Replies

ActionScript 2.0 :: How To Get Flash To Keep Loading Images In Array

Feb 26, 2009

So I've got an array of images,
Code:
pixArray = ["Images/Architecture/Hospitality/01.jpg", "Images/Architecture/Mixed/01.jpg", "Images/Architecture/Office/01.jpg", "Images/Architecture/Performing/01.jpg"];

It's part of a slideshow, loading one image, waiting 4 seconds, then it loads another, etc etc. The problem is, between each image, it has to load. I'm trying to find a way to get flash to keep loading all the images in the array until they're all loaded, something to the effect of: On the completion of the loading of the first image, start loading the second image in the array. On completion of loading that, load the third image, etc, until there are no more.

I already have a variable that tells it how many items there are as well:
Code:
var total:Number = 4;

View 3 Replies

ActionScript 3.0 :: Loading Images Into Array After URL Loaded

May 25, 2010

I am loading my images into an Array after my url is loaded
Code:
function urlLoaded(event:Event):void {
urlLoader.removeEventListener(Event.COMPLETE,urlLoaded);
xml=XML(event.target.data);
xmlList=xml.children();
[Code] ....

It is arrayThumb I am interested in, I wanted each each to be placed into a location within this Array. I then wanted to do
Code:
thumbArray[0].addEventListener(MouseEvent.CLICK, click_handler1);
function click_handler1(e:MouseEvent) {
trace("IMAGE CLICKED");
}

But when I try this, I get
TypeError: Error #1010: A term is undefined and has no properties.

View 2 Replies

ActionScript 1/2 :: Images Loading From An Xml - Randomize The Array?

Dec 11, 2009

I have a flash file that loads images from an xml file. Is there a way to make the images load randomly? I would like a different image to start every time it loads. here is where the xml is pulled in...

[Code]...

View 3 Replies

IDE :: Get Flash To Keep Loading All The Images In The Array Until They're All Loaded?

Feb 26, 2009

So I've got an array of images,

Code:
pixArray = ["Images/Architecture/Hospitality/01.jpg", "Images/Architecture/Mixed/01.jpg", "Images/Architecture/Office/01.jpg", "Images/Architecture/Performing/01.jpg"];

It's part of a slide show, loading one image, waiting 4 seconds, then it loads another, etc etc. The problem is, between each image, it has to load.I'm trying to find a way to get flash to keep loading all the images in the array until they're all loaded, something to the effect of:

on the completion of the loading of the first image, start loading the second image in the array. On completion of loading that, load the third image, etc, until there are no more. I already have a variable that tells it how many items there are as well:

Code:
var total:Number = 4;

View 1 Replies

ActionScript 2.0 :: Loading Images From Array Randomly?

Jan 18, 2010

I 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].....

View 6 Replies

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

Apr 2, 2011

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

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

[code].....

View 1 Replies

ActionScript 3.0 :: Passing String Of Images Into Array And Loading Into BMP

Jul 5, 2010

I am trying to pass a string of images into an array and then load each image dynamically into a seperate bmp. The code is as follows:

ActionScript Code:
package{
import flash.events.*;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
[Code] .....

View 4 Replies

ActionScript 2.0 :: Images - Dynamic Loading Into Array And Displaying

Apr 11, 2005

I'm trying to create something that will load a bunch of images into an array and then be displayed whenever needed via using the attachMovie() function.

Code:
for (var i=1; i<list.length; i++) { //list is an array full of urls to images
_root.createEmptyMovieClip("img"+i,i);
loadMovie(list[i], "_root.img"+i);
}

I dont think this is what I want because I don't actually want the images to appear right here (this is the loading part). What I want is each image to be in a separate symbol with a unique identifier so that I can create them dynamically during runtime.

View 1 Replies

ActionScript 2.0 :: Dynamic Slideshow - Loading Images Using XML Info From Array

May 25, 2009

I've constructed a dynamic slideshow using ActionScript 2.0 and PHP/MySQL. The reason for this, aside from update purposes, is that the slideshow will eventually display over 200 images. Thus, to save loading time and bandwidth, I decided to use PHP to pull ten images from an SQL database, formatting the output in XML. The slideshow itself works fine. Unfortunately, there are a couple of issues I need to address; my ActionScript is extremely rusty, so much of my work's patchy.

The code's displayed below:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("getData.php");
[Code] .....

The code in red is my main focus. It's the loop which loads all images as movie clips using the XML information from an array. The loop loads all of the images, making them transparent before the presentation begins. What I would like to do instead, to save loading time, is to load the next image while the current one is displaying. The function "moveSlide" controls the transition of the images, so I'd imaging it'd be best to plade it in there.

There's already an incremental variable being used, with _root.target_mc, for removing transparency from the current slide. The code in blue is also nagging me quite severely. I retrieve the next chain of slides by simply contacting the PHP script again. The only way I could think of doing that was to refresh the slideshow (this is done COMPLETELY in ActionScript, with nothing on the stage). Unfortunately, I could only work out how to reload the whole video.

View 1 Replies

ActionScript 3.0 :: Loading Multiple Images Using Array - Keyframes Sequence

Sep 8, 2011

I am using below code to load images from array, which works fine. My unsolved question how do I put all the images after it has been loaded to holderMc_animation (which in in root, with instance name holderMc_animation)...is sequence order?
image 1 goes to keframe1 of holderMc_animation
and image 2 to keyframe 2 of holderMc_animation and so on...

Actionscript Code: ......
Have uploaded FLA file

View 5 Replies

ActionScript 3.0 :: Loading External Assets - Screen Stops Until The Loading Is Finished?

Oct 11, 2009

I have a movieclip clip that plays when the movie starts, the movieclip is a visual assets that show's that the application is loading some information but it's not showing any loading progress, just playing while the assets are loaded.I created a for loop that will load the assets using a simple loader, and then when the object is loaded the application push the object to an array.Problem is that when the loading starts all the animation that i have on screen stops until the loading is finished.The whole point is that the animation will play while it's loading.

View 10 Replies

Flex :: Change The Loading Clock?

Jan 13, 2011

How can I replace the loading clock in Flex at the cursor to something like loading wheel in the middle of page instead of cursor

View 4 Replies







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