ActionScript 2.0 :: Dynamically Load Jpgs Randomly In FLA?
Sep 25, 2003I wont to dynamically load jpgs randomly in my FLA.
View 5 RepliesI wont to dynamically load jpgs randomly in my FLA.
View 5 RepliesI am new to Flash, and I am taking the tutorialon loding jpegs dynamically. My question is canyou alter the script, and with the click of the samebutton load next jpg, then next etc
View 4 RepliesI'm trying to create a slideshow that loads pics (jpg) from an external folder ("pics/") into dynamically created MCs.What I want is for the script to detect how many pics are in the folder (for future changes), create as many instances of the MC, and load the pics into each one. The MCs will need to take the W and H of the pics, and line up next to each other. This last part is not as important, I'm just wondering how to determine the number of pics in the folder. Do I need XML or will AS 1.0 or 2.0 do this?
View 1 RepliesI'm trying to create a slideshow that loads pics (jpg) from an external folder ("pics/") into dynamically created MCs.What I want is for the script to detect how many pics are in the folder (for future changes), create as many instances of the MC, and load the pics into each one. The MCs will need to take the W and H of the pics, and line up next to each other.This last part is not as important, I'm just wondering how to determine the number of pics in the folder. Do I need XML or will AS 1.0 or 2.0 do this?
View 1 RepliesI am designing a website and have for locations I would like to load a random image from the same folder. Goals we'd like to accomplish with this:
1. We want images to load randomly from same folder
2. We don't want any duplicate images on the page at any one time
3. We have different size movie clips they are loading into.
Is there a way to accomplish this? What script do I use to resize the .jpg to fit whatever movieclip it's loading into and how to I tell it not to load an image that is already loaded in another movieclip?
I have designed a homepage that has 4 boxes on the right hand side that are of different size. I would like to have a movie loader that loads .jpgs randomly from a specified folder into each box. At the same time I don't want any repeats in any of the 4 boxes. Also is it possible to resize the images according to the box size without having to resize them outside of flash? I can have all the images in the external folder the same size, but then if I can just shrink them with whichever image falls into the box the random script assigns.
View 2 RepliesEssentially, I've got a MC container that's created dynamically based off an XML file (basically for every <title></title> I've got, it makes a new "card"). Now within the context of each <title></title> grouping I've got <imgs></imgs> in which I specify the path to images that are related.All of that works perfectly, save for the external jpg files actually appearing on the stage. The MC I add them to does, but the external image doesn't.My problem is- I can't add the external images until they're completely loaded (or so it appears). The thumbnail BG I use is blank. So I know for a fact that the thumbnail BG isn't occluding the loaded thumbnails.
View 2 RepliesI'm setting up an online picture gallery. I'm trying to make it easy for the client to insert specific images, dynamically loaded, have them appear at 63 percent. If the user clicks on one, it enlarges to 100 percent. Trouble is, when the image is at 63 percent, it is not smooth and looks terrible,All the BitmapData class solutions posted online work for individual images. But I can't figure out how to automate the process in a for loop. At this point I'm not even worrying about the enlarging. I just want the images to load at 63 percent and look smooth.Below is the code for two images. Later I'll increase this to 25.
On the stage are two colored rectangle movie clips: toon1 and toon2. I want the dynamically loaded jpegs to load inside them. The client will manually edit the last lines whenever she feels like it, to choose which images to load.What I need is an elegant AS2 solution in which any dynamically loaded jpeg will be smoothed.
for (i=1; i<=2; i++) { this["toon"+i].createEmptyMovieClip("cartoon",this.getNextHighestDept h()); this["toon"+i].cartoon._xscale = this["toon"+i].cartoon._yscale=63;
[code].....
i just need a preloader for my dynamically loading jpgs.
fyi, i don't need buttons or anything for this...it's a very simple slideshow where the images come in every 100 frames...that's it.
does anyone know what code i should put it so that my images will preload at the beginning so the slideshow doesn't stutter?
I would like to have a flash movie load a picture as the background image of a symbol or otherwise be viewable. The picture would be referenced via a URL on another site.Example. putting in a URL ending in '.jpg' would make another object show the pic from that URL.
View 8 Repliesloding jpegs dynamically. My question is can you alter the script, and with the click of the same button load next jpg, then next etc?
View 4 RepliesI've read a few of the other threads on this subject but still had no luck. I'm loading jpgs via an xml file and the pics are all diffrent sizes. I'm trying to figure out how to center the image once loaded, but am running into brick wall after brick wall.[code]...
View 1 RepliesI'm loading multiple instances of the same jpg dynamically to my swf. It works just fine locally, but when I upload it, it only executes the first loading code it encounters in the timeline. I was doing things fairly complexly with 'for' loops and dynamic name generation and stuff, but I've stripped it down to the basics in an effort to get this to work.
Here's some code:
loadMovie('1.jpg', mc1.empty_mc);
loadMovie('1.jpg', mc2.empty_mc);
mcLoader.loadClip('1.jpg', mc3.empty_mc);
mcLoader.loadClip('1.jpg', mc4.empty_mc);
mcLoader.loadClip('1.jpg', mc5.empty_mc);
as you can see, I'm using two different methods of loading the jpgs, just in an effort to pin down exactly what is going on. Locally, they all load fine. When I upload to the server, only the first instance of the loading code is run (so mc1 will get its jpg, but the rest won't). I've tried to swap the order, place the loading code in different areas, try to load different jpgs into each empty mc, but nothing works except that first instance flash gets to in the timeline.
The swf and jpgs are all in the same folder, both locally and on the server. The server the swf is hosted on is Windows 2003 box if that matters. I tried uploading it to a different windows box and got the same problem.
I followed the instructions in the tutorial "photo gallery" and for some reason my jpgs won't load.I pulled one of the images from the tutorial into the directory that I was telling my pics to be taken from and they work. So it isn't the path.All of the nature photos loa without fail, but my jpgs won't?
View 4 RepliesI'm trying to load jpgs into my swf at runtime but they always come out black and there is no image. Could it be that my files are too big?
View 1 Replieshow can you load external Jpgs into a swf instead of loading them and compiling the swf. so that they appear in the cache. Whats the function to do this, or is there a tut?
View 1 RepliesI'm trying to go through a for loop, create a movieclip for each database entry, add the image by url stored. The problem is the code I have only does the last image. I know it's because something is not incrementing and they all have the same name. Do I need to increment the name of my loader?[code]...
View 11 RepliesI've been trying to preload 2 jpgs and then load them onto 1 movieclip which I move around the screen.Having the jpgs showing on 1 movieclip is vital to my animation. Tried various approaches using createEmptyMovie(),DuplicateMovie(), loadClip() etc. I'm sure this should be fairly easy but just can't get it to work.
View 4 Repliesbut basically i have 100 buttons being generated and assigned names ( eh_1, eh_2, eh_3, ... ). On press they are controlling several functions but i would also like them to load a corresponding jpg into a blank movie clip. the jpgs are labeled... (1.jpg, 2.jpg ....)
Code:
var currentButton:Number = new Number();
for (var i:Number = 1; i<101; i++) {
_root["eh_"+i].id = i;
[Code]....
I am trying to load a couple of .jpg files by getting array data from .txt file. I searched this forum and found some code bits I could use. When I tested the file, getting array part seems to work fine (I get output for tracing), but nothing loads onto movie clips.
Here is the code:
var dataArray:Array
var dataLVs = new LoadVars();
dataLVs.load("vars/imgName.txt");
dataLVs.onLoad = function(success){
if (success){
[Code] .....
Firstly I aim to load random jpgs into a movieclip from a folder online. online image dir As jpgs will be constantly added to this by anyone, I will never know the file.jpg names to put into my AS. So i was advised I needed PHP to do this, (I know little about PHP) I got some space where PHP works! PHP enabled Right so at the moment I have a Movie Clip in flash with a piece of AS that says
[AS]onClipEvent (load) {
loadVariables("http://www.cppa.co.uk/t/test1.php", this, "GET");
filenames.split(":");[code]....
But when trying my php file through firefox its says (php file ."Parse error: parse error, unexpected '.' in c:websitesfreecrystalwww est1.php on line 5"
how to make this piece of PHP script send the flash the filenames of the directory, so flash can random insert on into a movie clip,
Firstly I aim to load random jpgs into a movieclip from a folder online. online image dir As jpgs will be constantly added to this by anyone, I will never know the file.jpg names to put into my AS. o i was advised I needed PHP to do this, (I know little about PHP) I got some space where PHP works! PHP enabled Right so at the moment I have a Movie Clip in flash with a piece of AS that says
[AS]onClipEvent (load) {
loadVariables("http://www.cppa.co.uk/t/test1.php", this, "GET");
filenames.split(":");
myRandom = random(filenames.length);
[code]....
But when trying my php file through firefox its says (php file
"Parse error: parse error, unexpected '.' in c:websitesfreecrystalwww est1.php on line 5"
So if anyone could give me any advice on how to make this piece of PHP script send the flash the filenames of the directory, so flash can random insert on into a movie clip.
I am pulling double duty with this question as it serves two purposes. I am developing a total flash controlled ad system for myself, but also need to use the same theory for a project for work.
Concept: I have a main movie (ad rotator system) that I then want to randomly load other swf's (individual ads) into this main swf after a set period of time. The random load I got set no problem. The problem I am having is to get it to move to the new Frame label of the main movie which then loads the smaller swfs. I am using the LoadMovie with nInterval time delay command in flash to load the movies.
[Code]....
I followed the instructions in the tutorial "photo gallery" and for some reason my jpgs won't load. I pulled one of the images from the tutorial into the directory that I was telling my pics to be taken from and they work. So it isn't the path. All of the nature photos loa without fail, but my jpgs won't
View 4 Repliesi am creating 10 Circle movie clips dynamically and giving each of them a width and height random from 1 to 50, I am creating these CELLS to react to eachother in an environment that I create, well anyway everything is going good but this, SPEED
i would like the smallest cells to have a speed of .05 and from then on the larger the cell the smaller the speed, Every ... property i guess you could say... of the cell is proportional to it's width.
I need to call external SWF's so they randomly appear within my main SWF. When one ends, the next will start and so on. I searched the forum and found a thread with the code below and have run in to an issue.
Each of the external clips is set up exactly the same... same length, same tweens, etc.
The code below is sitting the first frame, on the top layer within my main SWF:
randomClips = new Array ("Journey.swf", "Doobies.swf", "LedZep1.swf", "PinkFloyd1.swf", "Stones.swf");
function randomBackground() {
[Code].....
The main movie is one frame long and has three layers. The top layer has the Action Script (above), the bottom layer has my background image, and the middle layer holds the empty movie clip named mtClip
When loaded to the server, the movie plays and one of the external SWF's will load. When it ends, I need one of the other SWF's to load. What happens is that rather than randomly playing one of the other SWF's, it repeats the original external SWF. If I refresh the main SWF, it randomly selects one of the external SWF's and it will constantly repeat.
The external SWF's have no Action Script. I tried it with putting a Stop on the last frame, but that didn't help.
I had an idea I would like to incorporate into my site, and sure that Flash can accomodate, but what better place to check!? Say I have a mc_1, mc_2, mc_3, mc_4, and mc_5 all are basically the same information, just varied lead in animations. Is there a code that I can call to randomly choose among those when the site is loaded? Pretty vague I know, but right now I am adding them via "addChild," so would there be something I could use to accomplish this?
View 3 RepliesI have a blank .swf that I want to randomly load several other .swf files. here's the script I am using, but i do not know why it is not working.[code]
View 4 RepliesI got this XML slideshow.My xml looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
[code]......
I've made a banner that swaps through different images. I'd like it to start at a random image when the flash movie loads.
Currently, I'm using this code, and it works fine to an extend:
Code:
//function to get random frame
function getFrame() {
//Store frame numbers
[Code]....