Random Picture Loader
Hello,
I'd like to have flash randomly load pictures from a folder into a window on my website. I've sized all the pictures to the correct dimension. All I need to know is how to tell flash to randomly load and unload movies from an empty movieclip. This would have to be on a time based interval such as 30 seconds - the user would have nothing to do with it (i hope)
Any help is greatly appreciated.
Thanks.
FlashKit > Flash Help > Flash MX
Posted on: 01-20-2004, 02:26 AM
View Complete Forum Thread with Replies
Sponsored Links:
Random Picture Loader
Hello,
I'd like to have flash randomly load pictures from a folder into a window on my website. I've sized all the pictures to the correct dimension. All I need to know is how to tell flash to randomly load and unload movies from an empty movieclip. This would have to be on a time based interval such as 30 seconds - the user would have nothing to do with it (i hope)
Any help is greatly appreciated.
Thanks.
View Replies !
View Related
Random Picture Loader
Hello,
I'd like to have flash randomly load pictures from a folder into a window on my website. I've sized all the pictures to the correct dimension. All I need to know is how to tell flash to randomly load and unload movies from an empty movieclip. This would have to be on a time based interval such as 30 seconds - the user would have nothing to do with it (i hope)
Any help is greatly appreciated.
Thanks.
View Replies !
View Related
Picture Loader
I am using a image loader from macromedia and i cant get it to work now that i have put it into 2 sublevels from the root. It loads the first image but wont scroll through the rest of them i am attatching an image of my flash and also putting the actionscript in here if anyone can help. Thanks. You can check www.freshpixels.net and go to the portfolio to see how it is not working. thx.
//initialize variables and properties
square._alpha = 0;
whichPic = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
if (whichPic<6 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic;
}
};
_level0.portfolio.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("3DDESIGN/image"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>6) {
input = 6;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
View Replies !
View Related
Picture Loader
hi,
I have an .swf that loads external .jpg files that works when i use it in an swf player, but when I put it on an HTML page it won't work. Can someone take a look at my files and possibly tell me why?
You can see how it doesn't work here.
The files I used are also zipped with this message.
Thanks,
pjustice
View Replies !
View Related
Outside Picture Loader
I finished a website some time ago and now they want to be able to add pictures at their leisure. This of course is a problem since they cannot use flash, so heres my idea in which I need help making.
I'm thinking of some script that would look for pictures numbers 1-90 that are in the same folder. It would then take those and display them in order with fade ins and outs.
I'm script illiterate to that which I don't know, so I would be very grateful to anyone that could help me out. Thanks
View Replies !
View Related
Picture Loader Component
Hiya
I want to be able to load an image into the picture loader component from file, at the moment it is hard coded, but I want the program to pick up the path from wherever the user has installed the files (if that makes sense!)
This is the code I have at the moment:
picLoader.contentPath = path + "Images\Square\square2.swf";
picLoader.load();
path is set to:
_global.path = "C:\Program Files\MathsWorld\";
earlier in the timeline.
how can I replace the path with the file path that the user has installed the files to??
thanks
nottsShark
View Replies !
View Related
Pre-loader Which Uncovers Picture
hi,
I am wondering how difficult it would be to make a pre-loader which uncovers a picture.. so for example i have a background picture, being a landscape scene- and the pre-loader would be a white page which as it loads reveals the landscape picture in a radial fashion, so from the center it uncovers the picture- a dot growing into a circle--
i dont know if that explanation is good enough?
basically the picture which is uncovered, or loaded would then be set as the backgroudn picture of the main movie..
another way...
of doing it would be to cut the picture into rings, save those sepperatly as a gif and then load one at a time, from the smallest in the middle till the biggest & last..
View Replies !
View Related
Xml Picture Loader Error
Hello. Here I have a code. But it seems not to work. I have a MC called an instanced as image on the first layer.
Code:
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = function (loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = []; //piltide array
total= xmlNode.childNodes.length;
for (i=0; i<otal; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
loadimage();
} else {
content = "no file";
}
}
xmlData.load("images.xml");
function loadimage() {
image.loadMovie(image[0], 1);
}
this is my xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>1.jpg</image>
</pic>
<pic>
<image>2.jpg</image>
</pic>
<pic>
<image>3.jpg</image>
</pic>
</images>
what is teh problem?
View Replies !
View Related
Picture That Is Not Display In The Loader
I have a problem, i have used the loader, to display a picture, in the swf the picture is displaied but when i load de html page the picture dosen't appear and i don't know why...can anybody help me?
See http://www.romanoexim.ro/v2/site.html the second buton in the right, the one with the G. Please help me i have the dead line next week.
View Replies !
View Related
HELP Picture Loader Problems
hey everyone,
i really like really need one of urs help on this subject.
i have created a picture gallery for my flash document.
but for some reason my loader isn't working.
i am going to be attaching the FLA file so you can take a quick look at it an see perhaps where i am err'ng
i have 2 components
ones the LOADER and the other is ScrollPane
i made a separate Movie Clip called
picture_mc
which i gave an instance name of
picture_mc
inside the movie clip picture_mc
i have the 2 components
the loader to display the photos and the scrollPane to hold the horizontal thumbnails.
the loader actionscript i used
//
extLoader_mc._visible = false;
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);
myListener.onLoadProgress = function(target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
if (bytesLoaded >= bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("pics/tile6.jpg",picLoader);
\
this loads the starting picture perfectly as you will see when u test the FLA
and the thumbnail slide seem to work perfectly as well even accepts the code for the rollOver tag when u rollover the thumbnails.
but for some reason the onRelease isn't working
its not loading the pictures from my folder "pics/tile1.jpg"
here is the code i used in the thumbnail movie clip
tile_th_mc
-----------------------------
//
tile1.onRollOver = function () {
tile1.gotoAndPlay ("over");
}
tile2.onRollOver = function () {
tile2.gotoAndPlay ("over");
}
tile3.onRollOver = function () {
tile3.gotoAndPlay ("over");
}
tile4.onRollOver = function () {
tile4.gotoAndPlay ("over");
}
tile5.onRollOver = function () {
tile5.gotoAndPlay ("over");
}
tile6.onRollOver = function () {
tile6.gotoAndPlay ("over");
}
tile1.onRelease = function () {
mcLoader.loadClip("pics/tile1.jpg",picLoader);
}
tile2.onRelease = function () {
mcLoader.loadClip("pics/tile2.jpg",picLoader);
}
tile3.onRelease = function () {
mcLoader.loadClip("pics/tile3.jpg",picLoader);
}
tile4.onRelease = function () {
mcLoader.loadClip("pics/tile4.jpg",picture_mc.picLoader);
}
tile5.onRelease = function () {
mcLoader.loadClip("pics/tile5.jpg",picture_mc.picLoader);
}
tile6.onRelease = function () {
mcLoader.loadClip("pics/tile6.jpg",picture_mc.picLoader);
}
\
--------------------------------------------
the rollOver works great its only the onRelease's that not working.
i put picture_mc.picLoader because my picLoader is within my picture_mc file.
not sure if was suppose to do that or not i was going of a video tutorial i was watching and thats how he explained it.
well anyway there it is in all its glory.
again i am attaching the FLA file so you can take better look at it.
i need to get this working cause its my first flash website i am doing for a good friend of mine, an want to make a good impression ya know?
but this is the only thing that is holding me back the rest of the site is 90% finish with some minor things to straighten out.
but if all goes well with this one,
he said he would put out the word for me for future jobs.
so again i beg of someone
please take a look at the FLA i am attaching
for i so very much am in need of figuring this out i been wracking my brains for past 2 weeks on my own an come as far as i able to at moment.
again thanks
Roger
you can access the file at this link
http://rojere.com/flash/picture_mc.fla
when u click on it.. you'll get screen where its all unreadable
dats ok just go to browser an go to FILE and SAVE PAGE AS
dont save the page as a "TXT" file but drop down to show ALL FILES and then click on the save button.
-----------------------------------------------------
PS as you will notice in the
actionscript
tile_th_mc - movie clip
that on the onRelease codes
i have completed an not complete codes
with
picLoader by iteself and with
picture_mc.picLoader
i wanted to test these 2 codes to see if one or the other worked but neither of them work
so thus is my dilemma
View Replies !
View Related
Loading Into Picture Loader Component
Hiya
I want to be able to load an image into the picture loader component from file, at the moment it is hard coded, but I want the program to pick up the path from wherever the user has installed the files (if that makes sense!)
This is the code I have at the moment:
picLoader.contentPath = path + "Images\Square\square2.swf";
picLoader.load();
path is set to:
_global.path = "C:\Program Files\MathsWorld\";
earlier in the timeline.
how can I replace the path with the file path that the user has installed the files to??
thanks
nottsShark
View Replies !
View Related
Problem With Multipage Picture Loader
Hey. I am having trouble with this photo gallery I am putting together. There are 4 pics on each page except the last, and a total of 14 pictures. The last page has 2 pictures.
Everything works and loads fine for the 1st 4 pictures in the loader which are on the 1st page. The problem comes in when I move to any of the other 3 pages. All of the sudden, the script that I wrote for the 1st 4 pics to show up in the loader is no longer working for the other pics. And to add insult to injury when I navigate back to the first page of pictures, all of the sudden those don't work either. I know there is a problem with how I am arranging my actionscript, but for the life of me, I can't put it together.
The file is 900K, so I can't post it on here, but the link to it is
http://www.spgproductions.net/gallerystash.fla
I know the larger picture files that go in the loader aren't there, but I thought you could just tell by looking at my code what I am doing wrong.
I know this seems like a real pain but I would really appreciate the help.
View Replies !
View Related
Random Flv Loader + Radom Swf Loader
so i am making a flv player with an flv ad at the beginning, the main flv in the middle, and a swf ad at the end. the issue i have is that the flv ad at the beginning has to be randomly selected from a short list of flv ads in a network folder and the swf ad at the end is a click-able flash animation that has to correspond with the flv ad at the beginning.
so for example:
i have a video flv and swf ad pair for a window company, a restaurant, and a shoe store. when someone loads the video player, the shoe store flv ad is randomly loaded, the main video plays, and at the end, the click-able swf shoe store ad loads.
does that make sense?
THANKS!
View Replies !
View Related
Picture Loader Auto-scale Problem
I am having some difficulty with the mx.controls.Loader component and it's auto-scale parameter.
I have a swf that loads a picture that was just uploaded on the previous page. I use FlashVars to pass the location and filename to the mx.controls.Loader. The loader is set to auto-scale content.
This works perfectly 99% of the time but I have run into a problem when trying to upload and preview a picture from a slower DSL connection. It is not scaling the picture at all so I can see is the corner of this image.
Here are two pictures for an idea what I'm talking about...
How it should be:
How it is with slow connection:
Any ideas on what could be causing this? Or how to fix it?
Thanks
View Replies !
View Related
Random Picture
hi,
does anyone know how to randomly pickup external picture and display in flash. dono whther can b done not?
kirupa,
the scrolling window can it be autorun.
and lastly how to add a script so that we can control a mc timeframe i mean how long it will run?
a l i adon
View Replies !
View Related
Random Picture
hi,
does anyone know how to randomly pickup external picture and display in flash. dono whther can b done not?
kirupa,
the scrolling window can it be autorun.
and lastly how to add a script so that we can control a mc timeframe i mean how long it will run?
a l i adon
View Replies !
View Related
Random Picture Function? (mx)
using: Flash MX
I am new here, just have a question about a random picture function i'm trying to get my flash banner working for my website.
here is my testing page:
http://www.shoutoutdesigns.com/new/test.html
as you can see, it is a bit messed up! ...I cannot figure out the actionScript for a random picture...see, how there are a few pictures flashing at the moment? ...I generally want ONE picture show up at a time. (not really a rotating thing)
currently, i have a mask layer..under it, is the movie clip where those pictures are. I tried putting this:
------------------------------------------------------------
//invoke the functionl pick a random number between 1-10
var destinationFrame = myRandom(1,10);
// now, send the playhead to that frame and stop!
gotoAndStop(destinationFrame);
------------------------------------------------------------
in the 1st frame of the movie clip (where the pictures are located) ..but it doesn't work...
so bascially, when someone comes onto my webpage, i want 1 of the 10 pictures come up, so if they were to refresh the page, it different picture would show up --does that make sense?? maybe i'm just going overboard with this?!
I hope someone can help me!
thanks for reading y'all.
the confused
View Replies !
View Related
Random Picture Selection
Hello everyone..
Does anyone know how to do random picture selection on a flash page so that each time it loads it selects one from certain amount on web page?
thanks in advance for your help.
peace
View Replies !
View Related
Random Picture Load
ok
http://www.focusworld.net/medeaentertainment
this is the site
the pictures on the left are what we are focusing on today! what i am wanting to do is have a flash movie read from a given directory of images and have it basically load them and display them as if they are being thrown down on a table
can someone please help me?! or point me in the right direction?
View Replies !
View Related
Random Picture/text Without PHP
I was trying to do a banner with a random picture in the background, then a random quote or text in the foreground. My purpose in this is to have a picture with a different quote a good majority of the time. I've seen posts about doing it over PHP, but i'm trying to avoid that. I've figure out a way to do it but i have to specify how many pictures and quotes.
example
choice = Math.round(Math.random()*6);
switch (choice) {
case 1 :
location2.loadMovie("pic01.jpg");
break;
case 2 :
location2.loadMovie("pic02.jpg");
break;
case 3 :
location2.loadMovie("pic03.jpg");
break;
case 4 :
location2.loadMovie("pic04.jpg");
break;
case 5 :
location2.loadMovie("pic05.jpg");
break;
case 6 :
location2.loadMovie("pic06.jpg");
break;
}
Only problem i see with this is, if someone wants to add a picture later on, they have to edit the FLA.
Is there a way that someone later on, without the FLA file, can edit a text file or such and have more pictures rotated into the mix?
as in a bin that randomly calls pictures, no matter how many pictures are in it?
Also concerning the quotes. I want the same thing, but for the quotes to be called from a text file randomly. So again, someone can edit a text file, put new quotes in there, and it will be randomly called.
My apologies for the long post. Any help would be greatly appreciated. Thanks.
View Replies !
View Related
[F8] Random Picture On Homescreen
Hello,
I need some help on trying to make a random picture appear on my homepage.
Well not that random, ideally i would like to choose around 5-10 pictures and each time someone comes to my web page, or goes back to the homepage from with in my site, one of the images i chose will randomly be chosen. I've looked around on some other sites to get some help, but couldn't figure it out.
I am no flash genius, but sort of understand it.
Essentially like this http://www.neverbeat.com/flash/
But on this site, http://www.jeffhenrikson.com/new_index.html
on the first page that pops up
View Replies !
View Related
Loading A Random Picture
im trying to have random picture come up but this isnt working
PHP Code:
onClipEvent(load){
_level0.randomtexture = random (6)+1;
}
onClipEvent(enterFrame){
if(_level0.randomtexture = 1){
this._parent.siab3.texture.gotoAndStop(1);
this._parent.siab3.s.randomtexture.gotoAndStop(1);
this._parent.siab3.o.randomtexture.gotoAndStop(1);
this._parent.siab3.u.randomtexture.gotoAndStop(1);
this._parent.siab3.p.randomtexture.gotoAndStop(1);
}
if(_level0.randomtexture = 2){
this._parent.siab3.texture.gotoAndStop(2);
this._parent.siab3.s.randomtexture.gotoAndStop(2);
this._parent.siab3.o.randomtexture.gotoAndStop(2);
this._parent.siab3.u.randomtexture.gotoAndStop(2);
this._parent.siab3.p.randomtexture.gotoAndStop(2);
}
if(_level0.randomtexture = 3){
this._parent.siab3.texture.gotoAndStop(3);
this._parent.siab3.s.randomtexture.gotoAndStop(3);
this._parent.siab3.o.randomtexture.gotoAndStop(3);
this._parent.siab3.u.randomtexture.gotoAndStop(3);
this._parent.siab3.p.randomtexture.gotoAndStop(3);
}
if(_level0.randomtexture = 4){
this._parent.siab3.texture.gotoAndStop(4);
this._parent.siab3.s.randomtexture.gotoAndStop(4);
this._parent.siab3.o.randomtexture.gotoAndStop(4);
this._parent.siab3.u.randomtexture.gotoAndStop(4);
this._parent.siab3.p.randomtexture.gotoAndStop(4);
}
if(_level0.randomtexture = 5){
this._parent.siab3.texture.gotoAndStop(5);
this._parent.siab3.s.randomtexture.gotoAndStop(5);
this._parent.siab3.o.randomtexture.gotoAndStop(5);
this._parent.siab3.u.randomtexture.gotoAndStop(5);
this._parent.siab3.p.randomtexture.gotoAndStop(5);
}
if(_level0.randomtexture = 6){
this._parent.siab3.texture.gotoAndStop(6);
this._parent.siab3.s.randomtexture.gotoAndStop(6);
this._parent.siab3.o.randomtexture.gotoAndStop(6);
this._parent.siab3.u.randomtexture.gotoAndStop(6);
this._parent.siab3.p.randomtexture.gotoAndStop(6);
}
if(_level0.randomtexture = 7){
this._parent.siab3.texture.gotoAndStop(7);
this._parent.siab3.s.randomtexture.gotoAndStop(7);
this._parent.siab3.o.randomtexture.gotoAndStop(7);
this._parent.siab3.u.randomtexture.gotoAndStop(7);
this._parent.siab3.p.randomtexture.gotoAndStop(7);
}
}
thanks
View Replies !
View Related
Random Homepage Picture
When I load my website I would like a new image to pop up everytime... Randomly. I have 4 pictures that I would like to randomly appear only once everytime the site is loaded. I don't want them to switch while the site is being viewed, I just want the user to see a different picture everytime they view my site... Randomly.
Can anyone help me out on this?
View Replies !
View Related
Random Picture Loading
Hi All,
Got a slight problem and I'm pulling my hair out....
I have a page that shows 2 random pictures pulled from a image directory that has 5 images.
I got the random bit from somewhere but can't get the pictures to load simultaneously. Can someone tell me where I'm going wrong?
Code:
pictures_array = [1, 2, 3, 4, 5];
Array.prototype.pickRandomValues = function(n) {
var selected = [];
for (var i = 0; i<n; ++i) {
var r = Math.floor(Math.random()*this.length);
selected.push(this[r]);
this.splice(r, 1);
}
return selected;
};
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc");
loadMovie("img/"+pictures_array.pickRandomValues(1)+".jpg", "container_mc copy");
View Replies !
View Related
Loading Random Picture
I have a swf file that i want'it to load diffrent pictures on page refresh, a random picture. How is this possibble, i'm kinda new in actionScript and i will realy apreciate if you could help me a bit!
View Replies !
View Related
Loading Random Picture (swf)...
I found the script which will load a random picture on each refresh of the page:
_________________________________________
filename = ["a.swf", "b.swf", "c.swf"];
path = "http://areaofpictures/images/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], bgTarget);
_________________________________________
OK, this is good if I just have 1 picture to show on a page, but does anyone know how to modify this code to switch the image swf every 30 seconds without the need of a refresh?
View Replies !
View Related
Random Picture Gallery - Need You
Hello,
I need help for this script. I would like to create a random picture slideshow.
It work fine but now i need to create a preloading before the next image.
Here is the code, some one can tell me how to make this preloader ?
Thankyou very much!!
-----------------------------------------
iimport mx.transitions.Tween;
import mx.transitions.easing.*;
//create an array for all externally loaded images
var images:String = "001.jpg 002.jpg 003.jpg 004.jpg";
var imagesArray:Array = new Array();
imagesArray = this.images.split(" ");
//choose a random image from that array
randomImage = Math.floor(Math.random() * imagesArray.length);
image_value = imagesArray[randomImage];
//create an empty movieclip where to load the images
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
container._x = 0;
container._y = 0;
//load the first image
container.loadMovie("images/"+image_value);
var imageFadeIn:Tween = new Tween(container, "_alpha", Regular.easeOut, 0, 100, 1, true);
//a function to load the randomly selected image to a container movieclip and creating the fade ins and outs
function loadRandomImages() {
randomImage = Math.floor(Math.random()*imagesArray.length);
image_value = "images/"+imagesArray[randomImage];
var imageFadeOut:Tween = new Tween(container, "_alpha", Regular.easeOut, 100, 100, 1, true);
imageFadeOut.onMotionFinished = function() {
container.loadMovie(image_value);
var imageFadeIn:Tween = new Tween(container, "_alpha", Regular.easeOut, 0, 100, 2, true);
};
}
//use setInterval to call the function every five seconds
my_interval = setInterval(loadRandomImages, 5000);
View Replies !
View Related
Loading Random Picture
I have a swf file that i want'it to load diffrent pictures on page refresh, a random picture. How is this possibble, i'm kinda new in actionScript and i will realy apreciate if you could help me a bit!
View Replies !
View Related
Random Flicker Picture
hello everyone
i'm trying to make a website that loads a random flickr picture slideshow from a tag that i spacify into a holder movie clip. so i can applay transions in the slideshow.
can someone please help me
thanks great forum
View Replies !
View Related
Php And Random Picture Loading
Hey I've been looking for ages for a good tutorial or expliantion of how to load random images into flash
I know I could name them image0.jpg, image1.jpg etc and hard code in the total number of pictures, but then you would have to hard code in the titles of each of the images in flash.
What i want to do is have all the images in one directory, have the php file read the directory, find all the image files in that directory and add them to an array that can then be used in flash to choose the picture and load it (i can do this easily).
Because I am new to php i cant work it out, but i am pretty sure it is possible. Can anyone Help?
View Replies !
View Related
Random Picture Flash
Hi,
I want to display a random picture at the start up of my page. It is just one picture each time as the background, and I have about 10 different pictures, so when you go to the page, it could be a different picture each time.
Is this possible? How?
View Replies !
View Related
:URGENT: Random Picture Generator
I creaed a random picture generator with a tutorial from kirupa.com
(http://www.kirupa.com/developer/mx/l...background.htm)
Now I created that same movie exactly the way he said. But something is going wrong.
I use Dreamweaver, and I have a few flash files on my index.htm. In dreamweaver, when I click the "play" and "stop" buttons in dreamweaver's properties inspector, the movie works great. But when I F12 it, or publish to web, all I get is a blank screen.
The only things I did different than the tutorial is I changed the pictures used, and I changed the movie size to fit my pictures/open box in dreamweaver.
http://www.onlymansei.com/test
http://www.onlymansei.com/test/image...swf/random.swf
You can go to the first one (www.onlymansei.com/test) and see the open box on the bottom right corner. That is where that flash movie should be going.
Now you can go to that open white space, and check, a flash movie is playing, but nothing is going on.
Thanks for all youe help.
Sincerely,
Will Stein
Url's used:
http://www.onlymansei.com/test
http://www.onlymansei.com/test/image...swf/random.swf
View Replies !
View Related
Random Picture Display, Timelimited
Hi, I need some help with an actionscript for a site I'm working at right now. I have around 10 pictures and the effect I'm aiming to create a random picture displayer.
Right now I have all the pictures lined up in flash after each other and the pictures scrolls from 1-10. But the thing I want to create is so that it goes from 2 to 5, 6 to 1 etc, I think (hope) you get the point. I have seen many sites using this and it looks really cool, so I want something similarly for this site.
View Replies !
View Related
Random Variable For External Picture
Hi,
I have this code in my movie:
code:
pic = random(2);
pic = pic + 1;
picture.loadMovie("pictures/background"+pic+".jpg");
stop();
It works fine; 2 background pictures are randomly loaded in the movie.
But how can I control the random value with a variable?
If my variable is called "qback" than:
pic = random(qback);
does not work.
Bye, EJB
View Replies !
View Related
Random Picture From External Txt File
Ahh, it just won't work...
I want my movieclip to randomly choose a background picture. So far no problems... (I've a MC with instance name picture for this purpose etc etc)
But now I want to adjust the number of background pictures from an external txt file called update.txt. Inside this file i've this: &qback=4& (and another var.) Its easy to add more and more background pictures this way, but it won't work the way i've done it:
Code:
frame1:
loadVariablesNum("update.txt", 0);
frame3:
var maxVal = Number(qback);
// I have done the number thing to make the string a number... I'm not sure about it...
pic = Math.round(Math.random()*maxVal);
pic = pic+1;
picture.loadMovie("http://www.zwvnoord-aa.nl/test/background"+pic+".jpg");
stop();
I hope someone can help me out...
Ciao, EJB
View Replies !
View Related
Random Non-repeating Picture Array
I'm just a beginner at Flash, so please help me. I have a game I'm trying to make an online "calculator" for so people will know what to do and what to offer players. What I'm basically planning on is this.
I have 26 movie clips of the front of suitcases. When a contestant clicks on a suitcase, the cover slowly goes down (AKA Opens) to reveal a value inside. There are 26 different values that can be behind each case.....
View Replies !
View Related
[F8] Random Picture Button Quiz Help
Hi,
I'm making a quiz. I would like to display five random buttons on the stage. One button will be the correct answer while the other four will be wrong.
Everything works in the first frame, but when I copy and paste the code to the second frame, it doesn't work! For some reason, it draws everything on screen fine, but none of the buttons will work... any ideas?
Once I get it to work on the second frame, I would like to make "btn_ins2" the second correct answer by doing this...
btn_ins2.onRelease = function()
{
Play();
}
You can download the .fla file from here
http://www.asby91.dsl.pipex.com/quiz.fla
My mind is turning into spaghetti from this problem, but I'm sure its quite straight forward for the pros here... well I hope it is :-)
--------
Quote:
stop();
//create random numbers
numberOfElements = 5
myNumbers = new Array(numberOfElements);
randomNumbers = new Array(numberOfElements);
for(i=0;i<numberOfElements;i++)
{
myNumbers[i] = i+1;
}
i=0;
while(myNumbers.length > 0)
{
thePosition = Math.round(Math.random()*(myNumbers.length-1))
randomNumbers[i] = myNumbers[thePosition];
i++;
myNumbers.splice(thePosition,1);
}
//end of random numbers generator
//place movie clips into position
for(i=0; i<5; i++)
{
var newClip = this.attachMovie("btn"+randomNumbers[i], "btn_ins"+randomNumbers[i], this.getNextHighestDepth());
newClip._x = 15;
newClip._x += 260*i;
newClip._y = 400;
if (i == 3)
{
newClip._x = 143;
newClip._y = 203;
}
if (i == 4)
{
newClip._x = 404;
newClip._y = 203;
}
}
//end of placing movie clips into position
//button one is pink car (correct answer)
btn_ins1.onRelease = function()
{
play();
unloadMovie(btn_ins1);
unloadMovie(btn_ins2);
unloadMovie(btn_ins3);
unloadMovie(btn_ins4);
unloadMovie(btn_ins5);
}
View Replies !
View Related
:URGENT: Random Picture Generator
I creaed a random picture generator with a tutorial from kirupa.com
(http://www.kirupa.com/developer/mx/l...background.htm)
Now I created that same movie exactly the way he said. But something is going wrong.
I use Dreamweaver, and I have a few flash files on my index.htm. In dreamweaver, when I click the "play" and "stop" buttons in dreamweaver's properties inspector, the movie works great. But when I F12 it, or publish to web, all I get is a blank screen.
The only things I did different than the tutorial is I changed the pictures used, and I changed the movie size to fit my pictures/open box in dreamweaver.
http://www.onlymansei.com/test
http://www.onlymansei.com/test/image...swf/random.swf
You can go to the first one (www.onlymansei.com/test) and see the open box on the bottom right corner. That is where that flash movie should be going.
Now you can go to that open white space, and check, a flash movie is playing, but nothing is going on.
Thanks for all youe help.
Sincerely,
Will Stein
Url's used:
http://www.onlymansei.com/test
http://www.onlymansei.com/test/image...swf/random.swf
View Replies !
View Related
Random Moving Thumbnail To Picture Gallery
First of all i would like that im really thankfull and happy that i came across kirupa.com. all the tutorials and most threads have been very helpfull to me the last few months.
I hope i can find a quick answer to that one too.
im looking for a gallery type where thumbnails of my headlines randomly change in a thumbnail grit and than after a bit, change to one big picture over the grid still haveing the grid . a little like here
http://www.caution.de with the exception that i just have a maximum space available of 200x320 for my movie. so i thought it could be maybe about 9 thumbnails in total. on click of the big picture you will be taken to a different page.
im still a very amateur actionscripter but since being here im getting the hang of it a bit better. so please be pacient with me .
Best greetings to all you flash and AS gurus ( my personal heros) and kirupa
Dmormos
View Replies !
View Related
Random Loader
Using flash 5
I have a 12 empty MC's and 12 different .SWF's
I want to load a random swf into 6 random locations every time a button is pressed. I cant seem to find a tutorial to help.
Any Ideas
cheers
Rat
View Replies !
View Related
Random Swf Loader - Please Help
hi guys,
was just wondering if there would be a straight forward way of creating a loader which can play random swf's, its gonna be an ad area. i dont mind if it uses xml or whatever, i have knowledge to do that, but in my limited ability, i have only been able to list the movies ie
Quote:
<images directory="myfolder">
<imageNode jpegURL="img0.jpg" thumbURL="thm0.jpg" title="Image 0">Comments on Image 0</imageNode>
<imageNode jpegURL="img1.jpg" thumbURL="thm1.jpg" title="Image 1">Comments on Image 1</imageNode>
<imageNode jpegURL="img2.jpg" thumbURL="thm2.jpg" title="Image 2">Comments on Image 2</imageNode>
</images>
what i would like to do is make a movie which loads random external swfs, then after a time period will refresh itself back to the start of the movie and load another random swf, i release that the actionscript will be pretty simple to do, count etc as will the xml to make it random, i just lack the ability to make it happen, any help or advise would be great, thanks in advance
Mcktj
View Replies !
View Related
Random URL Loader
Hello everyone.
I am trying to have a random URL load on a mouse down event, here's the code:
ActionScript Code:
import caurina.transitions.*;
import flash.display.*;
import flash.events.*;
var topArray:Array = new Array();
var botArray:Array = new Array();
var urlLoader = new Loader();
for(var j:int=0;j<35;j++) {
var mcTop:topButton = new topButton;
mcTop.x = j*mcTop.width / 2.8 + 75;
mcTop.y = 450;
mcTop.scaleX = 0.3;
mcTop.scaleY = 0.3;
mcTop.addEventListener(MouseEvent.MOUSE_OVER, topReveal);
mcTop.addEventListener(MouseEvent.MOUSE_OUT, topHide);
mcTop.addEventListener(MouseEvent.MOUSE_DOWN, topGoTo);
addChild(mcTop);
topArray.push(mcTop);
}
function topReveal (event:MouseEvent):void {
Tweener.addTween (event.currentTarget, {y:450, scaleX:1, scaleY:1, time:0.2, transition:"easeInOutQuad"});
}
function topHide (event:MouseEvent):void {
Tweener.addTween (event.currentTarget, {y:450, scaleX:0.3, scaleY:0.3, time:1, transition:"easeInOutQuad"});
}
function topGoTo (event:MouseEvent):void {
urlLoader.load(studentURL);
}
for(var k:int=0;k<35;k++) {
var mcBot:botButton = new botButton;
mcBot.x = k*mcBot.width / 2.8 + 75;
mcBot.y = 460;
mcBot.rotation = 180;
mcBot.scaleX = 0.3;
mcBot.scaleY = 0.3;
mcBot.addEventListener(MouseEvent.MOUSE_OVER, botReveal);
mcBot.addEventListener(MouseEvent.MOUSE_OUT, botHide);
addChild(mcBot);
botArray.push(mcBot);
}
function botReveal (event:MouseEvent):void {
Tweener.addTween (event.currentTarget, {y:460, scaleX:1, scaleY:1, time:0.2, transition:"easeInOutQuad"});
}
function botHide (event:MouseEvent):void {
Tweener.addTween (event.currentTarget, {y:460, scaleX:0.3, scaleY:0.3, time:1, transition:"easeInOutQuad"});
}
var studentURL:Array = [new URLRequest("http://www.google.com"), new URLRequest("http://www.actionscript.org"), new URLRequest("http://www.ingenieursonline.co.uk")];
var randomStudentURL:URLRequest = studentURL[randUint(studentURL.length)];
function randUint(max:uint):uint {
return Math.floor(Math.random() * max);
}
My problem is that it doesn't work, I get coercion failures. I can post the fla if it would help. Any ideas?
Ta, A.
View Replies !
View Related
Random Loader Help
hi...this is my first thread.
first of all, this is a great site with alot of help for flash newbies like me...
i'm trying to get the random movie loader from the tutorials to work on my website...
it works on itself, but when i export it as a movie and import it into my website, it doesnt work...all i see is a round circle...
it's probably very easy to fix, but im clueless....thanks for your help
onlydng
View Replies !
View Related
Random Loader Help
hi...this is my first thread.
first of all, this is a great site with alot of help for flash newbies like me...
i'm trying to get the random movie loader from the tutorials to work on my website...
it works on itself, but when i export it as a movie and import it into my website, it doesnt work...all i see is a round circle...
it's probably very easy to fix, but im clueless....thanks for your help
onlydng
View Replies !
View Related
Random Text Loader
How can i make something that would randomly load a certain line from a text. For example have quotes in a text file as follows:
Sun always blah blah
Grass is greener blah blah
Always a rainbow after rainy day
so that each time someone loads website it would load randomly one of these quotes? Preferably from a text file so to be easily changeable for my client...
Thanks in advance,
<- This is what i really look like except i dont like sunglasses and i have a nose
View Replies !
View Related
|