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




Dynamic Images And Loading



Here's my situation...
I have a slideshow of no more than 5 jpgs (01.jpg-05.jpg) that I am dynamically loading that will be animated linearly (ie. 01.jp, 02.jpg, etc.).

I'm loading them into a container movieclip, and they load in fine and my movie works great.

Here's my problem...
I would like to know that if there isn't a 04.jpg, or 05.jpg on the server where my images are, that after my movieclip plays the 01.jpg, 02.jpg, & 03.jpgs, that if there is no #4 or#5, that my movie would loop back to play the number 01.jpg again. I hope I explained it well, but I am in dire need of help. Here's
my loading images code...


imageHolder2._x = 0;
imageHolder2._y = 0;
loadMovie("02.jpg", _root.container.imageHolder2);

Thanks for listening!



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 08-10-2003, 12:31 PM


View Complete Forum Thread with Replies

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

Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.

///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");

myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door

var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");

//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};

stop();
}

function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture

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

Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?

Loading Dynamic Images
With the new Flash MX there comes a file that shows how to load images dynamically. I want to use it, but I don't know how to modify it ( I don't know action scripting) For ex, that script only allows for jpegs to be loaded. How do I add in gifs. Also, how do I assign the script to a button that is not a next button? Any help is greatly appreaciated.

Dynamic Loading Of Images
Hi!

Is there a possibility to disable smoothing for dynamically loaded images?

Left and top border of JPG is blured, right and bottom border is missing. Might be a well known issue... but is there a workaround?!

Thanx a lot,
Tensile

Dynamic Loading Of Images With PHP
Hi,

I need to load some images into a static flash page, depending on the users choice. There will be approx 10'000 images. How can I load in external images into a swf from a variable passed from the php page.

example as follows...

A user selects Kylie Minogue from a list in php page, this goes to a standard swf page whereby all the Kylie albumn images are loaded into set boxes on screen?

Any ideas, i realise there are probibly afew ways of doing this, so any ideas are welcome.

cheers

Dynamic Loading Images
Does anybody know how to dynamically load an image into flash from a folder on the server?
Any tutes?
-thankx
p2studios.com

Dynamic Images Loading
Hi I got gynamic image gallery that just load jpgs usign for loop into an empty movie clip as holder. What can I do to add a preloader for these jpgs ... basically everytime u click an album btn it loads set of 9 images so considering it might take bit longer to load 9 at once it would be nice to show preloading or something (I know how to make preloader but doesn't quite work with this image holder and jpg thing ... any ideas

cheers

Loading Dynamic Images
I've got a problem here.

The fla retrieves a list of jpg filenames from an xml file.

It then joins all the jpgs together in a new mc, then scrolls the mc.

It works just fine. But I cant get it to show that the images are preloading or loading. As there are close to 30 images that i wanna load, and it takes quite some time to load.

How do i solve this?

Loading Dynamic Images
Hello,

I have 5 placeholders for images. These placeholders are simple frames. The images load in, and shrink down to fit (thumbnails) replacing the frames. That was working fine, until trying to unload the images. Unloading the images removed the original content there, along with the frame, and the entire movie clip.

Also, puting the frame into a jpeg, and trying to load that in, had horribly reduced frame quality (the border looked as if it was smudged) when resized. Also, upon trying to make a smaller image that wasn't resized, then when loaded over the other images, they shrank to tiny images.

So basically, should I create and delete movie clips since I am having so much trouble?

How would I create 5 movie clips, and then remove all 5 of the movie clips when it loads again? Would that fix my problem?

Thanks,
Cameron

Loading Dynamic Images In 2.0
Ive tried using actionscript for loading texts files and they work fine but when it comes to loading images the images do not load, and yes i have checked they are in the same folder. I am trying to load them from pressing a button
here is the part that needs updating as it works in flash 6 but not in later versions

on (release) {
loadMovie("image.jpg",loadbox);
}


i think it shud be simple but i just cant find it anywhere

Loading Dynamic Images
After loading images dynamically into an empty movie clip, is the a way for me to reposition the image to look central in a viewing area? The pictures differ in width but are always less than the viewing area. When I try to get the movie width after the image has been loaded it always says 0, i think this is because I've imported it to an empty clip.

i.e. viewing area = 400 pixels, image._width = 300 therefore the image._x should be placed at 50 Pixels leaving 50 at either side.

I'd appreciate any help, any help at all!! Thanks...

Dynamic Loading Of Images
Hi,
I've got a problem with my flash site.

When I load my images with these AS3 commands, it only shows when I'm offline looking to my site, but when I've put my site on a webserver, it doesn't show my images....
Anyone who can help? (http://arcada.dommel.be-->only the "appartementen" button works for now )

Thnx

ActionScript Code:
for (var k =0; k<9; k++) {
            this["infoFoto" + k] = new MovieClip();
            this["infoFoto" + k].instanceName = "infoFoto" + k;
            this["info"+getal].addChild(this["infoFoto" + k]);
            this["infoFoto" + k].buttonMode = true;

            var detail:String = project[getal].fotos.foto[k].toString();
            var urlVraag:URLRequest = new URLRequest(detail);
            imgsGroot[k] = new Loader();
            imgsGroot[k].load(urlVraag);
            this["infoFoto" + k].addChild(imgsGroot[k]);
            imgsGroot[k].x = 0;
            imgsGroot[k].y = 0;
            this["infoFoto" + k].scaleX = 31/97;
            this["infoFoto" + k].scaleY = 31/97;
            this["infoFoto"+k].buttonMode = true;
           
    }

Loading Dynamic Images
Hi all,

i refer to this tutorial:
http://www.kirupa.com/developer/mx/photogallery.asp

I saw the codes and i was wondering if it was possible if i load ALL images in the directory without declaring this line:

quote:
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg"];

thank You!
HuGx,
Yen

Dynamic Loading Of Images
I know flash MX supports externally loading images. I have 2 simple pages at www.everythingpossible.org and www.somethingunderground.com. I want to load the background images of each page (frame) as the user navigates to that page. I have searched far and wide for a solution, which leads me to believe that this is so simple, that there needs not be a tutorial. What makes sence is this:
loadMovieNum("imageName.jpg", 1);

but there is no control over the position of the image once it in the movie. I basically need to get these file sizes smaller, I have already figured out the dynamic loading of text. . .is there a way to load images like this?

Please help!

Wiso
www.everythingpossible.org
somethinunderground.com

Dynamic Loading Of Images
I know flash MX supports externally loading images. I have 2 simple pages at www.everythingpossible.org and www.somethingunderground.com. I want to load the background images of each page (frame) as the user navigates to that page. I have searched far and wide for a solution, which leads me to believe that this is so simple, that there needs not be a tutorial. What makes sence is this:
loadMovieNum("imageName.jpg", 1);

but there is no control over the position of the image once it in the movie. I basically need to get these file sizes smaller, I have already figured out the dynamic loading of text. . .is there a way to load images like this?

Please help!

Wiso
www.everythingpossible.org
somethinunderground.com

Dynamic Content - Loading Images
Hey ho,

In my MC, I want the user to be able to specify URLs containing images. Then I want to load and display these images in my MC with specified sizes and suchlike.

I cannot seem to find any traces of proof that this is even possible. Can I get Flash to load external images?

Thanks,
Urgas

Pre-loading Dynamic Images/sound
what i want to do is for you to click a button and for an image to appear or a sound to play. both of these would be dynamic. but when you click the button, i want a loader to come up and load the image or sound so that the users know that it's loading and not that it is just messed up. thanks in advance

-harrison jobe

Loading Images In Dynamic Text Box
Hello all,

I would like somebody who knows if this is possible to spent few minutes of his time and tell me how to do it, if this can be done.

I am creating flash chat and I would like to have emotion images (icons) displayed in chat, little icons with text, but I do not know can I and how to submit them and show them in dynamic text box.

So if you are reading this post, and have know how, please help me.

Thank you.

P.S.
Yes, I am using Flash MX

Loading Dynamic Images From Mysql
Hi all,

I'm trying unsuccessfully to load images from the db into my movie. I can load text from the db, but not an image. I'm storing the location of the file in the db, but how do I get the image to appear?

I've tried using the loadmovie method, with the URL going to a PHP script, which selects the image from the db...but that hasn't worked. Can somoene tell me step by step how to do this?

Thanks in advance.

Loading Dynamic Images On A Server
Hello fokes.

I'm working on a site called www.pilotman.no and I've made a flash movie from a tutorial on how to dynamicly load images from a folder on the server. (it's on the frontpage of the site). The only problem is that I can't get the movie to rotate, it stops after one round.

Could somebody help me out with this? Here is the code:

Thanks,
[gem]


Quote:




square._alpha=0;
mypic=1;
$LO=true;

// script causes slides to advance automatically every 5 seconds - no start button it just plays

_root.onEnterFrame = function()
{
if (square._alpha < 10)
{
loadMovie("/images/image" + mypic + ".jpg", "square")
fadeOut=false;
fadeIn=true;
//message.text=mypic; if this field is gonna show pic number, you have to make a textfield with an instance of message again.
}

if (square._alpha > 10 && fadeOut)
{
square._alpha -= 10;
}

if (square._alpha < 100 && fadeIn && !fadeOut)
{
square._alpha += 10;
}
else
{
fadeIn=false;
}

if (mypic>=10)
{
mypic=1
startTimeSet=0;
}

if (getTimer() > 7000 && mypic < 10 && !fadeIn && !fadeout && mypic==1)
{
fadeout=true;
mypic=2;
}

if (getTimer() > 14000 && mypic < 10 && !fadeIn && !fadeout && mypic==2)
{
fadeout=true;
mypic=3;
}

if (getTimer() > 21000 && mypic < 10 && !fadeIn && !fadeout && mypic==3)
{
fadeout=true;
mypic=4;
}

// continue to add if statements for every image in the series mypic==4, 5, 6, 7 etc.

}

next.onPress = function()
{
if (mypic < 10 && !fadeIn && !fadeOut)
{
fadeOut=true;
mypic++;
}
if (mypic >= 10)
{
mypic=1;
}
}

back.onPress = function()
{
if (mypic > 1 && !fadeIn && !fadeOut)
{
fadeOut = true;
mypic--;
}
if (mypic == 1 && !fadeIn && !fadeOut) // if image is on 1 go to the last image in series
{
fadeOut=true;
mypic=10;
}
}

Loading Images In A Dynamic Textbox?
I've been trying to load images into a dynamic text box and I can't get it to work at all.

I've got a very "noobish" question: Where do I put in that "img" tag stuff? I know how to create a dynamic text box so I know that much but everyone just says "Oh yeah, you can load images into dynamic text boxes. Just use the img tag." Where do I put this? I mean, there are three possible places. 1. In the actual textbox on the stage 2. The external text file 3. The actionscript panel. I don't know which one and I can't find the answer anywhere.

This is driving me crazy. Does anyone know a VERY simple way to load images into a dynamic texbox? Like, paste this here, do that there.

Oh and I've been to this link:http://livedocs.macromedia.com/flash...=00001046.html

It's no help at all.

Loading Dynamic Images & Placement
i am loading images dynamically on button press. (the jpgs just sit in a folder on my server, they aren't embedded into flash).

this all works fine, but I want to specify where they appear on the stage...i can't seem to figure out how to get it to work...

here is an example of the code I am using to call the images:

on(press) {
loadMovie("gallerypics/bouquets/image1.jpg",1);
}


Thanks in advance!

Dynamic Loading Of All Images In A Folder
------Flash MX 2004 Pro------
Is there a simple(?) way to auto- and dynamicaly load all images in a specific folder with, for example, your holliday images. My images names are auto generated by my digital camera and looks like this:

IMG_0134.JPG
IMG_0135.JPG
IMG_0142.JPG
IMG_0144.JPG

The best thing would be if some code could load all images in a folder irrespective of the file names (my_image_1a.jpg, myCat.jpg, IMG_0134.jpg, IMG_04.jpg etc.)

Please help me. I don't want to manualy write a long list, xml or similar

Thanx

Dynamically Loading Images W/ A Dynamic URL
I'm looking for a way to dynamically load images and then have those images clickable so that they link to a related webpage. I dont want to edit the .fla every time there is a new image to add or different URL. I'm looking for possibly a txt file or xml script that I can call on to load the images and related URL. Any ideas on how to do this? Im working in Flash 6. I'm new to XML so if you could treat me like a noob when explaining that would be great. Thanks.

Loading Dynamic Images With Crossfade
Hi all,

What I am trying to do is loading a picture on the first frame. when going to the next frame I need to load another picture on top of the old one with crossfading and so on. I also need to have a preloader on each picture before they crossfade. example: http://www.arne-maynard.com. Can anyone point me in the right direction of how this is done?

Loading Dynamic Images Into Buttons
I want to load a dynamic image into the over state of a button, is this possible?

I could do it with just movieclips, but then I've got to have events for onRollover and onRollout.

Dynamic Loading Images On Projector
How to make a dynamic photo galery in a Projector?
I tried but it´s not working....
some ideas?

Dynamically Loading Images From Dynamic URL
I have 3 movieClips on the stage. I want this to load images from urls that I have withdrawn from a php script that randomly selects from stored urls in the database. I want to load one of these into each movieclip. Here is the code that i have, but it doesn't work. Could someone please tell me why?
(btw, this is on a frame of the movie)

PHP Code:



loadText = new LoadVars();
loadText.load("generateQuiz.php?week="+_root.week);
loadText.onLoad = function() {
    j = 1;
    sortItOut();
    loadInto = "left";
    this[loadInto].loadMovie(this["set"+j][file]);
    trace(loadInto);
    trace(this["set"+j][file]);
    j++;
    loadInto = "middle";
    this[loadInto].loadMovie(this["set"+j][file]);
    j++;
    loadInto = "right";
    this[loadInto].loadMovie(this["set"+j][file]);
    j++
};
stop();
function sortItOut() {
    numOfQuestions = loadText.numOfQuestions;
    for(i=1; i<=numOfQuestions; i++) {
        url = this.loadText["image"+i];
        path = "images/week"+_root.week+"/";
        file = path+url;
        question = this.loadText["question"+i];
        ansA = this.loadText["ansA"+i];
        ansB = this.loadText["ansB"+i];
        ansC = this.loadText["ansC"+i];
        correct = this.loadText["correctAns"+i];
        this["set"+i] = [image, question, ansA, ansB, ansC, correct];
    }
}
j = 1; 

Images- Dynamic Loading/Displaying
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 dont acually want the images to appear right here (this is the loading part). What I want is each image to be in a seperate symbol with a unique identifier so that I can create them dynamically during runtime.

I hope you can help me, I havn't worked with flash for about half a year so I've forgotten a lot of things.

Hope you can help, thanks in advance!

Dynamic Loading Of Images Into A Scroller With ASP?
hi,

I wud like to create a scroller movie clip which contains the strip of jpg image files. some 100 jpg files are stored in a folder. Out of which 5 jpg file will be taken out dynamically from the folder. i have written the code in ASP to pick 5 jpg files from the folder. the output text from the asp file is given below.

imgs_src1=C:Inetpubwwwrootpics8.jpg&imgs_src2= C:Inetpubwwwrootpics4.jpg&imgs_src3=C:Inetpub wwwrootpics5.jpg&imgs_src4=C:Inetpubwwwrootp ics7.jpg&imgs_src5=C:Inetpubwwwrootpics6.jpg&

i m trying write Action script code to align the picked files into the movie clip to scroll from left side to right side. can anyone give idea to start and proceed the code... ???

Thanks in advance!!!!

Dynamic Loading Images With Preload
Need help with this - I want to dynamically load images in an mc. When you press the button for image 1, image 1 should start to preload, but not show untill fully loaded. When fully loaded, the image should show and another animation mc should start playing.
When pressing button2, image 1 should disappear from the container mc, and image 2 should appear after being fully loaded, the animation mc starts playing again, etc.

I fumbled about with this preloader tutorial, but the mc that holds the images is created dynamically, while I just want it to be an mc on stage. Heres the code:



var empty = this.createEmptyMovieClip("container", "100");
empty._x = 325;
empty._y = 125;

my_mc = new MovieClipLoader();

preload = new Object();

my_mc.addListener(preload);

preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
};

preload.onLoadComplete = function(targetMC) {
trace(targetMC+" finished");
fadein_mc.gotoAndPlay (2);
};


my_mc.loadClip("models/001.jpg", "container");

button1.onPress = function() {
my_mc.loadClip("models/002.jpg", "container");
};

button2.onPress = function() {
my_mc.loadClip("models/003.jpg", "container");
};

button3.onPress = function() {
my_mc.loadClip("models/004.jpg", "container");
};



Any help much appreciated! Thanks

[mx]blurry Images With Dynamic Loading
hey all,

Right i know its been covered to death, but does anyone know how to combat the automatic anti-aliasing that flash does when importing dynamically loaded jpegs?

i really don't want to take each pic, break apart, convert to graphic etc..............and make swfs for all of them (100 upwards).

any cool tricks are appreciated.

laters
kd

Dynamic Loading Images On Projector
How to make a dynamic photo galery in a Projector?
I tried but it´s not working....
some ideas?

Dynamically Loading Images From Dynamic URL
I have 3 movieClips on the stage. I want this to load images from urls that I have withdrawn from a php script that randomly selects from stored urls in the database. I want to load one of these into each movieclip. Here is the code that i have, but it doesn't work. Could someone please tell me why?
(btw, this is on a frame of the movie)

PHP Code:



loadText = new LoadVars();
loadText.load("generateQuiz.php?week="+_root.week);
loadText.onLoad = function() {
    j = 1;
    sortItOut();
    loadInto = "left";
    this[loadInto].loadMovie(this["set"+j][file]);
    trace(loadInto);
    trace(this["set"+j][file]);
    j++;
    loadInto = "middle";
    this[loadInto].loadMovie(this["set"+j][file]);
    j++;
    loadInto = "right";
    this[loadInto].loadMovie(this["set"+j][file]);
    j++
};
stop();
function sortItOut() {
    numOfQuestions = loadText.numOfQuestions;
    for(i=1; i<=numOfQuestions; i++) {
        url = this.loadText["image"+i];
        path = "images/week"+_root.week+"/";
        file = path+url;
        question = this.loadText["question"+i];
        ansA = this.loadText["ansA"+i];
        ansB = this.loadText["ansB"+i];
        ansC = this.loadText["ansC"+i];
        correct = this.loadText["correctAns"+i];
        this["set"+i] = [image, question, ansA, ansB, ansC, correct];
    }
}
j = 1; 

Images- Dynamic Loading/Displaying
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 dont acually want the images to appear right here (this is the loading part). What I want is each image to be in a seperate symbol with a unique identifier so that I can create them dynamically during runtime.

I hope you can help me, I havn't worked with flash for about half a year so I've forgotten a lot of things.

Hope you can help, thanks in advance!

Dynamic Loading Of Images Flash/xml
Can some please try to assist me or point me in some sort of direction.

I have about 5 different asp pages.  Each one of the pages have a top banner (flash) with about 3-4 images in the flash movie just transiting from one image to another to match the current page the user is on.

i.e say I am on tek-tips.com, the top banner swf should be a generic one about tek-tip (images should be generic).

When I am on Flash forum, the top banner images should now change to show images relative to the section that I am on.


Can anyone help please? :( I think its XML & Flash.  

Thanks in advance

Loading Dynamic Images Into Movieclip
Hi,

I would like to add a movieclip to my movie that calls 4 different images that fade from one to the next. Can anyone direct me to a tutorial that accomplishes this?

Thanks!
Jen

Scheduled Dynamic Loading Of Images And Text
i want to have a sort of "quote of the day" thing in my site were every day a different quote comes up from a text file,

also another thing i want to do is update an image every week automatically in my swf following the same principle.

wonder if anyone has any guide for me on this project
thanks a lot

Scheduled Dynamic Loading Of Images And Text
I want to have a sort of "quote of the day" thing in my site were every day a different quote comes up from a text file,

also another thing i want to do is update an image every week automatically in my swf following the same principle.

wonder if anyone has any guide for me on this project
thanks a lot

Loading External Images From Dynamic Website
Hello,

I am wondering if someone can share the knowledge about the most appropriate way to create a flash file that will be able to get external images from some kind of code (XML or some cookies) that will have a path to the image that will be needed to download into flash movie. The problem is that the path will be all the time different. As a result I'd like to know how can I make the flash file reading that path from XML file and then download the image into flash.
It is kind of challenge for me. I never did something like that.
Any advice is highly appreciated. Maybe there are some examples. It would be the easiest way to learn about it.

Many thanks in advance.

Loading External Images From Dynamic Website
Hello,

I am wondering if someone can share the knowledge about the most appropriate way to create a flash file that will be able to get external images from some kind of code (XML or some cookies) that will have a path to the image that will be needed to download into flash movie. The problem is that the path will be all the time different. As a result I'd like to know how can I make the flash file reading that path from XML file and then download the image into flash.
It is kind of challenge for me. I never did something like that.
Any advice is highly appreciated. Maybe there are some examples. It would be the easiest way to learn about it.

Many thanks in advance.

Loading Images Into Dynamic Text Boxes
Hi all,

Can someone please tell me why this picture won't load into the dynamic text box? I am using Flash MX on Windows XP. The jpeg is saved as progressive. I've attached the files used. Many thanks.

Michael.

Loading Multiple Dynamic Images Into A Scrollpane Using XML?
Okay I am loading an XML file into a Flash movie. The XML loads images into an attached MovieClip and stack these them vertically. That part works fine.

What I'm having trouble with is getting the MovieClips (containing the images)to load into the scrollpane and space out accordingly.

I have a small area to load these images which is why I'm using the scrollpane. The images are actually loaded into a Movie Clip so I can apply actions for an on click.

Any help would be much appreciated!

Thank you

Loading Dynamic Images - 2advanced Studios
Hey Guys,

I am having a problem trying to figure out how to load images into flash just like they do here: http://www.2advanced.com/#services/print. When you maximize one of the images that are flashing in and out an image viewer pops up loading those images. When you cycle through those images the border outlines the image to shape it's width and height. I was wondering how this is done?

Thanks

Wlsn18

Dynamic Loading Of Images Not Working Anymore
hello folks

this image 'gallery' worked already but now i added this loadImgs part with the loadvars and now it doesn't load any image anymore!

if i trace the thumb var i get the list of the images which should be loaded!


Code:
stop();

loadImgs = new LoadVars();
loadImgs.load("http://oks.ok/getIntroImages");
loadImgs.onLoad = function() {
is = this.iurls;
imgs = is.split(";");

//this.imgs = ['http://oks.ok/cover.jpg','http://oks.ok/cover.jpg'];

var x = 0;
var y = 0;
var fadeSpeed = 30;
var fadeMax = 90;

for (var i = 0; i < imgs.length; i++) {
var t = this.createEmptyMovieClip("thumbnail" + i, i);
var c = t.createEmptyMovieClip("picHolder", 0);
var thumb = imgs[i];
c.loadMovie(thumb);

t._x = x + (80 * i);
t._y = y;
t._alpha = 0;
t.canfade = false;
t.num = i;
t.onEnterFrame = function() {
if (this.canfade || !this.num) {
if (this._alpha<=fadeMax) {
this._alpha += fadeSpeed;
} else {
this._parent["thumbnail"+(this.num+1)].canfade = true;
}
}
};
}

};
any ideas? please help me!!!

thanks in advanace!
oliver

Dynamic Images Not Loading In Correct Position
Currently, I use loadmovie to load a jpg into a movieclip. However, when the jpg is loaded, I believe that the top left hand corner of the jpg is in the middle of the clip and does not line up with the top left hand corner of the clip.

How do I get the jpg to line up correctly?

Stopping Playhead Whilst Loading Dynamic Images
hello, am getting a little confused with this:

I'm loading in an image dynamically using:

stop();
loadMovie(_root.imgroot + img,thumb);

I'd like to then progress the playhead using a play(); or gotoAndPlay(); statement after the image has loaded in, but if i simply add that, then playback often commences before the image has fully loaded (which then messes up the rest of the movie). How can I get it to pause until the image is fully loaded in and also tell me if image loading has failed?

much appreciate any assistance.

thanks,

andy.:

Flash Security Problem, Loading Dynamic Images
Hi,

I'm pulling my hair out because I've created a flash website that loads images from a folder located within the same domain. When you click to view the image via flash it brings up a security dialog stating that the action is potentially unsafe? I know you can allow it through the global security settings to allow the site.

But I don't want users to be inconvenienced like this, some users aren't technically minded and they're likely to just leave the site.

Is there any way around this?? Driving me crazy.. Cheers, Rick.

Dynamic Portfolio Loading Images From Folders Named After Buttons
Hello,

I posting first time here hoping someone could help me solve problem which drives me nuts for 3 days now.

I am doing a project and I though it would be nice to include a dynamic portfolio that my client could easily update himself by uploading JPGs to appropriate folders and updating a TXT file within each folder that holds JPGs description and number count.

I though it would be easy, especially that I had access to code of similar portfolio done by someone else for someone I know. So I thought that I can easily copy some code and figure out the proper linkage. But something is terribly messed up and I think it might be the conjugation of strings and things that are way out of my jurisdiction.

The structure is as follows.

There are folders in images directory
Each folder is named like a button and the _global variable it calls upon clicking i.e.
print_Ads
print_Brochures
print_Newsletter

each of these folders contains up to 8 JPGs named 1.jpg,2.jpg,3jpg etc and a TXT file that stores variables.

Website is structured so there is one main SWF file which loads up new Movie clips different sections, one being the portfolio section.

The code that “should” make everything functional is split between main SWF and it is assigned to Portfolio Sub Section Buttons and the Portfolio SWF file which should call from within JPG files and also display number of artwork buttons depending on how many JPG files are listed in the TXT file in corresponding folder (i.e. print_Ads)

Below is the code for portfolio buttons in main SWF file.


Code:
// Sets scene
stop();
this.print_Ads.gotoAndStop("down");
_global.portSection = "print_Ads";
// Loads Portfolio
loadMovie("portfolio.swf", _root.mainWindow);
//
// BUTTONS ACTIONS AND SUB PORTFOLIO SECTION//
// PRINT ADS BUTTON
this.print_Ads.onPress = function() {
if (_global.portSection !== "print_Ads") {
print_Ads.gotoAndStop("down");
print_Brochures.gotoAndStop("ready");
print_Catalogues.gotoAndStop("ready");
print_Colleteral.gotoAndStop("ready");
print_Direct.gotoAndStop("ready");
print_Identity.gotoAndStop("ready");
print_Illustration.gotoAndStop("ready");
print_Newsletters.gotoAndStop("ready");
print_Packaging.gotoAndStop("ready");
print_Posters.gotoAndStop("ready");
//
// this is part that lnks with portfolio.swf to make everything display dynamiclaly
//
_global.portSection = "print_Ads";
_global.portpage = 1;
_root.mainWindow.portfolio.portcontent.imgswap(_global.portpage);
for (n=0; n<11; n++) {
nub = "this."+String(_global.portarray[n]);
eval(nub).gotoAndStop("on");
}
}
};
this.print_Ads.onRollOver = function() {
if (_global.portSection !== "print_Ads") {
print_Ads.gotoAndStop("over");
}
};
this.print_Ads.onRollOut = function() {
if (_global.portSection !== "print_Ads") {
print_Ads.gotoAndStop("ready");
}
};
//
// PRINT CATALOGUES
//


It keeps going and going for all the buttons but it’s the same code on all of them so no need to post more… important is the _global.portSection part and dynamic portfolio segment.

The AS in portfolio movie clip is as follows (I’m also including a portfolio FLA for use)


Code:

_global.portpage = 1;
_global.textsect = "port_Ads";
//_global.portSection = "print_Ads"
/////Portfolio Functions/////////////
//this handles the images
function imgswap(portpage) {
txtswap(_global.portpage);
// path to images within each Button Name corresponding folder
loadstring = "images/"+_global.portSection+"/"+portpage+".jpg";
loadMovie(String(loadstring), portcontent);
//takes care of the number buttons within each category
for (i=1; i<10; i++) {
eval(i).gotoAndStop("up");
}
eval(_global.portpage).gotoAndStop("down");
//end the number buttons
}
/////////////this handles the descriptions Text Loader
function txtswap(portpage) {
if (_global.textsect == _global.portSection) {
titletextstring = "_global.title"+portpage;
descripttextstring = "_global.descript"+portpage;
titler.text = eval(titletextstring);
descriptor.text = eval(descripttextstring);
} else {
_global.textsect = _global.portSection;
reloadtext();
titletextstring = "_global.title"+portpage;
descripttextstring = "_global.descript"+portpage;
titler.text = eval(titletextstring);
descriptor.text = eval(descripttextstring);
}
}
function reloadtext() {
//This runs on the first frame to load the proper set of variables from the
//matching text file
loadVarsText = new LoadVars();
loadtxtstring = "images/"+_global.portSection+"/descript.txt";
loadVarsText.load(String(loadtxtstring));
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
_global.title1 = this.titles1;
_global.descript1 = this.description1;
_global.title2 = this.titles2;
_global.descript2 = this.description2;
_global.title3 = this.titles3;
_global.descript3 = this.description3;
_global.title4 = this.titles4;
_global.descript4 = this.description4;
_global.title5 = this.titles5;
_global.descript5 = this.description5;
_global.title6 = this.titles6;
_global.descript6 = this.description6;
_global.title7 = this.titles7;
_global.descript7 = this.description7;
_global.title8 = this.titles8;
_global.descript8 = this.description8;
//mj--get the number of images used in this section
//so we can hide unused buttons
_global.useCount = this.used;
titler.text = _global.title1;
descriptor.text = _global.descript1;
eval("1").gotoAndStop("down");
//show all buttons by default
for (var z = 8; z>0; z--) {
eval(String(z))._visible = true;
}
//hide unused buttons
if (_global.useCount<8) {
//hide
var diff = 8-_global.useCount;
for (diff; diff>0; diff--) {
eval(String(9-diff))._visible = false;
}
}
//end hide if block
} else {
trace("not loaded");
}
};
//onload
}
//reloadtext
////////////End Portfolio Functions.
/*moved to final frame****/
reloadtext();
imgswap(_global.portpage);
/*************************/
//stop();


The text files in each of the folders storing JPGs is as follows (I’m also including the TXT file]

And that pretty much sets the scene for my little drama. I would kindly appreciate any response. I know the code is noobish and could be simplified, but if you can find a solution, please don’t rewrite the whole thing to make it 1337 guru code, just try to correct the conjugation of strings or whatever it is that doesn’t allow the damn thing to work and don’t change too much around, so that I can understand what was the problem and how you’ve managed to solve it.

Very, very kind regards,
Netrunner

P.S. Does anybody know a tutorial that would illustrate how to control turning buttons off and on with an array? I did many searches, but can’t find anything that would explain this fairly useful technique especially if your buttons have names instead of numbers. Most of the array tutorials are either total BS. Like new.array = workers [“bob, “carl”, “lucy”] trace (workers) or totally advanced stuff that just doesn’t make any sense to me.

Loading Dynamic Gallery Thumbnail Images Overrides Variables
i think the issue with the following code is one of scope or pathing, but after hours of trial and error, i just can't figure it out:

this._lockroot = true;

//set up variables for loading jpg files
var thumbnailMCL:MovieClipLoader = new MovieClipLoader();
var thumbnailMCL_listener:Object = new Object();
thumbnailMCL.addListener(thumbnailMCL_listener);

thumbnailMCListener.onLoadError = function() {
trace("thumbnailMCL Load Error");
}

thumbnailMCL_listener.onLoadComplete = function() {
assignThumbnailInteractivity(thumbnailAddingIntera ctivity);
_root["thumb" + thumbnailAddingInteractvity].thumbNum = thumbnailAddingInteractivity;
thumbnailAddingInteractivity++;
}

//set up variables for displaying images
var curImageNum:Number = 0;
var oldImageNum:Number = 0;
var curDepth:Number = 1;

var totalImages:Number = 58;
var thumbSize:Number = 75;
var imageSize:Number = 300;

var sliderSetWidth:Number = 500;
var sliderSetHeight:Number = 8;
var sliderSetYPos:Number = 550;

var thumbnailSpacing:Number = 10;
var thumbYPos:Number = sliderSetYPos - thumbSize - Math.round(Stage.height * .05);

var thumbnailFadeSpeed:Number = 1.5;
var mainFadeSpeed:Number = 1;
var alphaDisabled:Number = 30;

var widthOfAllThumbnails:Number = (totalImages * thumbSize) + ((totalImages - 1) * thumbnailSpacing);

var thumbnailAddingInteractivity:Number = 0;


function makeMainImageViewer(depth) {
_root.createEmptyMovieClip("photos", depth);

with(_root.photos) {
enabled = true;
_alpha = 100;
trackAsMenu = true;
visible = true;

_x = (Stage.width - _width) / 2;
_y = Stage.height * .1;

_root.myMCL.loadClip("photos/image0.jpg", _root.photos);
}
}

function createThumbnails(startDepth) {
trace("creating thumbnails......");
for (a = 0; a < totalImages; a++) {
trace("creating thumbnail" + a);
_root.createEmptyMovieClip("thumb" + a, a + startDepth);
//_root["thumb" + a].thumbNum = a;
trace("_root.thumb" + a + ".thumbNum = " + _root["thumb" + a].thumbNum);

with(_root["thumb" + a]) {
enabled = true;
_alpha = alphaDisabled;
trackAsMenu = true;
var thumbNum = a;
}
}
}

function createThumbnailsTwo () {
for (a = 0; a < totalImages; a++) {
_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
//assignThumbnailInteractivity(a);
}
}

function assignThumbnailInteractivity(thumbnailToAddInterac tivityTo:Number) {
//thumbnails load coinciding full sized images into "viewer" when clicked on
trace("assigning interactivity to thumbnail" + thumbnailToAddInteractivityTo);
_root["thumb" + thumbnailToAddInteractivityTo].onPress = function() {
oldImageNum = curImageNum;
curImageNum = this.thumbNum;

trace("oldImageNum = " + oldImageNum);
trace("curImageNum = " + curImageNum);
//trace("this.thumbNum = " + this.thumbNum);
trace("_root.thumb" + thumbnailToAddInteractivityTo + ".thumbNum = " + _root["thumb" + thumbnailToAddInteractivityTo].thumbNum);

_root.enableAllThumbnails();
this.enabled = false;
this._alpha = 100;

fadeUp(_root["thumb" + oldImageNum], 100, alphaDisabled, thumbnailFadeSpeed);

var fadeTween = new mx.transitions.Tween(_root.photos, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, _root.mainFadeSpeed, true);
fadeTween.onMotionFinished = function() {
_root.myMCL.loadClip("photos/image" + _root.curImageNum + ".jpg", _root.photos);
fadeDown(_root.photos, 0, 100, _root.mainFadeSpeed);
}
}

//set up fade in/fade out (_alpha change) animations for thumbnails onMouseOver & onMouseOut events
_root["thumb" + thumbnailToAddInteractivityTo].onRollOver = function() {
fadeUp(this, _root.alphaDisabled, 100, _root.thumbnailFadeSpeed);
}

_root["thumb" + thumbnailToAddInteractivityTo].onRollOut = function() {
fadeUp(this, 100, _root.alphaDisabled, _root.thumbnailFadeSpeed);
}
}

makeMainImageViewer(20);
createThumbnails(50);
createThumbnailsTwo();


the problem is that as soon as i click on a thumbnail (w/ an image loaded into it), the trace call in function assignThumbnailInteractivity tells me that this.thumbNum is undefined. However, by commenting out in createThumbnailsTwo() as so:
_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
//assignThumbnailInteractivity(a);
is:
//_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
assignThumbnailInteractivity(a);
lets me have all the functions i want with the place holder thumbnails (black squares). the trace call to this.thumbNum in assignThumbnailInteractivity does not get "undefined" and instead operates exactly as i want. i've also tried changing
oldImageNum = curImageNum;
curImageNum = this.thumbNum;
to
_root.oldImageNum = _root.curImageNum;
_root.curImageNum = _root["thumb" + thumbnailToAddInteractivityTo].thumbNum;
to no avail.

so, by process of elimination, obviously something is happening when i load an image that erases my assignment of this.thumbNum. any ideas? or is there actually a function native to flash where i could find out which thumb# i'm inside from inside a function?

should i change how i handle the onLoadComplete MovieClipLoader listener event handler? assigning the onMouseEvent handles w/o waiting for the onLoadComplete would have images load, and disable interactivity, so i guess loading images using MCL overrides any custom variables and event handling functions????

also, i'm betting that i don't need to draw temp images for the thumbnails. but when i take that code out, the thumbnails don't display at all.

any help would be greatly appreciated!

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