Preloading Dynamic Jpg
hi everyone,I have a dynamic jpeg that is being loaded into an empty holder movieClip that is on the stage... i had been using an onEnterFrame to try to see when that jpeg has been loaded in, but there was still a delay before it showed up...anyway, im trying to get it to work now using MovieClipLoader, and using the following code: Code: stop();var pic_mc = new MovieClipLoader();var preload = new Object();pic_mc.addListener(preload);preload.onLoadStart = function(targetMC) { _root.txt.text="started loading";};preload.onLoadProgress = function(targetMC, lBytes, tBytes) { _root.txt.text="% "+Math.round((lBytes/tBytes)*100);};preload.onLoadComplete = function(targetMC) { _root.gotoAndStop(10); // once it is loaded jump ahead to a frame with the 'cover' over the imageMC removed};if (_root.spec=="L"){ pic_mc.loadClip(_root.path, "_root.fCardMC.holder_mc");}else if (_root.spec=="P"){ pic_mc.loadClip(" " + _root.path, _root.fCardMC.holder_mc1);} it just sits on the frame with the cover over the image... so something is obviously wrong with it.any thoughts?let me know if anything needs further clarification (i realize that might have been confusing)
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 07-12-2007, 10:59 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
PRELOADING (dynamic Preloading?)
dear all
i hope someone could give me tips how to do this:
i have one main scene and 7 navigation-points. each of the 7 scenes are external movies which should be loaded.
but can they load in the background too, even if the user didnt select a point yet? and when he does, the progress bar would automaticly fill up as much as the movie is loaded already. and it should continue loading all the scenes in the background, while he is in one section.
i hope you know what i mean, excuse my english.
looking forward for a help asap. thanks a lot in advance!
Preloading Dynamic Jpg's?
hi
is it possible with the code:
loadMovie ("photo.jpg");
to preload the dynamically loaded jpg?
anyone know of any documentation about this...i thought i saw it somewhere said it can be done, but i cant find it now.
thanks~
slimpixi
Preloading Dynamic XML
I'm writing an application that parses an xml file that is generated at runtime from a php script loading it like this (since loadvars has never worked for me):
Code:
myXml.load("http://mydomain.com/phppage.xml.php?var="varFromFlash);
This is working fine but I want to make a preloader that tracks the process of the xml being generated, Does anyone know how to do this? Currently I'm doing it this way:
Code:
myButton.onRelease = function (){
myXml.load("http://mydomain.com/phppage.xml.php?var="varFromFlash);
loadMovieClipThatSaysLoadingOnStage();
}
////
myXml.onLoad = function(){
if (success) {
takeMovieClipThatSaysLoadingOffStage();
}
else {
throw error;
}
}
lol, it's silly. Can anyone help me do something better than this???
-thanks!
Dynamic Preloading
Hi all,
I'm trying to dynamically preload images - without success
The Scenario:
I'm passing a string to the swf from the web site - image path
i want the preloader get the TotalByts of the image, preload it and disply it
is it possible?
thanks!
Preloading Dynamic JPG
Hi guys,
I got a question what's been bugging me for weeks now.
We have a group of Flash intro's. Now my boss said that the content must be dynamic, meaning our clients can just upload thier pictures and set thier texts in our database, then the flash intro will show them accordingly.
My question is how can we preload jpgs? I can generate a list of them and can know how many there are. but i really dont know how to preload them.
Any ideas? even a link to a tutorial on preloading jpgs would help.
waiting for you responses. Thanks
biggie.
The Man of Tomorrow is forged by his battles today.
Dynamic Jpg Preloading
i have built a nice image gallery in flash. it builds a list of thumbnails and when you click a thumb..it tells a draggable window to goto a frame where it then loads in the full size image
problem is the preloading.
here is what i use to load the jpg:
MovieClip.prototype.loadFullSize = function(jpeg) {
_root.mc_fullSizeContainer.swapDepths(800);
this.newholder._x = 0;
this.newholder._y = 0;
loadMovie(jpeg, mc_imageContainer);
mc_fullSizeLoader.gotoAndPlay(2);
}
then..on that same timeline in a movieclip i have the loader called mc_fullSizeLoader
frame 1 is blank.
frame2 has this:
loaded = Math.round(_parent.mc_imageContainer.getBytesLoaded());
total = Math.round(_parent.mc_imageContainer.getBytesTotal());
percent = Math.round(loaded / total * 100);
loadBar._width = loadBarHousing._width * (percent / 100);
percentOutput.text = percent + " %";
frame 3:
if (percent == 100){
gotoAndPlay(4);
} else {
gotoAndPlay(2);
}
and at the end is gotoAndStop(1); .. to hide the loader because the jpg has been loaded.
tested this online and the preloading never happens. what am i doing wrong here?
HELP!! i would really appreciate it as i am very stuck on this one.
ive done this before and it worked fine..i ripped the code from that file. in that file..the image was loaded to root..and preloaded from there..cant do that here because it has to be inside the draggable window (movieclip)
thanks again in advance
Dynamic Preloading
Problem for preloading external jpg
//
Please help
//
this.initMe = function() {
this.createEmptyMovieClip("holder", 1);
this.holder.loadMovie(path+".jpg");
this.holder.createEmptyMovieClip("bar", 2);
this.holder.bar.lineStyle(0, "0xffffff", 100);
this.holder.bar.lineTo(100, 100);
this.onEnterFrame = function() {
percent =
Math.floor((this.holder.getBytesLoaded()/this.holder.getBytesTotal())*100);
percentField.text = percent;
this.holder.bar._xscale = percent;
this.holder.bar._yscale = percent;
if (percent == 100) {
main.grid["photo"+(this.id+1)].initMe();
delete this.onEnterFrame;
}
};
};
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
Dynamic Loading, Preloading
how can i make the text in the movie load in the begining with the pre-loader, and then the text will automatically be there when you come to that scene, also, i want to do the same with photos, and how do you dynamically load images
thanks
Preloading Dynamic JPEGs
Ive seen a few posts on this, but i can't figure out how to get them to work. my site is http://www.remps.com/bumpinmotorsports.
the demo cars. If anyone has any suggestions for my specific need any help would be appreciated
Preloading The Dynamic Images.
I m loading the images dynamically using flash mx. Is there any way that i can preload those images.
Also want to know how can I preload multiple swfs.
cheers
Rits
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
}
Preloading Dynamic Jpegs And Swf's
I have been searching thru posts and tutorials for this, but i cant seem to get the answer. I am loading jpegs into an empty container movie clip. I need some type of preloading situation for them. They are all about 20 kb, so i dont neccessarily need a percentage preloader, but something to show they are loading. I was tinkering with checking the width of the container movie clip, but i couldnt get that to work properly. Does anyone have any suggestions?
-Thanx
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.
Preloading Dynamic Text?
Hi,
Just wondering if it is possible to do a preloader for a text loaded in from an external text file? Is it worth it or does the text come in so quickly that there is no point?
I am putting the text in a scrolling text field. I have seen preloaders for these before but are they just swfs being loaded and the preloader preloading the swf or is the preloader actually working for the external text file?
I have the tute for the dynamic scrolling text thingy...
http://www.flashkit.com/tutorials/In...-640/index.php
... but I'm not sure about the preloader bit. It isn't the same as preloading a swf or jpg is it?
Thanks.
Preloading Dynamic JPGs
Hi,
I have a project with a bunch of JPGs loading dynamically into movies into separate SWFs in different levels for section graphics. It performs poorly over 56k, so I was thinking of having it preload all of the graphics into one level. I was thinking I could load each JPG into its own movieclip and have the alpha be set to zero until it is needed. What would be the best way to do the preloader ? Would I need to create a variable
totalBytes = getBytesTotal(clipone)+getBytesTotal(cliptwo).....
and compare that against something like loadedBytes ?
loadedBytesTotal = getBytesLoaded(clipone)+getBytes .....
If anyone knows of anything out there that already does a preload of dynamic images, a reference would be much appreciated.
TIA
colin
Preloading Dynamic Images
im doing my best to keep the site im working on dynamic. i have sections of content that have thumbnails that are loading dynamically based on the rollover code. they aren't that big in terms of file size but there is a little delay while they load. given that these images are 8 or 12 k each, could i just preload them somewhere and if that is a smart thing to do how would i do it?
Preloading Dynamic Text
Hi,
Is there anyway of preloading dynamic text? I have three text fields, but there is a delay in the text showing as it loads it. Do I put the actionscript earlier for example? Any suggestions?
Thanks
Ad
Preloading Dynamic Image
Im having problems with getting a prleoader for my images to work.
I have an empty clip on stage named imageMC.
I use
onRelease {imageMC.loadMovie("pic1.jpg");
}
Works fine. But some of the pics are about 200k in size. And while the image is loading the viewer just sees a blank screen.
I have my preloader code that I use that I got from a tut here on FK. But I dont know what to change and where to put the loader to preload the image.
Ive tried putting the preloder in the first frame of the MC "imageMC", but the the whole movie goes to wack.
Here is the code for my preloader
onClipEvent (load) {
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
quickPlay = true;
} else {
preLoad = (_parent.getBytesTotal() * 0.75);
}
_parent.stop();
}
onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) {
if (_currentframe == _totalframes) {
_parent.play();
}
} else {
if (_parent.getBytesLoaded() >= preLoad) {
_parent.play();
}
}
}
Any help would grealty be apprieciated as this is the last part of the site that I need to complete.
Thanks
Josh
Preloading Dynamic Jpegs
I haven't been able to find any method of preloading a dynamic image, as it doesn't start loading the image until after the preloader runs anyway. ifFrameLoaded seems to be my only option, which also doesn't work yet, and is depricated anyway.
Any suggestions or links?
Preloading Dynamic Site.
im createing a website for my band. the website dynamically loads mp3s, jpegs, html with style sheets and embeded images, and variables from php files. i understand making a simple preloader to load swf's or mp3's or jpegs but how can i preload the html, and variables from the php files? any ideas on a super dynamic preloader?
check it out so far...
www.thesunband.com/pre-test/v1/
sometimes the dynamic html text for the new, live, music sections messes up because the jpeg the html calls isnt preloaded.
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...
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?
Preloading Dynamic Image.
Hey. I have a movie that loads dynamic image on frame 10. I am preloading all the data on frame 1 using a regular preloader that goto frame 10 when the loading is done, but its dosent load the external image coz its not inside the movie. dose anyone have any idea?
Preloading X Dynamic Instances
Hi,
I was avoiding to post this message, but I already really tried everything I can...
I need to preload several pictures from a folder (say 20).
Then, I am instantiating anyone of them in empties movieclips, this way:
PHP Code:
_root.TotPics = dataReceiver.totpics;
for (z=1;z < parseInt(_root.TotPics)+1;z++)
{
aPictures[z] = this["pic"+z];
_root.attachMovie ("mcImage","mcImage"+z,z+20);
_root["mcImage"+z].loadMovie ("pics/"+aPictures[z]+".jpg","Picture");
}
PS: mcImage is an empty mc.
That's ok, it's working.
The problem is that, later I need to get one of these pics (say the one that is in the mcImage1), and instantiate it within another mc called Slice0 usin attachMovie. Do not works...
Look what I tried:
PHP Code:
_root.attachMovie ("mcSlice0","mcSlice0",1);
_root.mcSlice0.attachMovie ("mcImage1","mcImage1",50);
PS: mcSlice0 is an empty mc.
The point is: why preload images into movieclips if you cannot attach them later?
In short: I need to dynamically instantiate a mc WITHIN another mc.
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
Preloading Dynamic Images.. Serious Need Of Help Here
I got a mass amount of images that need to be preloaded dynamically.
Lets say I have 20 pictures that are all on a server.. the SWF creates a new movieClip for each one depending on how many are in the XML file..
It organizes them horizontally just fine, but some of them don't space evenly because the thumbnails haven't all downloaded, so it can't read their width and it makes them overlap..
However when I reload it, since all the thumbnails are downloaded from teh previous load, they space just fine.
So i need to find a way to preload all of these thumbnails before hand.
I tried loading them all individually into one clip then creating the line of clips after.. but they load all randomly.. it'll load like 1, 1, 1, 3, 6, 3, 8, 9, 31, 1, 3, 5, 3, 8, 9, 6, 4, .. it repeats a lot of them..
So I'm not sure where to go from here!
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
//thumbnails_fn(i); // this WOULD load them all in a line. but its not necessary yet because they aren't preloaded!!
thumbnail_mc.loadMovie(thumbnails[i]); //load each clip based on I statement
thumbnail_mc.onEnterFrame = function() {
var totalv = thumbnail_mc.getBytesTotal();
var loaded = thumbnail_mc.getBytesLoaded();
percent = Math.round((loaded/totalv*100)/image.length);
if (loaded == totalv && totalv > 4) {
trace(loaded);
delete this.onEnterFrame;
}
};
thumbnail_mc._alpha=0;
}
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images2.xml");
p = 0;
this.onEnterFrame = function() {
if (thumbnail_mc._alpha <100){
thumbnail_mc._alpha +=2;}
};
If you need it, here is the script to get them line up right!
Code:
function thumbnails_fn(k) {
b = k;
thumbnail_mc.createEmptyMovieClip("t"+k,k);
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
//target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width) * k;
if ((eval("thumbnail_mc.t"+k))._width > 10){
trace(eval("thumbnail_mc.t"+k)._width);
if (k == 0)
{
target_mc._x = hit_left._x; //Offset from the border of hit_left
}
else
{
target_mc._x = hit_left._x; //Offset from the border of hit_left
for (i = 0; i < k; i++)
{
target_mc._x = target_mc._x + eval("thumbnail_mc.t"+i)._width + 5;
// trace("i = " + i + " Distance = " + target_mc._x); //Debugging information
}
}}
//
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[b], eval("thumbnail_mc.t"+b));
}
This has been driving me nuts for the past 2 days! I really need some help!!
Thanks!
Preloading Dynamic Xml From Loadvars...
i have an xml file dynamically created by a php script....i would like to preload the information, before the main movie plays. At present, the following script traces undefined for the bytesTotal...and 0 for bytesLoaded....however, it still parses the xml appropriately,thus it is loading....any suggestions on preloading this loadVars?
Code:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
var lvGet:LoadVars = new LoadVars();
lvGet.load(rootURL+"getDirs.php");
function loadDirs() {
bl = lvGet.getBytesLoaded();
bt = lvGet.getBytesTotal();
percent = Math.round((bl/bt)*100);
trace(bt+" bytes Total : bytes Loaded "+bl);
plBar._xscale = percent;
if (bl>=bt) {
lvGet.onLoad = function() {
myXML.parseXML(this.xml);
removeMovieClip(plBar);
clearInterval(nTime);
gotoAndStop(5);
};
}
updateAfterEvent();
}
nTime = setInterval(loadDirs, 35);
Preloading Dynamic Images
Currently my movie loads dynamic images from another website whose location is retrieved from a (dynamic) XML file. Right now the images are not preloaded, and are loaded only when a user specifically clicks a button to generate them.
The button initiates a for loop that continues until it attaches a separate movieclip of all the images that were included in the XML file. The moveclip instance loads the movie in the first frame of its timeline is simply a placeholder for the image. There can be up to 60 images loaded at one time.
Now it would only make sense to preload these images, but I wasn't sure what would be the most efficient way of doing it and what would be the least demanding on a users system resources - if it even makes a difference.
My first hunch was to just run the for loop at the beginning of the movie and just hide each separate image until they are called in. But I wondered if it would be more efficient to attach and preload just 1 movie clip that includes all 60 of the images and just hide that.
In summary: Is it more efficient to attach and load a movieclip instance onto the main stage for each separate image or to attach and load 1 big moveclip instance that contains all 60 images.... or does it even make a difference? (Mainly in terms of system resources)
Or maybe there’s an even better way to do it?
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!
Preloading Dynamic Text
I need some help here. I'm still confused working in AS3. I need to know is there a way to preload dynamic text? I have a project I'm working on and I'm going to be pulling information from sql. I'm currently working with text files to get the flash working. I have had some success in importing these text files. Although I'm seeing lag on the load of the files. Meaning I go to a part of my flash movie. And I see nothing but if I go to another part then back again. I have no problems to me this sounds like a load problem. Seeing that everything seems to work locally. But I post it to a web server. And I get problems. I'm thinking if I can preload the text files then maybe I won't have this problem.
Please can help me?
Problem Preloading Dynamic Jpg
This topic is everywhere, but I have YET to find a solution to my own issue. I have 4 external swf files, each one has a host_mc that one dynamic jpg is loaded into. I'm trying to find a way to preload the dynamic jpgs.
The host clip that the jpgs are loaded into were manually created, I did not use createEmptyMovieClip(); I have placed the preload code on the key frame where the loadMovie action exists (which loads the jpg into the host_mc):
FYI, I've also tried replacing onLoad() with onEnterFrame() still doesn't preload.
ActionScript Code:
//profileBackg_mc is the host clip for the swf. backgrnd4_mc is a movie clip that
//holds host4_mc were the dynamic jpg is loaded.
this.loadMovie("profile_clear.jpg");
this._root.profileBackg_mc.backgrnd4_mc.host4_mc.onLoad = function() {
//trace the percentage of the movie that has loaded
percent = (this._root.profileBackg_mc.background4_mc.host4_mc.getBytesLoaded()/this._root.profileBackg_mc.background4_mc.host4_mc.getBytesTotal())*100;
if (!isNan(percent)) {
trace(percent+"% loaded");
} else {
trace("0% loaded");
}
};
This jpg just pops up after a while...I don't think its being preloaded. Anyone have any suggestions?
Its not tracing anything either....
PreLoading And Dynamic Data
Just wondering, in your experience, what's the best way to check for data on preload for SWFs that are loading other SWFs which have their own preloading sequences? I'm running into a problem on the site I'm developing where, on initial load, sometimes the SWFs I'm loading aren't finished loading their external data (such as txt and JPGs). Would it make sense to put a variable at the end of each of these loaded SWFs (something like var thisSWFDoneLoading = true; ) and have the main SWF do a check like:
PHP Code:
if(mc1.getBytesLoaded() == mc1.getBytesTotal() && mc1.width > 1 && mc1.thisSWFDoneLoading == true) {
//load the SWF
}
?
Thanks in advance for your input.
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...
Preloading Dynamic Images
Hello,
I am building an application and I am using xml to dynamically load in images. Is it possible to preload each image as it is called? I am a bit of newbie to flash so any help or advice is much appreciated
Cheers
Preloading Dynamic Text
I recently created a site which is up and running. The site works fine and is not to big. It loads external txt files using the following actionscript:
loadText = new loadVars();
loadText.load("anton.txt");
// creating the loadVarsText function
loadText.onLoad = function() {
anton.text = this.Antontext;
};
Ive noticed a delay in loading the txt files. I would like to add a preloader on the site for each one of these txt files with a small loading animation for them nothing to fancy. Im fairly new to actionscripting and Im using Flash MX 6 any help would be appreciated
By the way the site address is:
www.team42.za.net
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...
Preloading Dynamic Pages
First off I want to thank scotty for all his help with my pageflip problems awhile ago, because of him my girlfriend couldnt be happier with her site. Now I have come across a dynamic page flip that draws off external swf or jpgs, I am using swf files beacuse I need it to open a new window when clicked, My question is to show a preloader do I have to add a preloader script to each external swf file or do I add it to the main .fla or swf file that calls on the external swf pages? any help in this would be great right now it takes about 1 min to load and I want to show something while it loading
Preloading Dynamic Images
I have a sweet little problem. In my animation, i am dynamically loading images, one per frame into a blank movie with instance name loadimage.
The problem is that each of these images is around 90-100k and it takes hell of a time to load.
I was wondering if there is a way to preload all the images before the movie is starts? Or better still preload lets say first 5 images and then continue preloading the rest of the images while the movie runs?
Preloading Dynamic Text
This is a problem that I should have tackled long ago.
I'm loading dynamic htmlText into into a text box like this:
Code:
import TextField.StyleSheet;
// Load the css file, then the text file (containing some html)
var cssUrl :String = "fonts.css";
var htmlTextUrl:String = "news_1.txt";
var css:StyleSheet;
// Deal with a IE/Firefox inconsistency.
function fixUrl(url:String):String
{
var rootUrl:String = _root._url;
var iLastSlash:Number = rootUrl.lastIndexOf('/');
if (iLastSlash > 0){
rootUrl = rootUrl.substr(0,iLastSlash);
}
return rootUrl + "/" + url;
}
function loadCSS():Void
{
css = new StyleSheet();
css.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess){
loadHtmlText();
}
}
css.load(fixUrl(cssUrl));
}
function loadHtmlText():Void
{
// Use xml to load a text file.
var xml:XML = new XML();
xml.onData = function(txt:String):Void {
displayText(txt);
};
xml.load(fixUrl(htmlTextUrl));
}
function displayText(htmlText:String):Void
{
var t:TextField = field_txt;
t.html = true;
t.styleSheet = css;
t.embedFonts = true;
t.autoSize = true;
t.htmlText = htmlText;
}
loadCSS();
Problem is, there's a gap between the moment the text box is displayed and the moment the text inside it loads and is displayed, resulting in a sloppy presentation.... :
www.efcmusic.com
Can anyone point out a good way to modify the code I'm using and preload the .txt file?
Preloading This Dynamic Text
So I've got a dynamic text box sucking in CSS styled HTML via a .txt file.
The text is "popping in" after the rest of the page has loaded sometimes since the .txt loads in after the preload.
What I'd like to do is have the animation fire after the text and .css are loaded.
Here's the original AS:
Code:
import TextField.StyleSheet;
//import mx.tween
// Load the css file, then the text file (containing some html)
var cssUrl :String = "fonts.css";
var htmlTextUrl:String = "news_1.txt";
var css:StyleSheet;
// Deal with a IE/Firefox inconsistency.
function fixUrl(url:String):String
{
var rootUrl:String = _root._url;
var iLastSlash:Number = rootUrl.lastIndexOf('/');
if (iLastSlash > 0){
rootUrl = rootUrl.substr(0,iLastSlash);
}
return rootUrl + "/" + url;
}
function loadCSS():Void
{
css = new StyleSheet();
css.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess){
loadHtmlText();
}
}
css.load(fixUrl(cssUrl));
}
function loadHtmlText():Void
{
// Use xml to load a text file.
var xml:XML = new XML();
xml.onData = function(txt:String):Void {
displayText(txt);
};
xml.load(fixUrl(htmlTextUrl));
}
function displayText(htmlText:String):Void
{
var t:TextField = field_txt;
t.html = true;
t.styleSheet = css;
t.embedFonts = true;
t.autoSize = true;
t.htmlText = htmlText;
}
loadCSS();
The mechanisms to control it seem to be there, but I'm missing something. So I was thinking something along these lines:
Code:
import TextField.StyleSheet;
stop();
this.onEnterFrame = function () {
if (this.cssTextLoadComplete == true) {
trace("DONE LOADING -- PUT AS below this line");
} else {
trace("STILL LOADING CSS AND TEXT ...");
}
}
//import mx.tween
// Load the css file, then the text file (containing some html)
var cssUrl :String = "fonts.css";
var htmlTextUrl:String = "news_1.txt";
var css:StyleSheet;
// Deal with a IE/Firefox inconsistency.
function fixUrl(url:String):String
{
var rootUrl:String = _root._url;
var iLastSlash:Number = rootUrl.lastIndexOf('/');
if (iLastSlash > 0){
rootUrl = rootUrl.substr(0,iLastSlash);
}
return rootUrl + "/" + url;
}
function loadCSS():Void
{
trace("FUNCTION loadCSS() firing ...");
css = new StyleSheet();
css.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess){
loadHtmlText();
trace("FUNCTION loadCSS() -- CSS loaded, firing loadHtmlText() ...");
}
}
css.load(fixUrl(cssUrl));
}
function loadHtmlText():Void
{
trace("FUNCTION loadHtmlText() firing ...");
// Use xml to load a text file.
var xml:XML = new XML();
xml.onData = function(txt:String):Void {
displayText(txt);
trace("FUNCTION loadHtmlText() -- TEXT loaded, firing displayText() ...");
};
xml.load(fixUrl(htmlTextUrl));
}
function displayText(htmlText:String):Void
{
trace("FUNCTION displayText() firing ...");
var t:TextField = field_txt;
t.html = true;
t.styleSheet = css;
t.embedFonts = true;
t.autoSize = true;
t.htmlText = htmlText;
//trigger the final loading guy
this.cssTextLoadComplete = true;
trace("FUNCTION displayText() finished -- setting cssTextLoadComplete var to true: " + this.cssTextLoadComplete);
}
loadCSS();
Here's a link to the .zip of the source files:
http://www.efcmusic.com/downloads/preload_txt.zip
Preloading Dynamic Text
I recently created a site which is up and running. The site works fine and is not to big. It loads external txt files using the following actionscript:
loadText = new loadVars();
loadText.load("anton.txt");
// creating the loadVarsText function
loadText.onLoad = function() {
anton.text = this.Antontext;
};
Ive noticed a delay in loading the txt files. I would like to add a preloader on the site for each one of these txt files with a small loading animation for them nothing to fancy. Im fairly new to actionscripting and Im using Flash MX 6 any help would be appreciated
By the way the site address is:
www.team42.za.net
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=
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...
Preloading Dynamic Pages
First off I want to thank scotty for all his help with my pageflip problems awhile ago, because of him my girlfriend couldnt be happier with her site. Now I have come across a dynamic page flip that draws off external swf or jpgs, I am using swf files beacuse I need it to open a new window when clicked, My question is to show a preloader do I have to add a preloader script to each external swf file or do I add it to the main .fla or swf file that calls on the external swf pages? any help in this would be great right now it takes about 1 min to load and I want to show something while it loading
Preloading Dynamic Images
Morning Lads,
Having a bit of an issue here. I'm building a webcam script / component for flash but I can't get my preloader to recognize a dunamic image. I've got the timer script working and the images load on the first run. But each consecctive recycle displays the same image, it does not refresh. As well as the preloader for the images does not register an image referanced by a URL as a number of bytes to be loaded.
URL
http://www.plexusstudio.net/temp/webcam2.swf
nned some help
Preloading Dynamic Text ?
I have an empty dynamic text field and I load a .txt file into it.
Is it possible to preload the dynamically loaded text file ?
Preloading Dynamic Swfs
I am trying to preload dynamically loaded swfs. Basically I have movie targets sitting on the main timeline, and I am loading swfs into these targets via loadMovie. When I put a preloader on the main timeline, the preloads are not smooth and keep jumping from 0 to 100%.
It sucks because, the preloader sits at 0 for a while and then jumps to 100% like the animtaion was loaded in a lump. How do i rectify this?
PS: My preloader is in an onEnterFrame and basically functions like this:
targetMovieClip.getBytesLoaded, where targetMovieClip is the movie target into which the swfs are loaded.
|