Help With This Fla (load Images)
hi, i have create this fla but i have something wrong and i dont understand
here is my AS
Code:
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
function onLoadStart(_mc:MovieClip) {
//trace("empieza")
}
function onLoadInit(_mc:MovieClip) {
_mc.squareEffect(50, 12, 24, 10, "left-right", true, 10);
}
function onLoadProgress(_mc:MovieClip, loaded:Number, total:Number) {
bytes_loaded = Math.round(_mc.getBytesLoaded());
bytes_total = Math.round(_mc.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.pb._width = getPercent*2.5;
this.pt = Math.round(getPercent*100)+"%";
}
var l:Number = 1;
carga = function (l:Number) {
trace("uno"+this.l)
if (this.l == 9) {
this.l = 1;
this["hold9"].removeMovieClip();
}else{
this["hold"+(Number(this.l)-3)].removeMovieClip();
}
trace("dos"+this.l)
this.createEmptyMovieClip("hold"+this.l, this.getNextHighestDepth());
loader.loadClip("img/home_"+this.l+".jpg", this["hold"+this.l]);
this.l = this.l+1;
};
var intervalId:Number;
intervalId = setInterval(this, "carga", 3000, this.l);
carga()
i upload to yousendit my fla with the images i load.
http://www.yousendit.com/transfer.ph...7897FD50B190A1
my problem is that it wirks perfect but when the photos go in the second round in the photo 5 it stops.
can someone help me
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-08-2006, 12:52 AM
View Complete Forum Thread with Replies
Sponsored Links:
Load All Images From The Images In 1 Folder (named By Random Number)
Hi Guys,
I've got a gallery style viewer, you click on an image and it enlarges. It pulls in images which are numbered 1 to 12 in a folder called 'images'. I want it to pull in randomly numbered images instead. so i suppose i want it to search the folder for images named 1.jpg up to 1000000.jpg and pull them in.
I've uploaded it to: www.dhardy.co.uk/gallery.zip as it'll become clearer then!
Thanks in advance! dave.
View Replies !
View Related
Attaching Multiple Images - Load Images One At A Time?
I have a photo gallery that loads many images using a for loop (image data is from XML file). Simplified code looks like this:
Code:
var photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(success) {
if (success) {
var photos = photos_xml.firstChild.childNodes;
var itemCount = 0;
for (var i = 0; i < photos.length; i++) {
var path = photos[i].attributes.path;
// attach the photos
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);
photo_mc.empty_mc.loadMovie(path);
itemCount ++
...
Then on the photoFrame_mc clip I have a loading like:
Code:
onEnterFrame = function () {
loader_mc._visible = false;
var t = empty_mc.getBytesTotal();
var l = empty_mc.getBytesLoaded();
percent = Math.round((l / t) * 100);
if (l == t && t != undefined && t > 10) {
loader_mc._visible = false;
delete this.onEnterFrame;
} else {
loader_mc._visible = true;
if (isNaN(percent)) {
percent = 0;
}
loader_mc.percent_txt.text = 10 - Math.round(percent / 10);
}
};
So what happens now is that many images get attached at once and they are all loading at the same time.
What I'd like to do instead is to have them load one at a time. The first pass through the for loop attaches an image and then it loads, but it doesn't move on to the next image until the first one is done loading. Is that possible?
Or maybe is it better to let them load all at once? I just think that when the image count is very large it will really bog down loading so many images at once and it might be best to load one at a time. Please advise.
View Replies !
View Related
Load From Txt File ..then Do Sequence Load Of Images...
im loading from txt file links of images and want to load each image in each mc...
it works ok though have some issue with sequence loading images...
here's the script..
ActionScript Code:
stop();
_level0.sekcija = 'WEB';
_level0.leto = '2006';
//define max value
max = 0;
var leftMax;
var lvData:LoadVars = new LoadVars();
var locText:Array = new Array();
var locImg:Array = new Array();
_level0.datoteka = '../edit_module/web_2006.txt'
lvData.load(datoteka);
lvData.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess)
{
trace("define max load ok");
//if load success
for (i=1; i<11; i++)
{
if (eval("this.picture"+i) != undefined)
{
locText[i] = eval("this.text"+i);
//load img in MC with preloader
locImg[i] = eval("this.picture"+i); //get the pic link into array
//test preloader
trace(i);
_level0.current_selection = "";
var test = eval("_level0.container.film_trak.mc_load.mc"+i);
if (_level0.current_selection == test)
{
stop();
}
else
{
_global.containerMC1 = test
_global.containerMC1.loadMovie(locImg[i]);
_level0.preloader1.gotoAndPlay(2);
trace("test this");
_level0.current_selection = test;
}
//test preloader
if (locText == "" or length(locText) == 0 or locText == "
" or locText == "
")
{
break;
}
}
else
{
break;
}
}
trace("loop end");
trace(max);
leftMax ;
}
};
and here is the script IN preloader witch is in seperate mc
ActionScript Code:
this.onEnterFrame = function() {
trace("function preload strat");
percent = (_global.containerMC1.getBytesLoaded()/_global.containerMC1.getBytesTotal())*100;
if (!isNaN(percent)) {
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"%";
}
this.loadbar._visible = true;
this.loadbar._xscale = percent;
if (percent>1) {
this.reelmc1._visible = true;
}
_global.containerMC1.stop();
}
if (percent == 100) {
trace("preload func. 100%");
this.gotoAndStop(1);
delete this.onEnterFrame;
this.reelmc1._visible = false;
percent_display = "";
this.loadbar._visible = false;
_global.containerMC1.play();
trace("test tole");
trace(containerMC1);
}
};
stop();
hmmmmmm
now let me explain...
the preloader function doesnt start until the loop (for) is finished!?!?!
i dont get this!
i wnat that preloader works for every load..for every image...
can anyone tell me what am i doing wrong?
View Replies !
View Related
[help] Load Images And Load AS For Button?
I have successfully dynamically loaded Jpegs into my flash document(using PHP), but then I have another small problem...
When I dynamically load the image (example: image_icon_bluesky.jpg) I then need to tell the MC that is holding the loaded image that it needs to do this...
on (release) {
_root.image_bluesky.alpha = 100;
}
SO basically every time a new image is loaded in my sort of "loop" script. I need to tell the image that it needs to put specific code onto the MC using specific "image" details for that specific image.
I hope this is clear. Basically what I'm trying to do....
On my flash stage I already have MC's that have their alpha properties set to "0". Lets say there are 3 images. One MC is called Blue, other is called Red and the last one is called Yellow.
Now using AS + PHP I have dynamically loaded 3 Jpeg's ....
myData = new LoadVars()
myData.load("theitems.php")
myData.ref = this
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
this.ref["holder_mc"+i].loadMovie(this["item"+i])
}
} else trace("Error loading data")
}
In the PHP script a query takes the info from a database. In this case there are 3 images to load. Let's say they are called 'Blue.jpg', 'Red.jpg' and 'Yellow.jpg'.
Okay now ideally I need to find someway of sending the "link" with the image. So that when 'Blue.jpg' loads on the stage it knows it's AS needs to be
on (release) {
_root.blue.alpha = 100;
}
and so on for each image....I have tried to explain this as well as I possibly can. I just wanna know if this is possible or if there is a simple way of doing it. I am so stressed by this that I might not even be thinking clearly. I appreciate any replies on the subject!
View Replies !
View Related
To Load All Images?
I am making a project to pull the external images, but this total bad one, what I would like to know is, I make to pull 5 external images showing one loading before show the images, I only start to show the images when all the images already will be pulled. Somebody knows as to make? or some tutorial one?
View Replies !
View Related
Trying To Load 5 Images
I want to load One image at a time. Have it fade out and the new one loads. Currently i have 5 images loading at one time. I only want 1 image at a time.. here is my action script..
this.createEmptyMovieClip("thing",1);
this.thing.loadMovie("image1.jpg");
var totalImages = 5;
var fadeInterval = 150;
for(i=1; i<=totalImages; i++)
{
this.createEmptyMovieClip("thing"+i,i);
this["thing"+i]._x = (i*110) - 100;
this["thing"+i].loadMovie("image"+i+".jpg");
this["thing"+i].fade = function()
{
setInterval(fadeMaster,fadeInterval,this);
}
}
function fadeMaster(pic)
{
pic._alpha -= 5;
}
thing1.fade();
thing2.fade();
thing3.fade();
thing4.fade();
thing5.fade();
View Replies !
View Related
Possible To Load Images In This Way
Hello!
I have an actioscript issue, I would like to have a swf file which would contain an input text field. When typing the path to an image file inside a folder in the text field, the image of which the path would be typed inside the text filed would appear in a holder field.
Is this possible?
Thanks for any help.
Best wishes
theredtitan
View Replies !
View Related
Load XML + Images.
Hi guys,
I'm stuck, I'm trying to load some text and an image from an XML file. I want both the image and text to be displayed in a text field ( mainly because I have to scroll the content ). I can load the text, I can add the image to the stage with addChild but I can't figure out how to load the image into the field with the text... This was quite easy in AS 2.0 but I simply can't make it work...
Ahh and there's one more thing, how can I enable htmlText and use special syntaxes in XML like BOLD or something and make that display correctly one the XML is loaded.
Thanks.
View Replies !
View Related
How To Load Images WITHOUT Xml
Hi there,
I have made a flash file that loads and fades images dynamically using xml and works perfectly however it is to use on the homepage of a CMS which won't read or execute xml.
Could anyone please advise me of another way I can achieve the same effect solely through actionscript? It only really needs to load around 6 images. I am still fairly new to actionscript so please be patient with me!
The xml version can be viewed here http://www.raincliffeschool.org.uk/e...age/index.html
Many thanks
Helen
View Replies !
View Related
Why Won't My Images Load?
Hello
I have a movieclip with a scroll pane. also a mc which i named a class with a 'delete' button and an image holder inside it. (linked as chosen_thumb_mc)
For some reason, the thumbnails are not loading? I cant find out why because it says the code is correct.... Can anyone see what is wrong with my code?
thanks so much in advance for any help!
Code:
var ThumbArray:Array = new Array();
ThumbArray[0] = ["70317", "name70317", "2"]
ThumbArray[1] = ["28076", "name28076", "3"]
ThumbArray[2] = ["28085", "name28085", "1"]
ThumbArray[3] = ["28006", "name28006", "3"]
ThumbArray[4] = ["28013", "name28013", "2"]
var holder:Sprite = new Sprite();
var hor = -100
var ver = 10
var columns = 0
LoadPaneWithChosenThumbs();
function LoadPaneWithChosenThumbs() {
for(var i:uint=0; i<ThumbArray.length; i++) {
var ThumbnailMc = new chosen_thumb_mc()
var pictLdr:Loader = new Loader();
var pictURL:String = "products/pics/"+ ThumbArray[i][0] + ".jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
ThumbnailMc.loader1.addChild(pictLdr.content);
ThumbnailMc.btn_delete.addEventListener(MouseEvent.CLICK, btn_delete_handler);
ThumbnailMc.price = ThumbArray[i][2]
ThumbnailMc.thename = ThumbArray[i][1]
holder.addChild(ThumbnailMc);
//I only want 4 columns in the pane
if(columns==4){
columns = 0
hor = -100
ver = ver + 120
} else {
hor = hor + 110
columns++
}
ThumbnailMc[i].x = hor
ThumbnailMc[i].y = ver
}
pane.update();
pane.source = holder;
}
function btn_delete_handler(event:MouseEvent):void {
//holder.removeChild(mcRecord[???thedeletedthumb???]);
//ThumbArray.splice(???thedeletedthumb???, 1);
////clear the pane
//LoadPaneWithChosenThumbs();
}
View Replies !
View Related
Not Able To Load Images
hi,
i made a swf file which gets the image path from a xml file and shows those images in the flash. it works fine in my local machine. but when i load it on the website it just wont work. please can somebody help me with this
thank you
rajesh
View Replies !
View Related
Using XML To Load Images
I am trying to load images into a photo gallery, using XML. I have all the images in a folder called "images" without quotes, and I was wondering if there were any tutorials or .fla's anyone had?
Similar to www.tonydrayton.com. The gallery there, and the way the images are loaded.
View Replies !
View Related
To Load All Images?
I am making a project to pull the external images, but this total bad one, what I would like to know is, I make to pull 5 external images showing one loading before show the images, I only start to show the images when all the images already will be pulled. Somebody knows as to make? or some tutorial one?
View Replies !
View Related
Load Images In A Row, How Can I Do It?
How can i load ALL the images at once in a horizontal row with a small white gap between each image? This is the script i was using to load jpg's from a folder, at the moment its loading the images in 1 after the other then going back to the start.
Please can someone help!!
Code:
delay = 3000;
//-----------------------
function loadPHP(loaded) {
if (loaded) {
imageArr = new Array();
fl = this.filelist;
imageArr = fl.split(",");
total = imageArr.length-1;
image = [];
for (i=0; i<total; i++) {
trace(files[i])
image[i] = imageArr[i];
}
lv.load("http://rock.blueprintit.co.uk/test/images.php");
firstImage();
} else {
content = "file not loaded!";
}
}
phpData = new LoadVars();
phpData.onLoad = loadPHP;
phpFile = "images.php";
phpData.load(phpFile);
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 100;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 100;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
View Replies !
View Related
Load Images One After Another
hi,
im trying to do a flash site with multiple external .swf but i want them to load one at time. when one has fully loaded the next one starts to load. what would the actionscript be for something like this? heres a few examples of what im after:
http://www.adamvonmack.com/main.html - the way the thumbnails load on this site
http://www.trevorleighton.com/ - the next image doesnt load until the current one has finished
thanks
View Replies !
View Related
Not Able To Load Images
hi,
i made a swf file which gets the image path from a xml file and shows those images in the flash. it works fine in my local machine. but when i load it on the website it just wont work. please can somebody help me with this
thank you
rajesh
View Replies !
View Related
Using XML To Load Images
I am trying to load images into a photo gallery, using XML. I have all the images in a folder called "images" without quotes, and I was wondering if there were any tutorials or .fla's anyone had?
Similar to www.tonydrayton.com. The gallery there, and the way the images are loaded.
View Replies !
View Related
To Load All Images?
I am making a project to pull the external images, but this total bad one, what I would like to know is, I make to pull 5 external images showing one loading before show the images, I only start to show the images when all the images already will be pulled. Somebody knows as to make? or some tutorial one?
View Replies !
View Related
As3 Load Images From Xml
i want to make a simple movie that will have 6 images that fade in/out to one another and loop. im reading in images filename from an xml file. how do i put an image onto the stage? do i load it into a movieclip?
View Replies !
View Related
Load Images
how can i load a image into my .swf like load another movie inside by using loadmovie.
is there have any skill like that. coz i wanna do sth like FWA, when i click on the link, the image will load into my mian scence. but i dont wanna group all my images in one movie...u know
can any mate here can help me~
View Replies !
View Related
To Load All Images?
I am making a project to pull the external images, but this total bad one, what I would like to know is, I make to pull 5 external images showing one loading before show the images, I only start to show the images when all the images already will be pulled. Somebody knows as to make? or some tutorial one?
View Replies !
View Related
Load Images From Directory
Hey.. I was wondering if someone would be able to tell me how to randomly load images from your directory to be displayed on the screen.. Doesn't sound that hard.. but i am just curious how... Pleaze help me out
MrZion
View Replies !
View Related
How To Load Images Into Flash?
Hi all,
I am wondering if and how I can load images into flash. *I know how to load additional swf movies but
now sure how to do it with images like jpegs or gifs. *The loadMovie command doesn't work. *Let's say
I have a movie clip and I want it to load an image from somewhere, let's say a CD? both files will be
on CD. how do I do that? Thanks for your help.
I tried using XMLload like this:
picture.load(image12.jpg);
where picture is my movie clip instance name and image12.jpg is my image that I try to load.
and it didn't work out.
View Replies !
View Related
Dynamically Load Images
this may OR may not sound difficult but
if anyone has a link to a tutorial on
loading images dynamically to a flash
movie I would appreciate the direction.
The general problem is this;
To have a menu for images and as is obvious
after a link is pressed on the menu, the image loads,
BUT,
If the owner of the site wants to add new images
daily, then, all he would have to do is upload
the images to the server and the Menu would be updated
and the pic along with the menu item would be accessable.
About the menu, I am going to take care of that myself,
About the images, I will direct the owner of the site
to specifically name each new pic that he uploads,
so that Flash can go through the file each time it loads
and determine if there is another image in the file,
basically it would just loop once and count the number of images. so again, that is not my problem,
the problem is simply loading the data remotely...
Thanks in Advanced everyone
View Replies !
View Related
Help: How To Load *external* Images
I'm developing a site that contains a photo gallary.. The site also contains other info so i dont want to make the users wait for the WHOLE site to load when they aren't gonna be using it... So how do i make it so that the picture files only load when they need to? I'm still using flash 5... Havn't gotten acustomed to MX yet..
Thanks guys
View Replies !
View Related
Mx Sample Help- Load Images
In the sample section of the mx program they have a featured highlight – load images. (load_images.fla)
(help>samples>load feature highlight load images)
Can someone walk me through this?
I have 20 pics that I would like to load from a server.
View Replies !
View Related
Ending Load Images
hey people im using a script which loads external jpg files into a movie clip. What i need to do however is create a dynamic text file that says "loading..." which the next file is being loaded from the server and then say "End of Gallery" when the last image has been loaded and no more images are left in the sequence.
the code i have so far is.....
//initialize variables and properties
square._alpha = 0;
whichPic = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
if (whichPic<300 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("images/image"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>100) {
input = 5;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
stop();
could anyone tell me what to add to this to get the result i need.
thanks
View Replies !
View Related
Possible To Load Images Into Textbox?
I'm trying to make a chat program, I have insta smilies like in the left here where you click on the smilie, it insterts the smile code, on submit, the code is formatted into a full image tag...
Code:
example <img src="whatever.jpg">
the posts are then pulled from a mysql database using php script and loaded into a dynamic textbox with html formating turned on. The text shows, but of course the images don't. So is there any way I could convert the smilie code into a code that will load the images into the textbox?
View Replies !
View Related
Load Images & Laythem Out
Hello,
I'm interested in creating a Flash MX Application that loads images dynamically. For example say I have x amount of thumbnail images in a directory on my website. I want to have flash look at that directory, find out how many thumbnails I have in that directory and then load them into the Flash movie into however many rows/columns I need. So then, for example, if I were to upload more thumbnails (and probably just name them by number) Flash will automatically detect more images in that directory and will load them.
Any ideas on how to do this?
Thanks
-Foochuck
View Replies !
View Related
Images Don't Load From Webserver
My image gallery works fine offline, but when I post to the webserver images don't load.
This image gallery is called imageweaver, is not mine...nor do I wish to make people think its mine. It can be found at http://www.buggedcom.co.uk
The creator hasn't responded to this specific question, so I thought I'd give my problem a try here.
The images are dynamically loaded from folders in the root directory on the webserver. The heirarchy is something like this
gallery/design/construction photos/images/image001.jpeg
...again, the gallery directory is on the same level as the .swf. Also, the imageweaver utility is in a scene within the main timeline. I've been told this structuring of the movies (movie within a movie) may change the location the utility/flash goes to look for the images. If this is true, what might the possible renaming be? Does flash rename this automatically, or have a default location it expects to find the information?
Please post if I seem unclear.
Much thanks,
Brownie
View Replies !
View Related
Load Images XML File
Hey
I want to load 50 random images from an XML file. I have 50 movieclips on my Stage. The instances are numbers from 1 to 50. So a movieclips instance name is "1" or "2". Now when i load these images i need to resize them (50%). The images load perfectly. but i cant adjust the width and height????
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("Scripts/Titles.xml");
slides_xml.ignoreWhite = true;
i = 1;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
StopImage = setInterval(Inladen,50);
}
}
function Inladen(){
Node = random(totalSlides);
NodeItem = rootNode.childNodes[Node];
imagePath = NodeItem.attributes.image;
//this[i]._width = 52,5;
//this[i]._height = 75;
loadMovie(imagePath,i);
i++;
if (i==51){
clearInterval(StopImage);
}
}
What to do??
thx
Diederik
View Replies !
View Related
Fastest Way To Load Images?
I am using Flash to create a slideshow of images. The way I have made it is very simple: If there are 20 images, I just put them in 20 sequential frames. Then, there are "next" and "previous" buttons which move the slideshow forward or backward by 1 frame. My question is this: What is the most efficiant way to laod these images? Should I just let the entire movie load when it is opened? Or should I somehow load each image individualy just before it is viewed? This will be part of a website I am making so it needs to run as fast and smoothly as possible.
Thanks for your help!
View Replies !
View Related
Load Images From Asp Database
Hi all
I am making a image viewer. in that i have a section of gallery i want all gallery thumbnails load from asp databse. if user select only five images out of 20 or more flash should load only selected five in that gallery. I am new in scripting and very new with serversite scripting and database connectivity.
your answer will be appriciated pl. send me some example source.
regards,
Bisht
View Replies !
View Related
The External Load Of Images
Hi, i'm kinda new... (thus the n00b fourm)
I recently upgraded from 5 to MX. I was wondering if MX is capable of loading images from am outside source or folder.
If someone could help and or point me in the way of a keen tutorial that would be splendid.
thx, erk
View Replies !
View Related
Load External Images
Hi everyone,
I want to load a number of JPEGs for later usage at the start of the movie through script.
For performance-reasons I don't want to put them on the stage by using loadMovie or attachMovie, etc. and making the movies invisible. I simply want them to be stored into some ActionScript-objects for later use without beeing displayed directly. (Compared to the Image-object in JavaScript)
Anyone an idea how to do this? All my attempts failed so far.
Thanx!
View Replies !
View Related
|