Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Looking For Random Image Loader



hi list,

I currently have a main.swf, and I want to load random external image's. So everytime my page is refresh or a new page is load I want a new image to be loaded. I do not have any advanced skills in flash (yet ) So I'm looking for a fla-file which contains all the above. Anyone knows a location where i could find one (have been searching now for hours without success) or send me one by mail (chris@3rdmillennium.nl)

thx inadvanced (my deadline clock is ticking away AAARRRGGHHH)

crz



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-10-2003, 06:23 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Random Image Loader With AS2?
Hey all !

just wondering ... is it possible to script an array/function/function call to display a random bit map using AS2? I have a site I'm designing that's using photos as a background. I have two photos and the thing is they're equally great, so I thought I would have one of either of them display randomly when the user gets to the site or refreshes or even navigates the site (all in Flash).

I've used similar functions in JavaScript, so I thought it would be logical that the same result could be achieved in Flash ... thoughts?

Thanks in advance !

Xenon.

Random Image Loader
Hello all, i've just been searching the site for a while in search for a solution to my problem. You guys give great help but i couldn't find specifically what i wanted so i was hoping you could help out.

Basically, i have designed this layout in PhotoShop:



Using flash, i wish to have a random image load in the "random picture box".

I have a rough idea that i will need a like a rectangle there with some code linking to an xml file or something like that, but i really have no idea how to do it.

I'd also like different hyperlinks for each image if thats possible to do.

Any help is greatly appreciated in advance.

XML Random Image Loader
Hi all,

Basically, I am trying to create a banner for the top of the page and it will be displaying random images. I have it reading from the xml file like it should but I can not get the images to display. I am posting what I have and I know works although it's probably not the best way to do it. I pieced together everything I have from other scripts. I spent 4 hours or so yesterday googling and came up empty handed so I am here to ask for help.

We got a template and it came with a flash header and so I am trying to keep the same options as before but right now if I can get the images to display I will be happy. I will work on the random and transition and timer later. ( Most likely you will see me again for that stuff )

The flash has an image I imported to library and it is the background image for the whole movie. On the right side of the stage is where I want the images to display. Again, still have to figure out the best way to get the images to scale. I know they should have a height of 220px and the width needs to be proportional to that. ( might just have to resize in photoshop )


HTML Code:
<?xml version="1.0"?>

<jpgrotator>

<parameters>
<rotatetime>3</rotatetime>
<randomplay>true</randomplay>
<shownavigation>false</shownavigation>
<transition>blocks</transition>
</parameters>

<photos>
<photo path="header1.jpg"/>
<photo path="header2.jpg"/>
<photo path="header3.jpg"/>
<photo path="header4.jpg"/>
<photo path="header5.jpg"/>
<photo path="header6.jpg"/>
</photos>

</jpgrotator>
I tried using the createEmptyMovieClip() but I could not get it to work.


ActionScript Code:
Actions for Frame 1 of Layer Name Layer 2

function processXMLData(success) {
    if (success) {
        var count = this.childNodes[0].childNodes[1].childNodeslength;
        for (var i = 0; i<count; i++) {
            myImage = this.childNodes[0].childNodes[1].childNodes[i].attributes.path.toString();
                image_mc.loadMovie( myImage ); //This is 3rd Edit fix
        }
        } else {
        content = "No Pictures found, try back later!";
    }
}

this.createEmptyMovieClip("image_mc", 0); //This is 3rd Edit fix
var xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = processXMLData;
xmlData.load("photos.xml");
stop();

Edit:
Removed the flash stuff for now. Will try to repost soon after I swap out somethings.

Edit 2: Using Macromedia Flash MX - 6.0 I believe. I am not sure if I am using AS 2.0 or not but I believe I am. ******* Got moved so I guess I'm using 1.0 or below ********

Edit 3: Got it to show *a* picture. I am wondering if it's looping to fast for the other pictures or too fast I can see. Need a timer or figure a way to test to see if it loaded the image all the way.

Random Image Loader
Hello I already have a page built but I am looking to load random images and do not know how any help would appreciated. The existing page is http://www.dickandjanerocks.com The images of band members is what I would like to randomizeI can provide the original flash file if needed

Random Image Loader
sup... bothering again!

Once I saw a page that loaded images randomly inside a swf file, anyone has a clue how to do that?

thanks!

Random Image Loader Issues
Need help......bad.....I currently have a main.swf, and I want to load random external image's or swf's that contain images. I just can't get the external image/swf to load in a specific location on my main.swf. I currently have this as my code...

_root.createEmptyMovieClip("empty",1);
_root.empty.createEmptyMovieClip("holder",2);
pict = new Array("snow","im1","im2","im3","im4","im5","im6"," im7");
pictPlus = pict.length;
randomPict = Math.floor(Math.random()*pictPlus);
_root.empty.holder.loadMovie("img/"+pict[randomPict]+".jpg");

I've tried setting x and y, but that moves whats inside my main.swf, and not the external files. HELP!!!

Can anyone help me.....pweeze!!

Random Image Loader Question
hi list,

I currently have a main.swf, and I want to load random external image's. So everytime my page is refresh or a new page is load I want a new image to be loaded. I do not have any advanced skills in flash (yet ) So I'm looking for a fla-file which contains all the above. Anyone knows a location where i could find one (have been searching now for hours without success) or send me one by mail (chris@3rdmillennium.nl)

thx inadvanced (my deadline clock is ticking away AAARRRGGHHH)

(is this the right place for such a question???)

crz

[MX] SwitchUp For Random Image Loader Q
Hey Im using Flash MX and i was
trying to find a way to have a mc trace to see if it hasn't loaded the same # as other children mc. The code below is pasted on the first frame of 4 different mc. So each randomly loads an image, but most of the time 2 or 3 load the same image.


PHP Code:



_level0.switchUp();
      while (_root.selNumber==_root.lastNum){
        trace("images are the same");
        _level0.switchUp();    }
    continue;
this.createEmptyMovieClip("q",0).loadMovie("images/"+_root.selNumber+".jpg", 1);
q._x=30;
q._y=100;
p=this;
function change(){
        p[d++].onEnterFrame=function(){with(this) if(_alpha>0)_alpha-=2;else this.removeMovieClip()}
        d%=3;
        var newmc=p.createEmptyMovieClip(d,d);
        newmc._x=30;
        newmc._y=100;
        _level0.switchUp();
      while (_root.selNumber==_root.lastNum){
        trace("images are the same");
        _level0.switchUp();
    }
    continue;
        newmc.loadMovie("images/"+_root.selNumber+".jpg", 0);
        newmc._alpha=0;
        p.onEnterFrame=function(){
            if(newmc._width ){
                newmc.onEnterFrame=function(){with(this) if(_alpha<100)_alpha+=2;else delete onEnterFrame}
                delete this.onEnterFrame;
        }
    }
}
id = setInterval(change,8000)




this is the part Im wondering about


PHP Code:



_level0.switchUp();
      while (_root.selNumber==_root.lastNum){
        trace("images are the same");
        _level0.switchUp();    }
    continue;




Is there a way of having the mc check to see if it doesn't have the same # as other mc? Is there a way to use array in (_root.selNumber == [here] )

Random Image Loader Issues
Need help......bad.....I currently have a main.swf, and I want to load random external image's or swf's that contain images. I just can't get the external image/swf to load in a specific location on my main.swf. I currently have this as my code...

_root.createEmptyMovieClip("empty",1);
_root.empty.createEmptyMovieClip("holder",2);
pict = new Array("snow","im1","im2","im3","im4","im5","im6","im7");
pictPlus = pict.length;
randomPict = Math.floor(Math.random()*pictPlus);
_root.empty.holder.loadMovie("img/"+pict[randomPict]+".jpg");

I've tried setting x and y, but that moves whats inside my main.swf, and not the external files. HELP!!!

Can anyone help me.....pweeze!!

Loading Random Image Using Component Loader
Can anyone help me,

here is my file, and all the code this is testing live on my personal website, and so the image should load up no matter where the file is run.

------------------
THE GOAL
------------------
- to load a randomly generated image from a database

------------------
THE BACKEND
------------------
I have a php file which outputs something like this

file_name=Tds21st_Dsc00565.jpg&image_width=240&ima ge_height=184

This is coming from
http://www.bacina.net/5.0/php/randomphoto.php

------------------
THE FLASH
------------------
I have a flash file which is one keyframe and contains the following code

// set up some anti caching variable
revitalizer = Math.random();

// load the variables
_root.movie1.loadVariables("http://www.bacina.net/5.0/php/randomphoto.php?r="+revitalizer);

// set the path for the image retrival
var file_path = "http://www.bacina.net/photoDB/"+file_name;

// set image parameters
var imgw = image_width;
var imgh = image_height;

// tell component to load image (as per component help file)
_root.movie1.myImageBox.load("http://www.bacina.net/photoDB/"+file_name);
_root.movie1.myImageBox.setSize(imgw, imgh);

// stop
stop();

---------------

If anyone can lend ANY assistance to me with this, it would help me out to no end, I'm a total newbie at loading variables into flash properly and even if there is some other way to do this I would love to hear about it. I don't seem to be loading the variables properly into the movie =(

The component is MPImage Box - i got it from Macromedia Exchange.

thanks,
mike

Random Image Loader Using Dynamic Jpegs
hi all

i have downloaded the tutorial on random loading using swfs and it works fine when it's all located in one dir, but when i reference it from another swf one dir up, it stretches out the images; i'm guessing that it's all about paths; here's my code (same as tut but with a stop action at the end):

//load the 6 random images
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;
case 3 :
location.loadMovie("image3.swf");
break;
case 4 :
location.loadMovie("image4.swf");
break;
case 5 :
location.loadMovie("image5.swf");
break;
}
stop();

next, i'm trying to use some code to dynamically load each image in the swfs noted above with something like this (eg, for image0.swf, below):

_root.createEmptyMovieClip("imageHolder1", 200);
imageHolder1._x=100;
imageHolder1._y=20;
loadMovie("images/random01.jpg","imageHolder1");

again, i think my issue in combining these 2 pieces of code is all about paths, but i'm stumped; any help would be greatly appreciated! thank you

Random Image Loader Using Dynamic Jpegs
hi all

i have downloaded the tutorial on random loading using swfs and it works fine when it's all located in one dir, but when i reference it from another swf one dir up, it stretches out the images; i'm guessing that it's all about paths; here's my code (same as tut but with a stop action at the end):

//load the 6 random images
choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
location.loadMovie("image0.swf");
break;
case 1 :
location.loadMovie("image1.swf");
break;
case 2 :
location.loadMovie("image2.swf");
break;
case 3 :
location.loadMovie("image3.swf");
break;
case 4 :
location.loadMovie("image4.swf");
break;
case 5 :
location.loadMovie("image5.swf");
break;
}
stop();

next, i'm trying to use some code to dynamically load each image in the swfs noted above with something like this (eg, for image0.swf, below):

_root.createEmptyMovieClip("imageHolder1", 200);
imageHolder1._x=100;
imageHolder1._y=20;
loadMovie("images/random01.jpg","imageHolder1");

again, i think my issue in combining these 2 pieces of code is all about paths, but i'm stumped; any help would be greatly appreciated! thank you

The Ones That Got Away: Image Loader And Random Link Apps In Flash
This is an article discussion thread for discussing the SitePoint article, "The Ones That Got Away: Image Loader and Random Link Apps in Flash"

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!

Copying Loaded Image Bitmap Data To Another Image Loader
Hi,

I have an app where the user uploads an image into an image loader component. I am trying to figure out how to copy the bitmap data from that loaded image into another image loader component.

Could someone steer me in the right direction? I was looking at bitmap clone and copypixels though haven't figured out how to get this to work yet.

Thanks,

Dan

Bind Image To Image Loader Via Remoting
have got a comboBox working ok now as well as capturing the data value . What i am trying to do now is bind an image path/name to an image loader. How it works is there's a listener/handler on the combobox that when changed makes another query call pulling the appropriate path/filename from the database.

i need to get that path onto the image loader .. contentPath and load don't appear to work for it in the normal sense. .. the query and filename is being processed and is returning the correct value , i just need to get the image loader to use it .. below is the code that makes the call for the image


Code:
function getImage() {
var pc:PendingCall = retreiveProject.projectImg({getImage:myList.selectedItem.projectID});
pc.responder = new RelayResponder(this, "image_Result", "image_Fault");
}
how do i connect the result to the loader ?

Thx in advance

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

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

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.

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

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

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

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.

Random/Shuffle Loader
I have been using this great random loader actionscript:

filename = [
"movie1.swf",
"movie2.swf",
"movie3.swf"
];
path = "http://www.website.com/swf/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k],loader);

But it tends to load the same file over and over again... which is exactly what it is supposed to do - random - however I suppose I would like to find something that does more of a "shuffle" style random. It would load files at random but wouldn't reload the same file again until all the other have already been used.

Any Thoughts?

Pre-loader Bar & Random Movement
Appreciate if someone could help me to identify what went wrong in the attached .fla file. I don't seem to get the image moving at frame no.3. Any idea?

Thankds in advance.

Random Movieclip Loader
Alright so I'll just get down to it. I have created 2 different movie clips in my flash file that I've given an instance name of "clip1" and "clip2". I'm trying to have them load in the blank "mcHolder" movieclip I've created and placed into scene1. I have one frame on Scene1 and 4 primary layers that are in this order:

1) actions layer
2) mcHolder mask (888px X 257px) set to view layer as an outline
2) mcHolder layer
3) background layer

I have stop(); at the end of both individual movie clips so they will stop. What I am ultimately trying to achieve is have the two different clips load randomly when the web page is loaded with the embedded .swf file in the webpage. Each time the page refreshes, the flash banner loads its random clip (even though there are only two). Appreciate an help!



Chris

Add Link To My Random Loader
I have this random banner code, which loads external jpegs into my random banner file.

filename = ["125x125-metro.jpg", "125x125-oras.jpg", "125x125-uponor.jpg", "125x125-vailant.jpg", "125x125-bosch.jpg"];
path = "http://www.vvsdanmark.dana12.dk/pictures/bg/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);

But is it possible to add an url link to each jpeg i load into the swf file?

Random Movie Loader Help
hi flash guru,

how do i load diff movie every time i click a new browser?

please help me.

but i am not good at action script.
and i don't really understand
var movieArray:Array = new Array("swf1Name.swf", "swf2Name.swf"...);
var movieTotal:Number = movieArray.length;
var randomMovieTotal:Number = 20;
var randomNum:Number;
for (var i:Number = 0; i < randomMovieTotal; i++) {
randomNum = random(movieTotal);
_root["movieHolder"+i].loadMovie(movieArray[randomNum]);
}

can you please teach me how does it work in my fla file.
i need to load random swf movie on everytime i click on the button.
sample : http://www.topendconsultants.com/thpj.html

please help
thanks

Random Loader In Flash 5
I am trying to make a random image loader for a banner on a web page. I am using flash 5. I know how to write the script for a random loader in flash mx; however, the "switch" command will not copy over to flash 5. Help!!!! I have no clue on how to accomplish this effect in flash 5.

Loading Random Loader
Guys,

I've just done the random loader tutorial, which previews in Flash fine, but when I insert it into Fetch to load it on the net, the .swfs don't load onto the page.

All of the swfs are in the same directory, so I think I'm either being the largest prat on the planet, or doing something horribly wrong.

I've checked the past threads and can't see any other problems like mine posted, so I must surely be doing something basic wrong.

All answers will be read and digested, I promise.

Charlie

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.

Random Movie Loader.
Hello. I have completed the random loader tutorial here on kirupa.
If I dont want the files to load random but in a spesific ordrer, how do I change the code?

filename = ["movie1.swf", "movie2.swf", "movie3.swf"];
path = "http://www.mysite.com/events/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);


Thanks for your time.

Random Loader In Flash 5
I am trying to make a random image loader for a banner on a web page. I am using flash 5. I know how to write the script for a random loader in flash mx; however, the "switch" command will not copy over to flash 5. Help!!!! I have no clue on how to accomplish this effect in flash 5.

Loading Random Loader
Guys,

I've just done the random loader tutorial, which previews in Flash fine, but when I insert it into Fetch to load it on the net, the .swfs don't load onto the page.

All of the swfs are in the same directory, so I think I'm either being the largest prat on the planet, or doing something horribly wrong.

I've checked the past threads and can't see any other problems like mine posted, so I must surely be doing something basic wrong.

All answers will be read and digested, I promise.

Charlie

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.

Help With Random MovieClip Loader?
Hi Guy's, Gal's and Other's...My question is I want to load a different movie clip's when the site load...

When the site fist loads

Code:
_root.mc_EmptyTrunk.loadMovie("./Flash/mc_Trunk.swf");
stop();
Trunk loads then from the trunk

Code:
_root.mc_EmptyLogo.loadMovie("./Flash/mc_Logo.swf");
stop();
The Logo loads

I want to load a random clip in before it loads the Logo...
say 7 or 8 different clips into "_root.mc_EmptyRandom"
how do i even start this?

Thanx,
Babalou

Random Movie Loader Into A Level
I am looking for a script that will choose from 5 or so swf files and randomly load them into one of the movies levels. The idea is to have the viewer see a different movie every time they visit the home page. Can anyone direct me to a fla I can use to do this? Pleas put the name "zoe" in the subject line to get through my email filter.

Thanks

Problem With Random Flash Loader
Hey everyone!

Just a quick question on the Random SWF Loader tutorial. When I built the file it worked fine except my swf's that I am loading have navigation buttons in them which seem to be made useless by the load.

Does anyone have any addition to the code that would make me able to place links into SWF's that I want to load?

Thx

T.

{CS3} (AS2) Problem With Random Array Loader
Hello All !
I have an Array Randomly loading images on to the stage, there is a 'splice'
so no 2 images repeat. the problem is - once the images all get 'deleted' there are
no more images the array can pull. I want the images to be recreated in the array.
That way It will load the 29 images I have Randomly, with out repeating them
and after all 29 appear it will start over again.
If I remove the 'splice' I can load as many images as I want however some load twice
or more before the batch is complete.

Code:
var images:Array = new Array();
for (var i:Number = 0; i < 29; i++) {
images.push("image" + i + ".jpg");
}

images[0]="image0.jpg";
images[1]="image1.jpg";
images[2]="image2.jpg";
images[3]="image3.jpg";
images[4]="image4.jpg";
images[5]="image5.jpg";
images[6]="image6.jpg";
images[7]="image7.jpg";
images[8]="image8.jpg";
images[9]="image9.jpg";
images[10]="image10.jpg";
images[11]="image11.jpg";
images[12]="image12.jpg";
images[13]="image13.jpg";
images[14]="image14.jpg";
images[15]="image15.jpg";
images[16]="image16.jpg";
images[17]="image17.jpg";
images[18]="image18.jpg";
images[19]="image19.jpg";
images[20]="image20.jpg";
images[21]="image21.jpg";
images[22]="image22.jpg";
images[23]="image23.jpg";
images[24]="image24.jpg";
images[25]="image25.jpg";
images[26]="image26.jpg";
images[27]="image27.jpg";
images[28]="image28.jpg";

var picture:MovieClip = this.createEmptyMovieClip("picture",1);
picture._x = -167;
picture._y = 86;

btnRand.onPress = function() {
var num:Number = Math.floor(Math.random() * images.length);
picture.loadMovie(images[num]);
images.splice(num, 1);
};

Simple Random Movie Loader, Help Me On The Right Path Please
hey all, thanks or the click

ok so here is my problem, my webforums wont allow javascripts to run in the signatures (well duh) so I have a collection of small 120x50px movies, and I want one to load random on each page thats open. the files are generated swish files so you can randomize from them. I figured a small flash movie that loaded them in randomly would work as well?

ideas? thoughts? suggestions?

thanks everyone, best support for flash on the web is here at fk!

-mYles

Action Script Random Jpg Loader Problem
Hi, i have a small top loader that rotates jpg's.

I have created a flash file with 2 layers, 1st... Action Script and with a movieclip background, 2nd Static with some logos and buttons.

I have this actionscript in the file.

movieclip.prototype.loadjpg was copyed from
http://actionscript-toolbox.com/samplemx_loadjpg.php


Quote:




MovieClip.prototype.loadjpg = function(picName, holderName) {
var h = holderName==undefined ? "holder" : holderName;
this.createEmptyMovieClip(h, 1);
this._visible = false;
this.loadMovie(picName);
var id = setInterval(function (mc) {
if (mc._width > 0) {
mc._alpha = 99;
clearInterval(id);
mc._visible = true;
mc.onComplete();
} else {
mc.onLoading();
}
}, 80, this);
};

function positionIt() {
this._x = 0;
this._y = 0;
}

function virgem(){
movies = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];
last = Math.floor(Math.random()*movies.length);
this.createEmptyMovieClip("myjpg", 1);
myjpg.onComplete = positionIt;
myjpg.loadjpg("images/random" + movies[last] + ".jpg","background");
}

function rnd(){
movies = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];
choice = Math.floor(Math.random()*movies.length);
while(choice == last) {
choice = Math.floor(Math.random()*movies.length);
}
last = choice;
this.createEmptyMovieClip("myjpg", 1);
myjpg.onComplete = positionIt;
myjpg.loadjpg("images/random" + movies[last] + ".jpg","background");
}

a=1; if (a==1) { virgem(); a=2; }
timer = setInterval(rnd,10000);
stop();




My problem is that the jpg are being loaded in top of layer "Static" when they should be appearing on 1st layer "Action Script" so the buttons and other logo could be on top.
.. i don't know if it was anything to do with "this" or so.. still learning flash and actionscript.

Just another thing, how can i do a little function (or update other) so that the image don't show from one moment to another and fades ? i know i have to use this.alpha or something.. maybe around here... "mc._alpha = 99;" but i don't know exactly how to do it

Sorry the bad english.. help anyone ?

Someone answered this in macromedia foruns...


Quote:




The load jpg function is creating dynamic movieclips and then loading jpgs into them. So these moviecllips will always be placed above all the layers you have made during design time.
what you need to do is dynamically attach the logos etc on top of the images .




i replyed this


Quote:




But can't created movieclips be placed on the first layer right away and then he loads jpg into that movieclip ?

Have no ideia how to dinamycally do what you where saying




But still no answer

Load Random Content Into Loader Component?
As the subject suggests, I'm trying to load random content (regular old jpg's in this case) into a loader component.

I have an old script I found around the web before, where I basically make a new keyframe on the main timeline with a loader component in each one and the file in the content path of the parameters part like normal and the script tells it to gotoAndStop on a random frame.

But, this time, I have about 50 pics to randomize. I'm wondering if there's an easier way (more like a less tedious way) to do this where I don't have to make 50 keyframes and click all over to change the filename on each one.

Is there any way to just have 1 loader component, and then an action script that says "here's a list of images, display a random one when we load the page and stop there"? I'm thinking there must be some way to do it with XML too to specify all the images, but I never worked with XML & flash together before

So how can I do this? Anyone have any ideas? I'm not big on writing script stufff, so this one has be a little stumped even though I'm sure it's easier than I think. Any help would be greatly appreciated ;)

Load Random Content Into Loader Component?
As the subject suggests, I'm trying to load random content (regular old jpg's in this case) into a loader component.

I have an old script I found around the web before, where I basically make a new keyframe on the main timeline with a loader component in each one and the file in the content path of the parameters part like normal and the script tells it to gotoAndStop on a random frame.

But, this time, I have about 50 pics to randomize. I'm wondering if there's an easier way (more like a less tedious way) to do this where I don't have to make 50 keyframes and click all over to change the filename on each one.

Is there any way to just have 1 loader component, and then an action script that says "here's a list of images, display a random one when we load the page and stop there"? I'm thinking there must be some way to do it with XML too to specify all the images, but I never worked with XML & flash together before

So how can I do this? Anyone have any ideas? I'm not big on writing script stufff, so this one has be a little stumped even though I'm sure it's easier than I think. Any help would be greatly appreciated ;)

Random Flash .swf Movie Loader (continuous)
Hi All,

As a newbie I'm trying to solve a little problem I have with a web site flash header i'm creating and bow to your knowledge of using Flash...

I'm using MX and have a header that has a Flash movie in it...this has to be a random one of 47 files...one should load and play randomly and then when this has finished it should load another randomly from the same folder and then that play in full until that has finished and then another.. etc etc

So a random movie loader flash file loading randomly from a single folder containing 47 .swf files called image0.swf to image46.swf (perhaps with a preloader- each swf file is about 27k)

Either this is very simple..or very hard as there is only random loaders on the web which random load images on page refresh (not as a continuous never ending random movies...) and i'm getting square eyes from searching and looking!!

Your help would be greatly appreciated on this..Many thanks in advance....

Random Movie Clip Loader Needed
Hi there all of you experts :)

I am in desperate need of some help on the following:

I need a script to post on a timeline of a movie that will randomly load one of 9 movie clips onto a target within my flash movie.  The 9 movie clips are in a folder called "cards" and are called card1.swf, card2.swf,...and so on up to card9.swf.

That being said, it would be an utterly fantastic bonus if there is a way to:
1) Have all of the clips play randomly one time each before repeating any (after that, it obviously can repeat them in any order)

2) Preload the swf files in the background while the main flash swf is playing (so that there is very little delay in having each card.swf come up when it is randomly chosen)

I have seen similar topics on this, but can't seem to apply it to my particular needs... so if anyone out there can help, it would be MUCH appreciated!!! :)  

Also, if anyone does freelance programming, my company's clients are entertainment companies (tv, music, movies) and we are often looking for freelance flash programmers to hire here and there for programming that is a little more complicated than I can get into (I'm a designer first, programmer second).

Thanks!

Applying Actionscriping On A Button To A Frame / Random Movie Loader
hi.

how can i apply the actionscripting on the button to a frame? heres a link to the movie -

http://www.flashkit.com/movies/Basic...dex.php?chk=no

what im trying to do is have one out of X movie clips on stage play when it loads... sort of like a rotating banners.. but with movie clips.

Applying Actionscriping On A Button To A Frame / Random Movie Loader
hello.

how can i apply the existing actionscripting on a button to a frame on this fla -

http://www.flashkit.com/movies/Basic...dex.php?chk=no

what im trying to do is have one out of X movie clips on stage play when the file loads... sort of like a rotating banners.. but with movie clips - load a random movie at the begginning of the timeline.

i've tried copying and pasting the code inside the event handler into the frame with no luck


any ideas?

Random Flash N Random Image
Basically I have 5 flash movies and 3 images and I want to show them randomly using dreamweaver.. anybody knows how to do it?

Image Loader ?
i am so curious about how can a image loader like the one used in http://www.schiesser.de/schiesser.html works !!! how can i build it ?
if someone could guide me into this i will much appreciate .

only enter in http://www.schiesser.de/schiesser.html and click any picture of the right side of the webpage and loader will display .


thanks .

Copyright © 2005-08 www.BigResource.com, All rights reserved