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








Preloading XML Content (images)


I'm having some trouble getting my preload function to work. Any ideas?

XML

Code:
<storyGroup>
<story id="1">
<storyTitle>Grafisk designer</storyTitle>
<image url="http://www.gustavjonsson.com/_temp/anette.png" />
<quote by="Anette Ringstad, Grafisk design">
<![CDATA[Lorem ipsum dolor sit amet liram diram norum.]]>
</quote>
</storyGroup>
Actionscript

Code:
function setupStory(storyXML, id) {
var storyMC:MovieClip = _root.storyPLC.attachMovie("story", "story"+id, _root.storyPLC.getNextHighestDepth());
storyMC._visible = false;
storyMC.stop();

// image
storyMC.image.loadMovie(storyXML.image.attributes.url);

// quote
storyMC.quote = storyXML.quote.getValue();
storyMC.quoteby = storyXML.quote.attributes.by;

// preload the ****
storyMC.preloaded = false;

storyMC.image.onEnterFrame = function(){
var todo:Number = this.getBytesTotal();
var done:Number = this.getBytesLoaded();

if(todo == done){
trace("Image PPRELOADED");
storyMC.preloaded = true;
_root.preloadText.easeTo("", "", 5, 100);
delete this.onEnterFrame;
} else {
if(todo){
trace("Image " + String(Math.round(100 / todo * done)) + "%");
}
}
}

return storyMC;

}




KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 03-05-2007, 04:36 AM


View Complete Forum Thread with Replies

Sponsored Links:

Preloading Content
I've created an animation that I originally split into 2 separate movies. I wanted to preload the second movie in order to get a smooth transition from the 1st to the 2nd.

I was referred to a tutorial on Actionscript.org. It did help, but it had more to do with creating a preloader progress bar.

Since the tutorial showed how to preload content from another scene, I combined my 2 movies into one, with 2 scenes.

It seems as if both scenes are loaded at the same time. How do I make just the 1st scene load and play, then cause the content from the 2nd scene to load near the end of the 1st scene and play when it ends? Thanks!

View Replies !    View Related
Preloading Content
hi.

i have this code on an empty movieclip that loads the external swf.


ActionScript Code:
onClipEvent (enterFrame) {    if (!loaded && this._url != _root._url) {        if (this.getBytesLoaded() == this.getBytesTotal()) {            loaded = true;            gotoAndStop(39);        }    }}


frame 38 has the empty movieclip hidden by another movieclip saying loading.
frame 39 is where the loading movieclip disapeers.

but its not working.


any help would be breat

thanks.

View Replies !    View Related
Preloading Content
Hi. Im having trouble a problem with my
flash movie. I didnt notice it was a problem
until I uploaded it to the web. Heres the problem:

I have dynamic text, .jpg's, and .swf's loading
into different parts of my movie. The file size of
them is fairly small, but I notice that they are
still taking a few seconds to show, so what
I want to do is make the movie pause until the
text, .jpg's, and swf's are fully loaded. I want to
have 'loading' text showing so the user knows that
the content is loading.

I found this tutorial on the site

'Preloader and Transition for Dynamic Files'

but I am a little confused by it. I cant relate it
to my project because I am trying load more
than just one object on a frame.
I also dont need any fancy transition that this
tutorial uses. Just plain and simple.
Can someone please help me. Thank you

Brown

View Replies !    View Related
Preloading Content
hi.

i have this code on an empty movieclip that loads the external swf.


ActionScript Code:
onClipEvent (enterFrame) {    if (!loaded && this._url != _root._url) {        if (this.getBytesLoaded() == this.getBytesTotal()) {            loaded = true;            gotoAndStop(39);        }    }}


frame 38 has the empty movieclip hidden by another movieclip saying loading.
frame 39 is where the loading movieclip disapeers.

but its not working.


any help would be breat

thanks.

View Replies !    View Related
Preloading Dynamic Content
Ok I have figured how to use the loadMovie() method to load jpgs into my flash animations and have figured out how to show the progress but the thing is sometimes it would seem that they have not preloaded correctly and they do not display. Does anyone know why this would be?

Here is a link to a page with the flash file
http://fast-cars.net/thecars/page/flash.php?id=79

View Replies !    View Related
Preloading Bar For A Dynamic Content
Flashers i need a preloading bar for a dynamic content like thus code below.


onClipEvent (load)
{
startVarLoad = false;
}

onClipEvent (enterFrame)
{
if (_root._totalframes > 1)
{
perc = _root.getBytesLoaded() / _root.getBytesTotal();
_root.bars = "";
var i = 0;
while (i < Math.ceil(perc * 20))
{
_root.bars = _root.bars + "|";
i++;
} // end while
if (perc < 0.300000)
{
_root.what = "LOADING ARTWORK";
}
else if (perc < 0.600000)
{
_root.what = "LOADING PICS";
}
else if (perc < 0.900000)
{
_root.what = "LOADING SOUNDS";
}
else if (perc < 1)
{
_root.what = "FINISHING...";
}
else if (_root.mcRays._xScale >= 75)
{
if (startVarLoad)
{
loadMovie("gallery/gallery.txt", _root);
startVarLoad = true;
}
else if (_root.loaded)
{
_root.gotoAndPlay(2);
} // end if
}
else if (startVarLoad)
{
loadMovie("gallery/gallery.txt", _root);
startVarLoad = true;
} // end if
_root.what = "";
_root.bars = "";
} // end if
}

View Replies !    View Related
Preloading Cerain Content Only
Hi everyone, I'm sure this is a simple question for you all...

I'm designing a Flash site for a photographer so I only want the basic navigation and interface elements of the site to load up initially. I then want to be able to preload each photograph individually as it is selected.

I'm quite new to actionscripting but I'm familiar with making advanced preloaders... What I can't figure out is the code required to only load up certain elements of the movie thereby preventing a very long initial download time.

Thanks in advance for your help!

View Replies !    View Related
Preloading Dynamic Content-is It Possible?
Hey all;

Wondering about preloading dynamic content and how possible it is. I read thru the preloader sticky at the top of the page, but didn't see much in the way of dynamic content control.

What I'm wondering is if I'm loading jpgs and text on the fly via xml data, is it possible to have a preloader that will wait until all the jpgs and text have loaded?

The preloader I'm using now, only seems to preload content that is in the swf when it is called.

I have a 5 frame MC with the xml load on frame one along with the preloader:

Code:
onClipEvent (enterFrame){
bytesLoaded = Math.ceil((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100);
gotoAndStop (bytesLoaded);
if (bytesLoaded >= 100){
_parent.gotoAndPlay("start");
}
}
Frame 5 is the "start" frame, and contains the content, and the AS that creates the dynamic mcs that hold the files called by the xml file.

Any help in setting up a preloader for this is appreciated. Thanks.

View Replies !    View Related
Preloading External Content.
I'd like to preload an external .swf
I'm using Flash MX 2004.

Here's a bit more organic description of what's going on...

Hello, I'm currently working on creating a PreLoader in Flash MX 2004.
I've actually done a fair job of creating it, but I seek council.

Due to the design and the complexity of the site, the preloader will be a seperate .swf from the main website .swf

Can anyone advise me on a way to get my preloader.swf to pre-load the external website.swf?

thanks a bunch!

View Replies !    View Related
Preloading Dynamic Content
Hi!

Just wanted to know if it's possible to put a preloader on textfield/movieclip reading text from a textfile...

I guess it's not the same as preloading a regular movieclip, text being dynamic and all...

View Replies !    View Related
Preloading Dynamic Content
Hey all,

I'm loading a dynamic swf and inside this dynamic swf are images and text that are also loaded dynamically. My problem is the swf is being preloaded but without preloading the dynamic images and text. My question is, how do a I preload the images and text before or during the initial preload of the swf?

View Replies !    View Related
Preloading External Content
hello, i have two questions, but i think the answer is the similar for both:

i am trying to get external content to preload before an action is triggered. i am calling in an external .jpg into a movie clip. the timeline is stopped, but i want it to play after the jpg is loaded into the clip. the code as i have it now will start playing before the picture is loaded. is there some command for this?

also is there a way to start loading content into memory before it is triggered. i have a movie with about 10 sequences of images. the user triggers these sequences with buttons, resulting in each sequence loading only when clicked. i want to start loading these external swf files into memory so that but the time the user clicks on the button with the loadMovie() command, the swf is already loaded in memory. thanks, and help would be greatly appreciate.

here is the code from the picture loader:

code:
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.round(Math.random()*(max-min))+min;
return randomNum;
}
_root.imageToLoad = randRange(1, 5);
startMovie = function () {
play();
imageHolder.loadMovie(_root.imageToLoad+".jpg");
};
stop();
picture.onLoad = startMovie();

View Replies !    View Related
Preloading Dynamic Content
Ok the thread title is a bit confusing, so i'lll clarify.. :P

I have a main page, with buttons, when people press on a button, it sets variables to be used in an external movie (loader.swf) that will then use those variables to display the correct content, which is a picture gallery.

my button AS looks like this:


Code:
on (press){
_root.title="testing"
_root.desc="desc"
_root.url1="images/1.jpg"
_root.url2="images/2.jpg"
}

on (release){
loadMovieNum("loader.swf",1);
}
Those variables are then used in Loader to load the content. The hic here is that i want to be able to preload the content that will be displayed (the images), how can I do that? The traditional preloading method won't work since the images won't be in the movie yet when the preload begins.

any help or guidance would be greatly appreciated.

thank you

View Replies !    View Related
Preloading Future Content
I'm updating a flash movie that I didn't create, it's built with scenes and totally ass backwards. I'm redoing it so each scene is a seperate swf that is loaded into the "player". The only problem is (and the only good thing about the way it's built now) that because of the streaming nature of Flash the other scenes are being loaded in the background while scene 1 is playing so you don't see any preloading happening in the movie the way it's built now.

So my question is, is it possible to tell Flash to load a swf before you want it to start displaying? In essence I want it to preload scene1, then while that scene is playing start loading scene2, and so on.

View Replies !    View Related
Preloading XML Or PHP Content (Using Streams?)
I've been following the GoToAndLearn tutorials for importing PHP files as XML files aswell as for the advanced Flash preloader. But I hit a problem when I combine the two


Even after I've done as explained to set the component data to load in frame two, it still does not preload the data I'm importing from the PHP file.
It completes the preloading then will hang for ten or 15 seconds while it imports the PHP data.

Whenever I check this out by simulating a download in the "test movie" it shows that when it gets to frame 3 where it is meant to download this, there is a new field available relating to the file called streams which shows how much of the stream relating to my php file is downloaded.

How would I go about incorporating the data from this streams field into my preloader?

View Replies !    View Related
Preloading XML Or PHP Content (Using Streams?)
I've been following the GoToAndLearn tutorials for importing PHP files as XML files aswell as for the advanced Flash preloader. But I hit a problem when I combine the two


After I've done as explained to set the component data to load in frame two, it still does not preload the data I'm importing from the PHP file.
It completes the preloading then will hang for ten or 15 seconds while it imports the PHP data.

Whenever I check this out by simulating a download in the "test movie" it shows that when it gets to frame 3 where it is meant to download this, there is a new field available relating to the file called streams which shows how much of the stream relating to my php file is downloaded.

How would I go about incorporating the data from this streams field into my preloader?

View Replies !    View Related
Preloading Dynamic Content
This is a bit of a tough one i have found out recently. I did a popular flash tutorial and created a carousel that has an xml file with it that displays images and text etc..

now the problem i am having is adding a preloader to the thing.... i hvae tried and tried and tried and was told that a preloader cannot be added to dynamic content...

i have attached the file. please please please help.

thanks and i hope you have better luck that i have!

View Replies !    View Related
Preloading Dynamic Content
Hi!

Just wanted to know if it's possible to put a preloader on textfield/movieclip reading text from a textfile...

I guess it's not the same as preloading a regular movieclip, text being dynamic and all...

View Replies !    View Related
Preloading Dynamic Content
Hi!

Just wanted to know if it's possible to put a preloader on textfield/movieclip reading text from a textfile...

I guess it's not the same as preloading a regular movieclip, text being dynamic and all...

View Replies !    View Related
Trouble With Preloading Xml Content
hej peeps,

after working my way through some tutorials and searching on the forum,
i still have a question concerning preloading some xml content.

i'm trying to copy a movieclip called "containerMC" based on the data in my xml file.
the "containerMC" contains a movieclip (instance name "image") in which i load a picture using this script.
the script is placed on frame1 of the mainstage.


PHP Code:



myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success) {
mainNode = this.firstChild;
if (success) {
for (i=0; i<mainNode.childNodes.length; i++) {
theClip=_root.attachMovie"containerMC", "containerMC"+i, i);
theClip._x = theClip._y = 0;
theClip._y += 350*i;
theClip.image.loadMovie(mainNode.childNodes[i].childNodes[0].firstChild.nodeValue);
theClip.textClip.textContainer.text = mainNode.childNodes[i].childNodes[1].firstChild.nodeValue;
            
};
};
};

myXML.load("images1.xml"); 




this works just fine .. but i want every image to be preloaded seperately
(i hope this makes sense).

i figured that i have to create a preloader movieclip inside the "containerMC"
only i'm at a loss where i put the code for my preloader ... and which code to use.


i hope someone can help me out or point me in the right direction,

thnx in advance,

odin

View Replies !    View Related
Preloading External Swf Containing Xml Content
Hey There,

I'm having a problem preloading xml loaded content. I'm using the usual this.getbytesloaded at the start of my timeline. The problem is this is getting the total bytes for the container swf before the xml has loaded up all the images and content so my preloader is running short.

Any help would be greatly appreciated

View Replies !    View Related
Preloading ScrollPane Content
how do you preload the main timeline when it has UILoader's, ScrollPane's, or other components on it that need to be preloaded themselves?
I need some advice!

View Replies !    View Related
Preloading Dynamic Content?
Hi everyone

I was wondering if it was possible to PRELOAD dynamic images into a movie. The images have to be ready by the time the movie has loaded, but they MUST also be dynamic.

Any ideas?


=VALOR=

View Replies !    View Related
Preloading Dynamic Content
Hi!

Just wanted to know if it's possible to put a preloader on textfield/movieclip reading text from a textfile...

I guess it's not the same as preloading a regular movieclip, text being dynamic and all...

View Replies !    View Related
Preloading XML Content (thumbnails)
Hi everyone,

It is my first time posting here and I have a question.

I usually find the answer myself but I have searched and found nothing so maybe some of you guys can help me.

I have an XML document with links to thumbnails and bigger picture (basic gallery), I have setup my flash file in a way that every thumbnail becomes a button which loads the bigger picture in a loader MC using loadClip and listeners. All that is fine.

Here is a link to it(the swf is suppose to be inside another flash so thats why its full size, i didnt make an HTML page for it)

Take a good look a t what it is doing because its a loading issue and probably wont happen again if its in your browser's cache
http://www.ferragiacomo.com/collections/wc2007spring/wc2007spring.swf

The problem: Basically I want to make a loading for all the thumbnails, now its doing the action for everyone of them.

Here is the code of my AS for the XML:

Code:

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
   numimages = this.firstChild.childNodes.length;
   spacing = 0;
   for (i=0; i<numimages; i++) {
      this.picHolder = this.firstChild.childNodes[i];
      this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
      this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
      xmlLoader.loadClip(this.picHolder.attributes.thmb,this.thumbLoader);
      xmlListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
         
         xmlBar.xmlBarLoader._width = Math.round(bytesLoaded/bytesTotal*200);
      }
      xmlListener.onLoadComplete = function(){
         xmlMask.play()
         xmlBar.play()
      }
      this.thumbHolder.description = this.picHolder.attributes.description;
      this.thumbHolder.main = this.picHolder.attributes.main;
      this.thumbHolder.h = this.picHolder.attributes.h;
      this.wt = this.picHolder.attributes.wt;
      this.thumbHolder._x = spacing;
      spacing += Number(this.wt)+15
      this.thumbHolder.onRelease = function() {
         mcLoader.loadClip(this.main,loader);
         listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
            loadBar._visible = true;
            loadBar.barLoader._width = Math.round(bytesLoaded/bytesTotal*200);
         }
         listener.onLoadComplete = function(){
            loadBar._visible=false;
         }
         loader._y = 72 + (395 - this.h);
         description.text = "Model : " + this.description;
      };
   };
}

myPhoto.load("xmlphoto.xml");

as you can see I'm using loadClip and listeners aswell for the thumbnail part but I trying to figure out how to do this so maybe using loadClip ising the best way or maybe I am not listening to the right MC.

Thank you for any help

View Replies !    View Related
Preloading XML Or PHP Content (Using Streams?)
I've been following the GoToAndLearn tutorials for importing PHP files as XML files aswell as for the advanced Flash preloader. But I hit a problem when I combine the two


After I've done as explained to set the component data to load in frame two, it still does not preload the data I'm importing from the PHP file.
It completes the preloading then will hang for ten or 15 seconds while it imports the PHP data.

Whenever I check this out by simulating a download in the "test movie" it shows that when it gets to frame 3 where it is meant to download this, there is a new field available relating to the file called streams which shows how much of the stream relating to my php file is downloaded.

How would I go about incorporating the data from this streams field into my preloader?

View Replies !    View Related
Preloading Content Of Window UI Component
Hi all,

Im having trouble in preloading the content of each of my window component.

I have three different window UI component, and each of these have its corresponding movie clip which were use with a linkage for exporting this in ActionScript (for the purpose of dynamically loading).

Here's what I have done:

Window UI components
window1
window2
window3

movie clip which has linkage property
mc1
mc2
mc3

On my main timeline, I have different layers for the different window UI component (in frame one) since at frame one the three window UI component is visible, I put on the three contentPath for each of the window UI component. By the way I use the property window do to this and not encoding this in the frame itself.

So my question now is where should I put my preloader? Can I put a preloader on each of the three linkage movie clips? Or should I put the preloader on my main timeline? Do it matter to preload early since I use the contentPath property and not hard coding it inside the frame?

What would be the recommendation solution for this?

Thanks for your help.

Regards,

AmCasperForU

View Replies !    View Related
Preloading External Content Loaded Through Xml
I want to preload an external swf which loads a large image through xml. I can do this successfully when the image is already contained within the external swf but because its loaded via xml the preloader doesn't return the correct amount of bytesTotal.

Any tutorials around for this any suggestions?

View Replies !    View Related
Preloading Content Of Window UI Component
Hi all,

Im having trouble in preloading the content of each of my window component.

I have three different window UI component, and each of these have its corresponding movie clip which were use with a linkage for exporting this in ActionScript (for the purpose of dynamically loading).

Here's what I have done:

Window UI components
window1
window2
window3

movie clip which has linkage property
mc1
mc2
mc3

On my main timeline, I have different layers for the different window UI component (in frame one) since at frame one the three window UI component is visible, I put on the three contentPath for each of the window UI component. By the way I use the property window do to this and not encoding this in the frame itself.

So my question now is where should I put my preloader? Can I put a preloader on each of the three linkage movie clips? Or should I put the preloader on my main timeline? Do it matter to preload early since I use the contentPath property and not hard coding it inside the frame?

What would be the recommendation solution for this?

Thanks for your help.

Regards,

AmCasperForU

View Replies !    View Related
Preloading Loadmovie Content Into Respective Frames...
Hi Everybody,

Once again I'm wondering if I can ask for everyones help and precious time. I'm working with a multi frame(at the moment 2 but soon to be more) movie, that has to take all of its data from xml. I can import the xml, but I'm trying to figure out how I can get the images loaded prior to getting to their frames. When I try to do a loadMovie to incorporate them onto their movie clips, it just isn't happening.

Any tips on how I can set something like this up?

Regards,

Plasnid

<as>stop();
offFrame = new XML();
offFrame.ignoreWhite = true;
offFrame.load("fram.xml");
offFrame.onLoad = function() {
_root.firstPic = offFrame.childNodes[0].childNodes[0].attributes.image;
_root.secondPic = offFrame.childNodes[0].childNodes[1].attributes.image;
_root.secondPic = offFrame.childNodes[0].childNodes[2].attributes.image;
loadMovie(_root.firstPic, _root.hld1);
loadMovie(_root.secondPic, _root.hld2);
loadMovie(_root.thirdPic, _root.hld3);
};</as>

View Replies !    View Related
Preloading Images?
I have a number of buttons that on mouse over an image is loaded.

On my machine it is like s#^t off a shovel but when its on the web you have to keep the mouse hovering for a good couple of seconds.

In Javascript you can preload images, can you do it in flash and how?

View Replies !    View Related
Preloading Images?
I have a Flash movie that comprises 13 images saved in .jpg files. What I want to do is create a preloader that preloads all these images, including the Flash movie. I was able to preload the movie, but not the images. What do I have to do in order to preload everything (including the images)?

View Replies !    View Related
Preloading Images
I have been trying to get an answer on this subject for some time now. People have posted things like links to other posts about this topic or msg me and I'll help ya out. I have tried to be patient and get some help on this subject.

I have searched and read and read and searched, nothing I saw helped me, most of it just scared me. I dont wanna have to be scripting a lot. Here is my problem i have a lot of thumbnails and a lot of pictures and i want to make preloaders for them cuz they are all externally linked. So what i would like to do is make a preloader that i can just somehow apply to all of them. I dont wanna have to make 60 different preloaders for my 60 images. If this is possible or of you have any suggestions besides links to other posts, I would be very appreciative. I am a n00b and I'm gonna need this explained in n00b terms. Thanks everyone for bearing with me.

View Replies !    View Related
Preloading Images
I've been searching online for tutorials and scripts and yes i found some ... but its confusing ... so if anyone is nice enough to tell me how to jus simply preload an image with a percentage. That would make my day...

thnx

View Replies !    View Related
Preloading Images/mc-s
hi, i would like to load several images at the same time in my movie, with preloaders to each one.

is there a way to do this without external swf-s? I'd like the whole process to go inside the movie clip, so the main timeframe would not be 'touched'.

i guess the loadmovie function should be used, but don't know how, and how the movie clips get the preloader for themselves.

you can see what i'd like to achieve if you visit http://www.heavytools.info/english.html

(Products menu.. each t-shirt has a preloader.)

thx for any help

View Replies !    View Related
Preloading Images
Hey
i can preload normal graphics and things in flash but my problem this time is different. I want to preload images before they are displayed on a html page. Is there anyway to have a flash loading screen and preload the images so they are all ready as soon as the html page loads? Is flash the best way to do this? are there any alternative methods or is it even possible?
Thanks for your help

View Replies !    View Related
Preloading JPG Images
How do you preload JPG images?

I have some thumbnails that are loaded externally. Is there anyway I can preload them so they just dont pop up randomly after they load individually when I call on them?

Also, how do you create a preloader for a JPG in general?
If I have the script container.loadMovie("bla.jpg"); or watever is there anyway to put a preloader so once again it just doesnt pop up when its done loading. Right now I am calling on some external JPG files and I have it scripted so they fade in. Only problem is they just pop up first time around, but after you load it once it fades fine. That is why I want to preload the images so hopefully the fading problem will be fixed.

Thanks to you who help.

View Replies !    View Related
Preloading Images
Ok I have read a bunch of the forums and got realy confused Im new to this action script thing but im trying.

So with that said I need to be able to preload images. I can load them fine but preloading (with a visual representaion eg progresion bar) is tuff. I have 12 images but may have more that need to load at the same time. Can you guys help ?

to see what I have got go here http://www.shmooze.ca/newnight/test2.htm

Is there a fla out there or a EASY to follow tutorial ?

Any help would be great.

View Replies !    View Related
Help Preloading Images
Hi. I'm very new to Flash. I'm designing a very large photography site with over two hundred images and corresponding thumbnails. That being said, you can probably guess why I might be running into problems as far as file sizes go.

Here's what I want to do:

When the user enters the site, I would like the entire movie to load. I would like to keep the photos, however, from loading until the user requests them by clicking on the corresponding thumbnail. Then, it will say, "loading, please wait" where the image will show up. After the image loads, probably a few seconds, it will appear.

I can't seem to find a tutorial that has exactly what I need. If anybody can direct me to one, that would be extremely helpful.

Also, if anyone has any better ideas on how I can solve this problem, it would be much appreciated.

Thanks for taking the time to read this, and thanks for any helpful advice that you may have!

View Replies !    View Related
[F8] Preloading Images From Xml
I am trying to make a flay program that will automaticly create gif like animation for you, you simply specify the list of consecutive pictures you like in an xml file and it loads them using loadMovie at a certain rate determined by a setInterval. This all works except i get a flash of a white screen between each picture because it is loading the image again. Is there any way i can preload all of these pics into the flash doc?

View Replies !    View Related
Preloading Images From XML
Hi All.

I been creating an XML SlideShow and works all ok. However, I wanted to preload the images before playing the slideshow to avoid jump offs (currently having). I found some scripts but only for AS2 - tried loading the AS2 and works ok (all preloaded) BUT, the XML should be a variable. I tried almost everything - flashVars (conflicts/do not work), swfBridge (no good), localConnections (no luck).

The only solution I wish for now is if its possible to do it in AS2 preloading images, I think somebody already had this solution before.

I a bit new to AS3 so I hope someone has already encountered this issue and found a good solution.

Kind regards
frg10

View Replies !    View Related
Preloading All XML Images
Hi all,

I have an xml photogallery. I am trying to find some help preloading all of the images before any of them appear. Does anyone have any idea how to do this?

View Replies !    View Related
Preloading Of Several Images.
I am working on a flash with actionscript 3.0 that connects with mysql database.
I have a php file that generates jpg images based on an ID, and want to preload these images into flash.

The url; pages/showImage.php?id=X , generates an image out of the id X.

The following code is what I've made working, but doesnt preload, but load the image and draws it sequencialy:

Code:
function drawCard( cardID:int, posX:int, posY:int ):void
{
var url:String = "pages/showCard.php?id=" + cardID;
var request:URLRequest = new URLRequest( url );

loader.load( request );
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, drawIt );
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}

function drawIt( evt:Event ):void
{
var myBitmap:BitmapData = new BitmapData( loader.width, loader.height, false );
var mySprite:Sprite = new Sprite();

myBitmap.draw( loader, new Matrix() );

var matrix:Matrix = new Matrix();
matrix.translate( 50, 50 );

mySprite.graphics.beginBitmapFill( myBitmap, matrix, true );
mySprite.graphics.drawRect(50, 50, loader.width, loader.height);
mySprite.graphics.endFill();

addChild(mySprite);
}

function ioErrorHandler( event:IOErrorEvent ):void
{
trace("Unable to load an image.");
}

var loader:Loader = new Loader();
drawCard( 3, 50, 50 );



And I've tried making the preloading work, and it worked a bit at one moment, but now it doesnt even show an image, and I dont know what I did to break it.
Though at the point where it worked, it only showed the last image loaded when trying to call drawCard. I am guessing this was probably because I didnt save the Loaders, which I tried fixing, but as a result nothing works anymore, and I'm not getting any image drawn;

Code:
var CARDS:Array = new Array();
var LOADERS:Array = new Array();

var i:int=1;
while( i < 7 )
{
var url:String = "pages/showCard.php?card_id=2";// + i;
var request:URLRequest = new URLRequest( url );

var loader:Loader = new Loader();
//LOADERS.push( loader );

loader.load( request );
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, function( evt:Event ):void
{
//Store bitmaps
var bitmap:BitmapData = new BitmapData( loader.width, loader.height, false );
bitmap.draw( loader, new Matrix() );

CARDS.push( bitmap );
}
);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

i++;
}

function ioErrorHandler( event:IOErrorEvent ):void
{
trace("Unable to load an image.");
}

function drawCard( cardID:int, posX:int, posY:int ):void
{
var myBitmap:BitmapData = CARDS[cardID];
var mySprite:Sprite = new Sprite();

var matrix:Matrix = new Matrix();
matrix.translate( posX, posY );

mySprite.graphics.beginBitmapFill( myBitmap, matrix, true );
mySprite.graphics.drawRect( posX, posY, myBitmap.width, myBitmap.height );
mySprite.graphics.endFill();

addChild( mySprite );
}

drawCard( 2, 50,50 );

View Replies !    View Related
Preloading Images
hi all,

how do i assign something to my onRelease to make sure the image is preloaded before it proceeds to call the loadMovieNum function? Thanks in advance!

View Replies !    View Related
Preloading Images
Hello all,

im trying to preload all images/swfs in the preloader before going to frame 3. there is a "gotoAndPlay(1)" on frame 2. below is the code in frame 1. and there is a MC called "preload" outside of the canvas.

how come its not working? thanks in advance!! its driving me nuts!


Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*620;
this.loadText = Math.round(getPercent*620)+"%";

preload.loadMovie("default.swf"); // my files to be preloaded

if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

View Replies !    View Related
Preloading Images
Ok. i've got a web were some images are loaded randomly,
every 5 seconds a new image is loaded and goes from blur to clear image.

But I've got a problem. The first time someone opens my web, I can't see the progress when they are supposed to go from blur to clear instead of that they appear suddenly. I think it's because the first time they must be loaded.

Once a image has apperared the second time the image is choosed randomly I can see the progress

I'd like to preload the images.

is a good idea?

how can I do it.?

View Replies !    View Related
Preloading Images
Hi,

For my new games I want to have a preloader that shows a progress bar. I've been looking at a few preloaders. All require you to drag your images from the library onto the scene in frame 5 (or whatever frame) so that Flash knows that it should load the images. My question: Is there a way to tell Flash to load the images without putting them on the scene, such as calling a command that uses them?

Thanks

View Replies !    View Related
Preloading Images
hey all was wonderin if someone could gimme a hand.

I made an image gallery where you frag the thumbnail into the image viewing area where it then enlarges to fill the area and you drag a new one into the area and the old images thumbnail returns back to its spot and the new thumbnails larger version replaces the old one.

All of that is working fine, but i want to add a preloader for each of the images because sometimes when its online it seems it takes a second to load the larger image which can reduce usability for viewers, especially those with slower internet connections. Could someone suggest some code to preload each of the images, so when they are dragged in a progress bar will show while they are loading if it is going slow, so users do not think it is broken if it does not show up instantly?

Thanks

View Replies !    View Related
Preloading Images...Once And For All
Hi,

I seem to be having a lot of problems with preloading images. I want external jpgs to load offstage and then use them as I need them.
I have built a preloader, but it seems to not work.

Can someone point me to a tutorial about a) loading images or clips offstage for later use and b) a preloader

Another question: how does a preloader work when the empty movie clip that eventually will hold all of the external jpgs does not have an accurate bytes_total number?

View Replies !    View Related
Preloading All Images From Xml
Well, i've been at this for quite a while now.
I made a small photoalbum and i want all the images to be preloaded before the movie begins. I've been struggling with this for almost 2days.
The images load from an xml. How can I preload all the images and then start the movie?

Thanks a lot.

This is the code for the xml:








Attach Code

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].firstChild.firstChild;
}

holder_mc.loadMovie('img/'+image[0])
holder2_mc.loadMovie('img/'+image[1]);
holder3_mc.loadMovie('img/'+image[2]);
holder4_mc.loadMovie('img/'+image[3]);
}
}

View Replies !    View Related
Preloading Images
Hi,

I am making students photo id card for a School. Suppose in the given space I can display 4 students card in a proper format, of which they will take a print out and can use it.

Lets say there are total 50 students then there will be pagination (50/4=13 pages)
with next and back button for navigation. I am reading all the data from XML File.

Now my question is can it be possible for me load all the 50 images somewhere in backgorund (or MC) at the begining only so that while navigating pages images in that particular page (photo of a student) shouldnt take time to load.

I hope I have clarified my problem. Can someone give me some input on this.

It will be really appreciated. Thanks in advance ;-)

-----------
aShIsH

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved