Preloader For Externally Loaded Txt And Images
I have my images and .txt files loading dynamically but they take a long time to load. Does anyone have an easy to use preloader for these dynamically loaded .txt files and jpgs?
Also - is it possible to have load multiple .txt files ?
thanks
Tek-Tips > Adobe(Macromedia): Flash Forum
Posted on: 15 Jul 05 9:16
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloader In Externally Loaded Swf Stops Working (loaded Into An Empty Movie Clip)
SEE BOTTOM OF THREAD FOR CURRENT PROBLEM
1. I have my navigation buttons in level0
2. When a button is pressed it loads an external .swf into the highest empty level
3. There is an MC in this loaded .swf called loadmovie and inside that another MC called empty.
4. Inside the 'loadmovie' MC, there is a frame action that loads another external .swf file into the 'empty' MC.
The problem I am having is that the preloader that is on the external .swf that is loaded into the 'empty' MC does not work.
It works fine if you test it on its own. But not when loaded into a Movie Clip.
MY SCRIPT:
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = (iBytesLoaded/iBytesTotal)*100;
percentageNumber = Math.round(iBytes)+"%";
setProperty("progressBar", _xscale, iBytes);
Do I have to refrence it differently? Because of where it is situated?
e.g
iBytesTotal = _level32._root.loadmovie.empty.getBytesTotal();
confesed!
Scaling Externally Loaded Images
Im loading some external images into my swf. The thing is, the images are really large, but i dont want to scale them externally. Is there some AS i can use that will scale my images?
thanks a lot,
j
Scaling Externally Loaded Images
ok, here is what I'm using and it works fine within the movie that the code resides. However, if I load the movie (that the code resides) into another movie, it doesn't load the external jpg. what the heck is going on?
/************************************************
Scale a loaded JPG to fit within a given height
and width, while preserving aspect ratio.
************************************************/
var picName : String = "_logo.jpg";
var maxHeight : Number = 55; // this is where you enter the maximum height
var maxWidth : Number = 400; // if we make the max width very large, it will never be the limiting factor
// create a clip within a clip, since loadMovie clobbers
// the onEnterFrame function of the clip it loads into
var f : MovieClip = _level0.createEmptyMovieClip("frame", 1);
var h : MovieClip = f.createEmptyMovieClip("holder", 1);
// set the frame clip to act when the jpg has loaded
f.onEnterFrame = function() {
if(h._width > 0 && h._height > 0) { // we're loaded
// now scale as needed
var xs : Number = maxWidth / h._width * 100;
var ys : Number = maxHeight / h._height * 100;
this._xscale = this._yscale = Math.min(xs, ys);
delete this.onEnterFrame;
}
{
f._x = 507
f._y = 435
}
}
// set it going
h.loadMovie(picName);
Externally Loaded Images And Captions
Hello!
I want to create a Flash movie where my client can upload up to 50 images along with captions. How do tell Flash to read how many images there are and then give me the number of pages and buttons necessary?
Thanks!
Gerb
Fading Externally Loaded Images
Hi!
I created a Flash movie with a graphic symbol containing an embedded JPEG. I faded the symbol in and out by creating a motion tween between an instance of the symbol at 0% Alpha color and another instance of the symbol at 100% Alpha color. When I tried to load the JPEG image from an external source using the Loader Component inside the graphic symbol (in stead of embedding it inside the graphic symbol as I had done previously) the fades disappeared. I can now only see the image when the Alpha color is 100%
Any help would be very much appreciated! : )
Thanks,
Leao
Buttons From Externally Loaded Images?
Hi there,
I'm looking to create buttons from externally loaded images but am not sure whether I'm going about it the correct way, or if it's even possible.
I've loaded my images externally onto the stage, and over these (on higher layer) I've created invisible buttons to the exact dimensions and positions which when clicked will cause some text to appear.
Should this work in theory ? Or is there an easier way to achieve this? Basically the buttons will change when content is updated.
All suggestions appreciated.
Many thanks
Q.
Scaling Externally Loaded Images
Hi
I'm using this to load and image:
Code:
this.createEmptyMovieClip ("container_mc",this.getNextHighestDepth());
container_mc.loadMovie("images/0.jpg");
But i want it to scale proportionally full screen.
I have this that has worked when the the mc is on the stage.
Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
container_mcHeight = new Object ();
container_mcHeight = container_mc._height / pic._width;
container_mcWidth = new Object ();
container_mcWidth = container_mc._width / container_mc._height;
if ((Stage.height / Stage.width) < container_mcHeight) {
container_mc._width = Stage.width;
container_mc._height = container_mcHeight * container_mc._width;
} else {
container_mc._height = Stage.height;
container_mc._width = container_mcWidth * container_mc._height;
};
container_mc._x = Stage.width / 2;
container_mc._y = Stage.height / 2;
sizeListener = new Object();
sizeListener.onResize = function() {
if ((Stage.height / Stage.width) < container_mcHeight) {
container_mc._width = Stage.width;
container_mc._height = container_mcHeight * container_mc._width;
} else {
container_mc._height = Stage.height;
container_mc._width = container_mcWidth * container_mc._height;
};
container_mc._x = Stage.width / 2;
container_mc._y = Stage.height / 2;
}
Stage.addListener(sizeListener);
But i dont know how to apply that to an externally added image
Any ideas?
many Thanks
Border Around Images Loaded Externally
Hello, i have a external image loader (from xml doc) and i was wondering how could i create a border around the images that are loaded? I tried the following code, but all i got was error messages!
Border attempt:
ActionScript Code:
bmp.graphics.lineStyle( 2, 0xFFFFFF );
bmp.graphics.drawRect( 0, 0, bmp.width, bmp.height);
Image code:
ActionScript Code:
var loader:Loader;
var bmp:Bitmap;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
bmp = new Bitmap();
addChild(bmp);
function onLoadComplete(e:Event):void {
try {
bmp.alpha = 0;//hide the scaling
bmp.bitmapData = Bitmap(loader.content).bitmapData;
bmp.smoothing = true;
bmp.width = 854.6;//scale the img
bmp.height = 473.6;//scale the img*/
bmp.x= 208;
bmp.y=67;
bmp.alpha = 1;
//bmp.graphics.lineStyle( 2, 0xFFFFFF );
//bmp.graphics.drawRect( 0, 0, bmp.width, bmp.height);
loader.unload();//we don't need anymore loader.content
} catch (e:Error) {
trace("What's happen!!!"+e);
}
}
// end image loader
//randomLoading
function randomLoad():void {
var url:String = imagesXml.image[uint(Math.random()*imagesNb)].@src;
loader.load(new URLRequest(url));
}
//timer
var imageLoaderTimer:Timer = new Timer(3000);
imageLoaderTimer.addEventListener(TimerEvent.TIMER, function():void {;
randomLoad();
});
//xmlloader
var imagesXml:XML;
var imagesNb:uint;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, function (e:Event):void {;
imagesXml = new XML(e.target.data);
imagesNb = imagesXml.children().length();
imageLoaderTimer.start();
});
urlLoader.load(new URLRequest("images.xml"));
Any help would be great!
Crossfade Externally Loaded Images
I've been looking into how to crossfade externally loaded .jpgs. So far everything I have found deals with slideshows and seems more complicated than what I need. I have created a new Loader that will load a .jpg when the thumbnail of the corresponding image is clicked. I am trying to get the currently loaded image to crossfade upon load completion of the new image being loaded. I'm thinking I can define a variable that is the current image in the loader and then on completion of loading of the new image run a function that fades out the current image and fades in the new image simultaneously. I am having problems trying to identify the currently loaded image of the loader into a variable. Any help or advice is appreciated and also, if I am oversimplifying this please let me know. Thanks.
Externally-Loaded Images And Styles
Does anyone have links to good tutorials on how to pull in images externally and dynamically display them in Flash? Also, in addition to text styles, does anyone know if background colors can be specified in a properties file or stylesheet?
Essentially, I'm looking to make a flash movie externally brandable. Any ideas?
Downloading Externally Loaded Images
Does anyone know how i can make externally loaded images (JPG) rightclick downloadable?
I externally load the images into an MC. The "rightclick/save image" option is not workung (duhh, it's flash!) but i want it to.
Could anyone help me with this?
Martijn
ps. for an example of the gallery see parkingmartijn.tk / studies
Why Are My Images Pixellated When In An Externally Loaded Mc?
i have my movie set up so that I load an external movie into a "container" mc, and within that movie, I load another external swf into another "container". However the images that are on that second swf show up pixellated through when I view the top level movie, and I'm not sure why. The actual images aren't pixellated, just the usual 72dpi. Is there something I have to do so that they dont' show up that way? Also, they're under a mask. Should that matter? Help!
Thanks!
Fading In Externally Loaded Images
Alright for some reason i'm having some trouble with this little bit of actionscript. I've never been great at it so i need a little nudge every once in a while.
Anyway, i've got an image gallery that is loading external images into empty movieclips that are on the stage. This all works fine. What i'm trying to do is give the larger image (medium_mc) a nice fade in once it loads. This is the script that i've got so far:
Code:
MovieClip.prototype.loadPic = function(pic){
medium_mc._alpha = 0;
medium_mc.loadMovie(pic);
medium_mc.onEnterFrame = function(){
var t = medium_mc.getBytesTotal(), l = medium_mc.getBytesLoaded();
if (t != 0 && l == t){
medium_mc._alpha += 5;
}
if (medium_mc._alpha>90) {
medium_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
What's happening with this is the image is staying invisible and never fades up.
So hopefully one of you awesome guys will glance over that and see what i'm doing. Thanks in advance.
How To Scroll Externally Loaded Images
hello all
Im in a middle of a project, in which i've to call the images from external xml file.
My requirement is that the images (in a array of 5) should first sroll from right to left , then stay on the stage for some time & then fade out.
Do anyone has done it before, it will be highly helpful to me
thanks in advance
Externally-Loaded Images And Styles
Does anyone have links to good tutorials on how to pull in images externally and dynamically display them in Flash? Also, in addition to text styles, does anyone know if background colors can be specified in a properties file or stylesheet?
Essentially, I'm looking to make a flash movie externally brandable. Any ideas?
[F8] Dynamically Resizing Externally Loaded Images
Hey,
I'm having a lil bit of a problem, I'm trying to load an image into an existing MC and then both get and set it's width and height.
Right now I'm loading the image in just fine, I stop the movie at the top of the script and tell it to play when it's been fully loaded (I use the MovieClipLoader class for that). the image loads in and the movie plays fine but if I try to resize it at all (in the onLoadComplete) the image just dissapears...
I'm pretty sure I'm just missing something starring me in the face but I"ve been grappling with this for a while (I fixed up a cheap workaround in the meantime). Any help would be VERY appreciated,
Thanks,
-Sandy
Player Resizes Images Loaded Externally
I have a huge problem with a website I am developing for my company, and I have a 3day deadline. This is the first fullscale anything I have developed in flash, so bear with me. Also, if this is already posted somewhere, I am sorry, but I am in a crunch for time and didn't really look to thoroughly through your posts.
The problem is with a textarea that loads dynamic content. The content loaded is html with some inline images and css styles applied. When it loads however, the graphic's are scaled slightly smaller, and therefore look horribly aliased. I have tried MANY things to cure this problem.
-_quality is set to "best" in the main timeline, and in the textarea itself ("content_txt._quality = "BEST")
The html is loaded inside of a swf, this swf is loaded into a main swf. When the inline swf is loaded, it scale's rather oddly (the original movie being loaded has a stage of 753px by 335px, however if I resize the placeholder it's loaded into to this size, it is far too large.
If I set this textarea's _xscale and _yscale properties to 100%, it is almost scaled properly, but with a _width of 446.95 and a height of 226, which is still I can not figure out how to get it to scale properly, or why this is necessary to begin with. I have also tried setting the root movie's _xscale and _yscale to 100% in the first frame, with the same results.
How do i get it to load all of these external assets while retaining there original size? How can I get my inline images to appear exactly how I want them too? They really look horrible when they load.
To get an idea of what Im talking about, the website im working on is www.ocidevelopments.com, and if you click through Hyland Homes, then Portfolio, you will get an idea of what I am talking about.
Again, this is my first application in flash. I have only fiddled with Actionscript before this. So don't laugh at my horribly scripted and coordinated effort -=]
Get Button Behavior From Externally Loaded Images?
Hello pros,
I am wondering if it is possible to load a .jpg externally with loadMovie(); and have that button-image scale up on mouse over? So far, I can only implement such button behavior with images from the Library. Once the button is clicked then I load a larger image with the loadMovie().
However, I'd like to have quite a few such buttons (20 or so) on a grid in one .swf, and it will be a lighter file if it were possible to have the button images be called externally... without a huge delay.
Is this possible at all?
Thank you for your expertise and help!
apx_ (newbie...)
Externally Loaded Images - OnPress Problems
Hi all,
I'm very new to Actionscript so bear with me, although I'm a C# developer so understanding the code is ok! I'm trying to build a flash photoviewer that loads images in from an external folder (they are referenced in an xml file). A thumbnail of each is shown and i need each thumbnail to be clickable so that a large version of the photo is shown when its thumbnail is clicked. So far I've loaded the thumbnails and show the first image as the main image and I have an onPress event which is being fired for each thumbnail when clicked....BUT they all show the first image. I've put a trace in to help but i don't understand how to fix this problem. Any pointers very gratefully received. Here's my code:
Code:
var x = new XML();
var path = "\images\";
//thumbs
var xPos = 466;
var yPos = 103;
var tWidth = 44;
var tHeight = 44;
var tSpace = 5;
var numPhotos = 0;
//main
var xMain = 96;
var yMain = 20;
var mWidth = 268;
var mHeight = 400;
x.ignoreWhite = true;
x.onLoad = function(success) {
if (success) {
x=0;
//main
var mcMain = _root.createEmptyMovieClip( 'main'+i, i+10 );
mcMain._x = i*110;
var imgMain = mcMain.createEmptyMovieClip( 'mImg', 1 );
imgMain._visible = false;
imgMain.loadMovie(path + this.childNodes[0].childNodes[0]);
mcMain.onEnterFrame = function(){
var t = imgMain.getBytesTotal();
var l = imgMain.getBytesLoaded();
if( l == t && t >100 ){
this.onEnterFrame = null;
this._width = mWidth;
this._height = mHeight;
this._x = xMain;
this._y = yMain;
imgMain._visible = true;
}
}
//thumbs
for( i in this.childNodes ){
var mc = _root.createEmptyMovieClip( 'pic'+i, i+10 );
mc._x = i*110;
var img = mc.createEmptyMovieClip( 'img' + i, 1 );
img._visible = false;
var imgPath = path + this.childNodes[i].childNodes[0];
trace("Path 1: " + imgPath);
img.loadMovie(imgPath);
mc.onEnterFrame = function(){
var t = img.getBytesTotal();
var l = img.getBytesLoaded();
if( l == t && t >100 ){
this.onEnterFrame = null;
this._width = tWidth;
this._height = tHeight;
this._x = xPos;
this._y = yPos;
this.onPress = function(){
imgMain.loadMovie(imgPath);
trace("Path 2: " + imgPath);
trace("Name : " + this.name);
}
xPos = xPos + tWidth + tSpace;
numPhotos = numPhotos + 1;
if (numPhotos > 3)
{
//build next row of thumbnails
xPos = 466;
yPos = yPos + tHeight + tSpace;
numPhotos = 0;
}
img._visible = true;
outlinePortrait._visible = false;
}
}
}
} else {
trace( 'failed to load xml' );
}
}
x.load('images.xml');
Make Externally Loaded Images Clickable
Hi all,
I've created an empty movieclip (imgHolder) dynamically on my stage and through XML I've loaded a picture into this movieclip which works fine.
However, if I click on the picture, nothing happens.
This is what I scripted so far...
Code:
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = function(loaded) {
if(loaded) {
parseXML();
trace("the xml is loaded successfully!");
} else {
trace("something went wrong; error: " + this.status);
}
}
xmlData.load("http://www.arkeacties.nl/xml/web6-mainbanners.xml");
function parseXML() {
var themaNodes:Array = xmlData.firstChild.childNodes;
for(i=0; i<themaNodes.length; i++) {
var tabNodes:Array = themaNodes[i].childNodes;
createEmptyMovieClip("imgholder", getNextHighestDepth());
imgholder.loadMovie(tabNodes[0].childNodes[0].attributes.beeld);
imgholder._x = 0;
imgholder._y = 0;
imgholder.onPress = function() {
trace("the image has been rolled over"); // this won't work
}
}
}
Any help would be appreciated.
[F8] MC's With Externally Loaded Images Won't Accept OnEvent Commands
I have a photo gallery that uses a series of movie clips for the thumbnails. The thumbnails are externally loaded jpegs. They load just fine, but once loaded they will not accept any onEvent handlers. Does anybody have any idea why this is happening? I am wondering if when the image is loaded, it wipes out the instance name of the movie clip. My code to call out the event handler is this:
this.e1.onRollOver=function() {this.e1._alpha=100};
this.e1.onRollOut=function() {this.e1._alpha=50};
this.e1.onPress=function() {
_root.myVar = e1;
_root.myLargeImage.gotoAndPlay(2);
}
I am using a loop statement for all the movie clips, but for testing purposes I am putting in e1 in the code above.
Random Image Fader With Externally Loaded Images
hi, this is gonna be my first post ever here, so be gentle on me
i've got this header in a website that's got images fading in and out of each other. btu now i want them to be loaded externally and randomly. but still fading in and out of each other.
i did foudn a post that loads the images externally from a folder and loads any image that's in that folder, but it doesnt work in my version of Flash 8.0 Pro.
Does anyone know any good script or short tuto (since time is short) that's makes the movie behave like i want it to?
below the attachment with my current image fader.
hdrfader.zip
note: please be clear on your comment since im just a Flash and AS n00b
[F8] Preloader For Externally-loaded SWF?
I've got a button that, when released, loads an external SWF to an empty MC on my main timeline. Given the size of the SWF (contains thumbnails for a gallery) I want to put a preloader in place while it loads. I tried putting a preloader in the SWF itself but when the button is clicked, the preloader does not initiate for some reason and the screen stays blank until the SWF is actually loaded. Since I'm new, I tried putting the preloader in the empty MC to read the SWF but that doesn't work either. Can anyone help me figure out where and how I put the preloader for this externally-loaded SWF?
Thanks!
Preloader For A Externally Loaded .jpg
buenas tardes
I need the script for a preloader for a externally loaded .jpg
I have a button with a gotoAndStop, to a frame where theres an empty movie clip that loads a .jpg... I want to add a percentage (in numbers) preloader... I know how the preloaders work for swf, but I dont get how to make the preloader work to get the bytes loaded of the image in the empty mc, called container.
One day Ill be able to answer many questions... for today, I still need to be answered...
Thank you very much
namaste
Preloader For A Externally Loaded .jpg
buenas tardes
I need the script for a preloader for a externally loaded .jpg
I have a button with a gotoAndStop, to a frame where theres an empty movie clip that loads a .jpg... I want to add a percentage (in numbers) preloader... I know how the preloaders work for swf, but I dont get how to make the preloader work to get the bytes loaded of the image in the empty mc, called container.
One day Ill be able to answer many questions... for today, I still need to be answered...
Thank you very much
namaste
Dynamic Images, Masks And Controlling Externally Loaded Swf Files.
Hiya folks
My latest project (and problem) is as follows.
I have a script file in which the user enters 3 parmaters in an array.. filename, holdtime & mask.
(ie. imgArray[0] = new Image("Testpic1.jpg", "3", "L_Wipe");
The swf itself just contains 3 movieclips, all empty and just holders for the dynamic images/swfs & masks to be loaded into.
So far I have it working very nicely, the jpg or swf is loaded into an imgHolder clip (using loadMovie), the mask/transistion (stored in the library with a linkage ID) is loaded into a mask Holder clip with the attachMovie command, and lastly the underlying img2Holder clip contains a copy of the top image so that when the new image is bought in the transition works seamlesly between the new image and the previous image(which is now loaded into img2Holder). All of this is totally dynamic and the users just specify whatever images/swfs they want, how long to hold the jpg for or how many times the swf loops, and what mask is used as the transition for the incoming image/swf.
DOWNLOAD ZIP: http://194.154.190.87/DynamicImage.zip
HOWEVER..as the user can also specify swf files, this brings up my major problem. At the moment I am having to KNOW the length of the swf file and use the hold variable in the array to hold it for its play length (which is no use as the user will not have produced the swf so have no idea of its length and also the production willnot have any code in it that can be passed back to the main player timeline). What I THINK I need to know,is thus..
1. How do I determine the total number of frames in a swf loaded into a movieclip with attachMovie, and then get it to perform a function when it has reached its last frame. (ALL SCRIPT HAS TO BE ON THE MAIN TIMELINE, AS THE PRODUCTION CANNOT HAVE ANY MANDATORY CONTROLLING SCRIPTING)
2. When I can do the above, I can then use the hold part of the array as a loop counter for swfs and a hold amount in seconds for jpgs. How would I get a swf (loaded as above) to loop a specified amount of times ?
3. Also I need to load in the wsf to the underlying img3Holder clip and then go and stop straight at the last frame so that when the top layered version of the swf finishes, the bottom layered version isn't playing (which it does when loaded in with loadMovie).
So it all comes down to how do I control swf files which have been loaded into a movi clip using the attachMovie command ??
if anyone could please help I would be most grateful and would have no problem as adding them as a contributor in the credits section of the code.
Anyway folks, download the zip file, run the swf then look at the Fla and .as files and see where I am now...
Thanks for listening
Cheers
Akash
[Edited by Akashanq on 08-20-2002 at 08:05 AM]
Storing Externally Loaded Object (swfs, Images, Sounds)
Hi
hopefully someone can help me with this.
I am creating a full site in flash... with a gallery and a media page... everything is working as it is... but the question i have is this.
If you load any external file into flash like an image or a sound file how do you make it not have to reload evertime you move to another page and then go back to it?
example
i have a gallery page that loads in images using xml... the each have there own preloader so it shows that its loading and thats great...
the problem is if i go to another page on the site example the news page... then i return back to the gallery page, the images have to reload again... is there anyway to fix this so if you load it once you dont have to load it again?
Any help would be appreciated
Thanks
Preloader For An Externally Loaded Movie?
How do you create a preloader for the external movie when you use the loadMovie funcion? Will a preloader in built into the movie being loaded work? I've tried it and it didn't seem to work at all.
Preloader For Externally Loaded Movies
I am trying to make a preloader for movies that are loaded with the loadMovie(...) command, but nothing seems to work.
I hope anybody can help me with this one. Any help is welcome.
Preloader And Externally Loaded Movies
I have a main swf which has a preloader which calculates the percentage loaded based on the total bytes vs bytes loaded.
In this main swf I call 4 external swf files.
Is there a way to have those external swf files included in the total bytes?
Preloader For Externally Loaded Movies
Hello,
I am trying to figure out how to make a preloader load my external movies as well as the main movie. I have a modular webpage consisting of numerous externally loaded movies, and when I place a preloader in it, it only seems to load the main movie, and not the ones connected to it. Is there any way to load everything? The load time on my webpage is terrible, and hope to fix it soon. Any help would be grateful.
Here's the page:
http://www.chromaticstudios.net/portfolio.html
Preloader Externally Loaded Jpeg
Hi
I know how to do a preloader for swfs that are loaded externally,but
if i want a preloader for a dynamically loaded external jpeg, do i just target the prelaoder to judge the propeties of the target movie clip that the external jpeg is being loaded into?
i have tried this method and have had varied results maybe i m doing something wrong)
Thanks
Michael
Can I Preload Externally Loaded Swf + Txt With One Preloader?
I have an external swf I want to preload (no problem I can do that) but I also have 5 dynamic text fields that load seperate .txt files can I preload everything with one preloader?? I can attach the file later tonight or tomorrow if needed...
Thanks in advance...
Preloader Not Working On Externally Loaded Jpg
Hi,
I am in the process of making an interactive tour plan, which quite simply is a floor plan of a building which when interacted with by the user shows a description and image of the room in question. With the image I am loading the jpeg externally (using a tutorial I found on the web - I'm no expert) and it works fine except the preloader, which is a component does not work, it sticks on 0% and then the image pings in. I'm not really sure why this is happening - can anyone help?
The fla file can be found here: http://www.chaosdesign.com/englemere...ourWedding.fla
Many thanks
Bev
Loading Multiple Images Externally With Preloader
Hi everyone !
I'm trying to set up a portfolio page whereby i can showcase a series of images that load into flash with a preloader function. Have came cross examples similiar to this but only limited to one image per page. Can anyone guide me on this ? thanks...: )
Btw, it has to be easy to update coz i have a long list to put in..
regards,
Jen
Adding A Preloader To An Externally Loaded File
I have several external swf files that are loaded into my movie when the user presses a button. some of them may end up being big files, so how can i add a preloader to these for confirmation the file is being loaded.
PLease help!!!!!
Preloader Bar Works Perfectly, But Not If Swf Is Externally Loaded
Hi Guys, (using flash 8 professional)
I am at my wits end with this one.
I am no expert in flash but a year or so ago i managed to create a preloader bar which i pretty much use all the time now.
For our companies latest site however i changed the navigation structure to use shell navigation. (basically i have a master index menu that loads in all the sub pages)
Unfortunately the preloader bar no longer works but the percentage and data values update perfectly.
Is there any way i can modify it to work properly.
I have attached the fla file.
The coding on bar is shown below
To see the problem go to www.omega-completion.com (its the intro 3d tools spin round movie that has the problem)
Alternatively open homeflashkit.fla as this is the file the movie loads into
Thanks J
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene();
}
frame = int(loadedbytes/(totalbytes/100));
loader.gotoAndStop(_root.frame);
Preloader In Externally Loaded Swf Causing Error
I have a movie that loads swfs into a loader within and MC on the main file/stage. The code within the movie clip housing the loader is (NOTE: I worked up an simplified fruits/veggies example to work out issues, I am not a fruit/veggie expert or anything):
ActionScript Code:
stop();
var swfLoader:Loader = new Loader();
var swf:MovieClip;
var fruitReq:URLRequest = new URLRequest("fruit1.swf");
var veggieReq:URLRequest = new URLRequest("veggies1.swf");
function fruitLoad():void
{
addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
swfLoader.load(fruitReq);
}
function veggieLoad():void
{
addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
swfLoader.load(veggieReq);
}
function contentLoaded(event:Event):void
{
event.target.removeEventListener(Event.COMPLETE, contentLoaded);
swf=event.target.content;
}
That loads fruit1.swf and veggies1.swf into the loader based on clicks to buttons elsewhere in the project.
The fruit1.swf file (veggie one is identical) has the following code:
ActionScript Code:
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onProgress(event:ProgressEvent):void
{
var loaded:Number = event.target.bytesLoaded;
var total:Number = event.target.bytesTotal;
var pct:Number = loaded/total;
loader_mc.scaleX = pct;
loaded_txt.text = "Loading.... " + (Math.round(pct*100)) + "%";
}
function onComplete(event:Event):void
{
nextFrame();
}
Then there are images on other frames within them that I access with buttons in the main movie timeline.
ERROR: The first swf loaded works fine, but then if you click the other button (fruit/veggies) the following error comes up in the output window:
ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at fruit1_fla::MainTimeline/onProgress()
That repeats every time either button is clicked after that.
NOTE: I tested this after removing the preloader code(and moving the frames around to remove the blank first frame) in the external swfs and it worked fine jumping back and forth between them.
I have already plugged away at this solving a series of issues to get to this point and I have the feeling this is a pretty simple fix, but I am not sure whether I should be looking in the external swf file itself or in the loader code in the main file to solve it.
Any help would be much appreciated! Let me know if you need more info/code.
Preloader Not Displaying Progress On Externally Loaded Jpg
Hi,
I am in the process of making an interactive tour plan, which quite simply is a floor plan of a building which when interacted with by the user shows a description and image of the room in question. With the image I am loading the jpeg externally (using a tutorial I found on the web) and it works fine except the preloader, which is a component does not work, it sticks on 0% and then the image pings in. I'm not really sure why this is happening - can anyone help?
The fla file can be found here: http://www.chaosdesign.com/englemere...ourWedding.fla
Many thanks
Bev
Preloader Not Displaying Progress On Externally Loaded Jpeg
Hi,
I am in the process of making an interactive tour plan, which quite simply is a floor plan of a building which when interacted with by the user shows a description and image of the room in question. With the image I am loading the jpeg externally (using a tutorial I found on the web) and it works fine except the preloader, which is a component does not work, it sticks on 0% and then the image pings in. I'm not really sure why this is happening - can anyone help?
The fla file can be found here: http://www.chaosdesign.com/englemere...ourWedding.fla
Many thanks
Bev
Externally Loaded Text Prob In Externally Loaded Swf
hi.
so i have a swf that has externally loaded text in it that is being loaded into another swf. the text loads properly when the swf is opened by itself but when the swf is loaded into my main movie the text ceases to appear
my code to load the text is
loadText = new LoadVars();
loadText.load("dates.txt");
loadText.onLoad = function() {
event1.text = this.event1;
date1.text = this.date1;
location1.text = this.location1;
address1.text = this.address1;
cost1.text = this.cost1;
event2.text = this.event2;
date2.text = this.date2;
location2.text = this.location2;
address2.text = this.address2;
cost2.text = this.cost2;
event3.text = this.event3;
date3.text = this.date3;
location3.text = this.location3;
address3.text = this.address3;
cost3.text = this.cost3;
};
any help would be much appreciated
Externally Loaded Text Prob In Externally Loaded Swf
hi.
so i have a swf that has externally loaded text in it that is being loaded into another swf. the text loads properly when the swf is opened by itself but when the swf is loaded into my main movie the text ceases to appear
my code to load the text is
loadText = new LoadVars();
loadText.load("dates.txt");
loadText.onLoad = function() {
event1.text = this.event1;
date1.text = this.date1;
location1.text = this.location1;
address1.text = this.address1;
cost1.text = this.cost1;
event2.text = this.event2;
date2.text = this.date2;
location2.text = this.location2;
address2.text = this.address2;
cost2.text = this.cost2;
event3.text = this.event3;
date3.text = this.date3;
location3.text = this.location3;
address3.text = this.address3;
cost3.text = this.cost3;
};
any help would be much appreciated
Externally Loading Swf Inside An Externally Loaded Swf
Hey,
So basically, I have a main movie, with buttons for each section (such as home, portfolio and so on). Each button externally loads each section swf into a container. That works fine, all the sections load in and out perfectly.
Now, I want to load some more swfs (like projects in the portfolio section) into the swf thats been loaded from the main movie. Becuase I put my buttons inside movie clips (so that when you roll over the button, the animation finishes if you roll over another half way through), I had to use the tellTarget("/") script to bring it back, but it dosent work, it seems to load the movie into the main movie!
How can I fix this? Iv tried loading it into a different container symbol in the main movie but its still dosent work
Thanks alot.
Externally Loading Swf Inside An Externally Loaded Swf
Hey,
So basically, I have a main movie, with buttons for each section (such as home, portfolio and so on). Each button externally loads each section swf into a container. That works fine, all the sections load in and out perfectly.
Now, I want to load some more swfs (like projects in the portfolio section) into the swf thats been loaded from the main movie. Becuase I put my buttons inside movie clips (so that when you roll over the button, the animation finishes if you roll over another half way through), I had to use the tellTarget("/") script to bring it back, but it dosent work, it seems to load the movie into the main movie!
How can I fix this? Iv tried loading it into a different container symbol in the main movie but its still dosent work
Thanks alot.
How To Add A Preloader To This Xml Loaded Images
Hi, i´m using this code to load several jpgs in a row -side by side-, with no spacing between. i use it for mask the holder and then, with help from zeh tween class slide the pictures. The problem is that there is a lot of images -almost 60-, so it takes a lot of time to load. What i want to do is preload the images in order, so they appear when loaded. the first load first, then the second and so on.
You can see an example of what im trying to do here:
http://www.estudioelemental.com.ar/pdm
(you are gonna have to wait a little for the animation to finish, and for the jpg to load -this is a test with only 10 jpgs-
and the code for load the images:
Code:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function():Void
{
showImages(16);
}
myXML.load("gal.xml");
function showImages($cols:Number):Void
{
// Pass a paramater so I can choose how many columns I want.
var numCols:Number = $cols;
var xmlLength:Number = myXML.firstChild.childNodes.length;
var numRows:Number = Math.ceil(xmlLength / numCols);
// I define a width for the image. Higher the number adds more spacing.
var xSpacing:Number = 529;
// I define a height for the image. Higher the number adds more spacing.
var ySpacing:Number = 0;
var imgCount:Number = 0;
var imageHolder:MovieClip = this.createEmptyMovieClip("imageHolder", this.getNextHighestDepth());
for (var i:Number = 0; i < numRows; i++)
{
for (var j:Number = 0; j < numCols; j++)
{
var xmlPath:XMLNode = myXML.firstChild.childNodes[imgCount];
imageHolder._x = 0;
imageHolder._y = 0;
var ob:Object = new Object({id: i});
ob.mc = imageHolder.attachMovie("image_mc", "image_mc" + imgCount, imgCount, {_x: (j * xSpacing), _y: (i * ySpacing)});
ob.img = xmlPath.attributes.img;
ob.mc.loadMovie(ob.img);
imgCount++;
}
}
}
any help would be apreciated, thanks in advance.
cristian.
Preloader For Individually Loaded Images
Hi all, 2 part question:
1) I am using this code to dynamically load jpg images into a movieclip container:
on (release) {
this.myContainer.loadMovie("images/myPic1.jpg");
}
I would like to make it so that when a person clicks on a thumbnail, a preloader (percentage bar) displays while the jpg loads.
I have seen various threads on this on the forum and claudio's tutorial on preloaders and dynamic content but I am not sophisticated enough to combine the elements to get it to work the way I want. Any help/suggestions would be appreciated!!!
2) Also, I would like to be able to load one of three text captions (caption1, caption2, caption3) depending on which image is loaded. Basically what I want to say if "If (images/myPic1.jpg) is loaded into myContainer then display caption1." I wish to god I knew more about programming languages, I know what I want to do, and I know the logic, but I just can't connect the **** dots!!! I tried playing around with an array, but now I am just dizzy! Help!
Preloader For Individually Loaded Images
Hi all, 2 part question:
1) I am using this code to dynamically load jpg images into a movieclip container:
on (release) {
this.myContainer.loadMovie("images/myPic1.jpg");
}
I would like to make it so that when a person clicks on a thumbnail, a preloader (percentage bar) displays while the jpg loads.
I have seen various threads on this on the forum and claudio's tutorial on preloaders and dynamic content but I am not sophisticated enough to combine the elements to get it to work the way I want. Any help/suggestions would be appreciated!!!
2) Also, I would like to be able to load one of three text captions (caption1, caption2, caption3) depending on which image is loaded. Basically what I want to say if "If (images/myPic1.jpg) is loaded into myContainer then display caption1." I wish to god I knew more about programming languages, I know what I want to do, and I know the logic, but I just can't connect the **** dots!!! I tried playing around with an array, but now I am just dizzy! Help!
Attaching Preloader To Xml Loaded Images
Hello,
I am using xml to load in image icons for an mp3 player, but the images load into separate holding movie clips, that are generated via AS, one by one as they are streamed.
an example of the player can be seen here(problem doesn't really show up for high speed connections, but lower ones will see the player drag as one image pops on to the screen at a time)
http://www.ethang.net/playerMP3/playerMP3.html
I was theorizing making a preloader for the loaded xlm file, but this will not work because it just holds the links for the images being loaded, and is fairly small. I must somehow place one preloader on the stage while flash loads all the images, and then displays them all at once.
Here is the code to load in the xml
Code:
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item", "item"+i, i+1);
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.ref.inner.loadMovie(nodes[i].attributes.image);
}
playSong();
}
xml.load("icons_local.xml");
I figure I could make a function like:
Code:
var imageThumbs = nodes[i].attributes.image
var = loadedIMages:Number = (imageThumbs.getBytesLoaded / imageThumbs.getBytesTotal) * 100;
function ()
{
if(loadedImages == 100)
{
imageThumbs._alpha = 100;
}
else
{
imageThumbs._alpha = 0;
}
}
but I am sure that the "nodes[i].attributes.image" is private to the loading xml function.
What should I do?
|