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 cachehttp://www.ferragiacomo.com/collections/wc2007spring/wc2007spring.swfThe 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
Actionscript 2.0
Posted on: Fri Feb 16, 2007 6:52 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloading Thumbnails...nearly
Hi there,
I'm currently making a xml driven photo gallery. The first stage is loading in the thumbnails, each thumbnail will preload individually. I pretty close to acheiving this except my current script only loads in the first jpeg. I have tried everything and I jsut can't find a problem. Anyway my code is below if anyone gets a chance to look. Sorry its a bit hefty. I think the problem is with the ThumbLoadingEnterFrame and LoadNextThumb functions.
Any help much appreciated
Cheers
Code:
count = 0;
var thumbImage = new Array();
var thumbClip = new Array();
var jpegImage = new Array();
function ThumbLoadingEnterFrame() {
var lod = this.loader_mc.getBytesLoaded();
var tot = this.loader_mc.getBytesTotal();
if (lod && tot) {
var percent_loaded = lod/tot;
this.progress_mc._xscale = 100*percent_loaded;
if (percent_loaded == 1) {
LoadNextThumb();
delete this.onEnterFrame;
}
}
}
function LoadNextThumb() {
//trace(thumbImage.length);
if (count<thumbImage.length) {
var imgURL = thumbImage[count];
thumbClip[count].loader_mc.loadMovie(imgURL);
thumbClip[count].onEnterFrame = ThumbLoadingEnterFrame();
count++;
}
}
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var mySection = gallery_xml.firstChild.childNodes[0];
var picCount = mySection.childNodes.length;
for (var i = 0; i<picCount; i++) {
//Populate Arrays
count++;
thumbImage.push(mySection.childNodes[i].attributes.thumbURL);
jpegImage.push(mySection.childNodes[i].attributes.jpegURL);
tnHolder = _root.attachMovie("thumb_container", "tc"+count+"_mc", count);
thumbClip.push(tnHolder);
tnHolder.progress_mc._xscale = 0;
tnHolder._y = i*100;
}
count = 0;
LoadNextThumb();
} else {
trace("Error loading XML file");
}
};
gallery_xml.load("gallery.xml");
[F8] Preloading Many Thumbnails
I'm creating a thumbnail gallery which reads in data from an XML file. Currently I read in all the XML data in a for loop, put all the data into arrays, and create all the movie clips with the thumbnails. The only problem is that since I create all of the thumbnail clips in the for loop, the images are loaded like a website does it, and they pop up randomly one at a time on the screen until it's all complete.
I want to know how to find out when each finishes loading individually, so I can add to a counter and test to see if all xx of them have loaded. I've tried to use a MovieClipLoader in my for loop:
Code:
mcl = new MovieClipLoader();
createEmptyMovieClip("container", _root.getNextHighestDepth());
mcl["onLoadComplete"] = Delegate.create(this, thumbLoaded);
mcl.loadClip(thumbPath, _root.container);
which in theory should call the "thumbLoaded" method when the thumbnail is done loading. (The thumbLoaded method just traces a statement).
However, when I run the flash file, the thumbLoaded method is only called once, when the for loop has run its course. I do a trace in the for loop and a trace in the thumbLoaded method, and the for loop traces all complete before the thumbLoaded trace does.
I hope I didn't explain my problem too poorly. Can anyone help make sure all of the images get preloaded? The rest is easy enough to get the movie to play when they're all done, but I can only get it to say that one has finished.
Preloading Thumbnails?
hi, I´m very happy, that I found this Forum and that amazing Gallery of Scotty!
I would like to juse his resize image gallery, but I have one problem. I want to preload the Thumnails! So that the big images are preloaded within!
That means when a thumbnail is prelaoded it appears in another way and you can click it. The big image appears immediatly!
It would be fine when all the thumbnails are all shown directly with a Alpha of 20 or something like that, and the prelaoder fills the thumbnail vertical whit a Alpha of 100 %....
I sounds hard?! doesn´t it?
Maybe somebody of You experts has got a solution of this problem...
(sorry for my bad english, but my last english lesson is long ago...)
Preloading Thumbnails?
Hi,
My is as the following, i load thumbnails into a movie clip from an XML file, each thumbnail is in a MC in the tnails master MC, my problem is that i want to getBytesTotal() for the master MC and the MCs inside (for a preloader)?
I hope i described my problem well! i'll appretiate the usfull feedback.
_Jack
Preloading Thumbnails Issue
Hello,
Can someone look over this and tell me why the only Preloader that is working is the last one in the array? But when I trace the loading progress it shows each individual image as being loaded ?? Essentially I am calling a movieclip from the library. I have my preloader there.
Any help would be greatly appreciated.
Code:
var perRow:Number = 3;
var perCol:Number = 3;
var xspacing:Number = 100;
var yspacing:Number = 300;
var myImageArray:Array = [
["images/thumb_1.jpg"],
["images/thumb_2.jpg"],
["images/thumb_3.jpg"],
];
var myTextArray:Array = [
["Text 1"],
["Text 2"],
["Text 3"],
];
function createContainers(){
for (var j:int =0; j<myImageArray.length; j++) {
var newContainer:theContainer = new theContainer();
var row:Number = Math.floor(j/perRow);
var col:Number = Math.floor(j/perCol);
newContainer.x=j*xspacing-(row*(perRow*xspacing));
newContainer.y= row*yspacing;
addChild(newContainer);
trace(newContainer);
newContainer.containerText.text=myTextArray[j];
var imageloader:Loader = new Loader();
imageloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
imageloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
var myrequest:URLRequest=new URLRequest(myImageArray[j]);
imageloader.load(myrequest);
newContainer.addChild(imageloader)
}
function loadComplete(event:Event):void {
trace("Complete");
newContainer.loadingtxt.text="Complete";
newContainer.loadingtxt.visible=false;
newContainer.bar.visible=false;
trace(myImageArray);
}
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
newContainer.loadingtxt.visible=true;
newContainer.loadingtxt.text="Loading: "+percentLoaded+"%";
trace("Loading: "+percentLoaded+"%");
newContainer.bar.scaleX = percentLoaded/100;
}
}
createContainers();
Preloading Multiple Thumbnails Question
If you wanna see what I'm tryin to do, go here (temporary location).
When you visit the gallery section, 2 buttons will appear. Once you click on, I want to display a preloader that will be 100% whenever all of the thumbnails in the following section have loaded. I'm already using xml for my image gallery so I'll probably do the same for bringing in the thumbnails. They'll be there, all in the same spot, visibility triggered by onRollOver.
I have no idea how to go about doing that. Any tips, pointers?
Thanks!
~Jimothy
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!
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.
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
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.
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
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 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!
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 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!
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 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();
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 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.
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?
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?
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 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
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...
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
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
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;
}
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!
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 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?
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
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?
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
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>
Text Over Thumbnails: Adding Thumbnails Photo Gallery Using XML And Flash Tutorial
So I went through the adding thumbnails supplement to the XML Photo Gallery (http://www.kirupa.com/developer/mx2004/thumbnails.htm) and it works great. I wanted to put the label of the image over the thumbnail when the user mouses over the thumbnail. Any thoughts on how to do this? I want it to look like these thumbnails http://www.commonskymedia.com/index.html#reel. Thanks!
Thumbnails Tutorial - How Can I Make The Thumbnails Scroll By Default?
i have modified the xml photogallery on my site as i only want to use the scrolling thumbnail component but as a tool to scroll images.
2 modifications i would like to make that have me stuck!
1) how can i make the thumbnails scroll by default on load?
2) how can i add a little preloader within the empty thumbnail holder movieclip? i am loading the main gallery images directly into this clip rather than using it to display thumbnails
many thanks in advance if you can help!
natalie
Preloading Before Killing The Content Inside "mcholder"
I use "mcholder" to load my external SWFs.
Everything works well.
The problem is when I load something at "mcholder" the content inside
it (any external SWF) disappears and THEN the preloader begins preloading.
How do I preload it before killing the content inside "mcholder"?
Here is the code I'm using:
#################################
stop();
function menuload(movie) {
_root.mcholder.loadMovie(movie+".swf");
_root.loading.bar._xscale = 0;
_root.loadsystem.onEnterFrame = function() {
if (_root.mcloader.getBytesLoaded()>=_root.mcloader.g etBytesTotal() && _root.mcloader.getBytesTotal()>10) {
_root.loading._visible = false;
_root.holder.gotoAndPlay(2);
delete this.onEnterFrame;
}
if (_root.mcloader.getBytesLoaded()<_root.mcloader.ge tBytesTotal()){
_root.loading._visible = true;
}
_root.loading.bar._xscale = (_root.mcloader.getBytesLoaded()/_root.mcloader.getBytesTotal())*100;
};
}
#####################
thanks.
Content "blinks" After The Preloading
I have created a preloader class. The main movie has two frames: An empty one and a second one with MCs. The class says "gotoAndStop(2)" on event complete.
Everything works as expected, BUT
On my second frame, I'm setting the alpha values to 0 (of every MC on the stage). Also, I use some scaleX and scaleY.
They all don't work for a moment.
Right after the proloading completed, all MCs shows themselves for a moment (like 0.5 seconds). After 0.5 seconds they all disappear (my "alpha" values start working...)
Why is it happening? Is there a solution to stop the "blinking"?
I know it's because of the preloading. But I don't know why.
Thanks,
POV
Extra Thumbnails To "Adding Thumbnails"
I've searched the forum but there is not a certain solution. (http://www.kirupa.com/forum/showthre...tra+thumbnails)
I am trying to add the gallery extra thumbnails to use as extra information. Shortly trying to make a little thumbnail which will be change when clicked the main thumbs as the example below..
Thanks for your help if u can...
External Content Loader With Multiple Content Types (trouble Loading Graphics)
Hey all!
I am yet another new project. Our flash designer here isn't a big AS guy, and asked me to write a reusable class so that he can load a variety of content types using minimal amount of code on his part. It's also going to be the main component piece in a larger external content player once I'm done with the class itself, so I am making the loading functions into public methods of the loader object than can be called from a button, etc.
I have the code for the text and html parts working (although I can't get stage.width and stage.height to work in the class or from the frame).
The problem I have is that I can't get the graphics content to load (the swf/pic content). Could you please check my code and tell me what I'm missing? I'm sure it's something simple, like it always is.
thanks a million!
-Fish
-----------------------------
ActionScript Code:
package
{
/**
* External Multimedia Loader Class
* @author $(DefaultUser)
* Add new MultiLoader object and insert media type (all lowercase) and object path to control initial loaded object
* To load a new object, call the MultiLoader.load* methods (loadText, loadPic, loadSwf, or loadHtml as appropriate), passing the path to the external file.
*/
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
public class MultiLoader extends MovieClip
{
private var media:String;
private var path:String;
public var textObj:TextField = new TextField;
public var picObj:MovieClip = new MovieClip;
public var swfObj:MovieClip = new MovieClip;
public var htmlObj:TextField = new TextField;
private var objLoader:Loader = new Loader();
private var objType:String;
private var textLoader:URLLoader = new URLLoader();
public function MultiLoader(mediaType:String,objPath:String)
{
media = mediaType;
path = objPath;
if (media == "text" || media == "TEXT" || media == "Text")
{
loadText(objPath);
}
else if (media == "pic" || media == "PIC" || media == "Pic")
{
loadPic(objPath);
}
else if (media == "swf" || media == "SWF" || media == "Swf")
{
loadSwf(objPath);
}
else if (media == "html" || media == "HTML" || media == "Html")
{
loadHtml(objPath);
}
else
{
trace("ERROR: Media type not supported. Media type must be 'text', 'pic', 'swf', or 'html'.");
}
}
public function loadText(txtPath):void
{
objType = "text";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(textObj);
this.textLoader.load(new URLRequest(txtPath));
this.textObj.wordWrap = true;
this.textObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
//this.textObj.width = this.width;
//this.textObj.height = this.height;
}
public function loadPic(picPath):void
{
trace("loadPic started");
objType = "pic";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(picObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(picPath));
trace("loadPic completed");
}
public function loadSwf(swfPath):void
{
trace("loadSwf started");
objType = "swf";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(swfObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(swfPath));
trace("loadSwf completed");
}
public function loadHtml(htmlPath):void
{
objType = "html";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(htmlObj);
this.textLoader.load(new URLRequest(htmlPath));
this.htmlObj.wordWrap = true;
this.htmlObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
}
private function removeAllChildren():void
{
if (objType == "pic")
{
this.picObj.removeChild(objLoader);
}
else if (objType== "swf")
{
this.swfObj.removeChild(objLoader);
}
else
{
trace("objType != 'pic' or 'swf.' objType = '" + objType + "'.");
}
while ( this.numChildren > 0 )
{
this.removeChildAt(0);
}
}
private function addObjLoader(event:Event):void
{
trace("addObjLoader started");
if (objType == "pic")
{
trace("trying to load pic");
this.picObj.addChild(this.objLoader);
this.picObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else if (objType== "swf")
{
trace("trying to load swf");
this.swfObj.addChild(this.objLoader);
this.swfObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else
{
trace("ERROR: Cannot add object loader. The 'objType' variable does not contain correct media type. The function 'addObjLoader' should only be called when objType is 'pic' or 'swf'. In this case, objType is '" + objType + "' .");
}
trace("addObjLoader completed");
}
private function addTextContent(event:Event):void
{
if (objType == "text")
{
this.textObj.text = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else if (objType == "html")
{
this.htmlObj.htmlText = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else
{
trace("ERROR: Cannot add text content. The 'objType' variable does not contain correct media type. The function 'addTextContent' should only be called when objType is 'text' or 'html'. In this case, objType is '" + objType + "' .");
}
}
}
}
Help Needed In Clearing The Content Of The XML File Content Displayed In The Flash
I have developed a flash file with combo box which displayes all the XML files in the directory and after selecting a particular XML file the flash file reads the XML file and displayes the content of the XML file in flash in a fashion I have done. But, if I chose another XML file which is a blank XML file, still the flash file shows the previous file's content in the flash. How to clear that previous file's content?
If I chose someother XML file which is having some content then it shows correctly. But, if I chose some blank XML file, the flash file shows the previous content instead of showing it blank. pls help me how to clear the previous file contents?
Why Does Flash Re-load Content When Content Within Hidden/shown Area?
Hi all,
A purely academic question for someone about how Flash loads. I've written a simple Flash image scroller script, see: http://www.benjaminkeen.com/software/image_scroller/
On the page above, I separated the various content (installation instructions, demo, download file, etc) into separate pages, which get hidden/shown via JavaScript. Very straightforward.
My question is: why, when you go from the "Overview" to "A few examples" sections (both of which have a demonstration scroller), does the flash get "re-drawn" each time? I don't understand - I thought that it would simply get loaded the first time the browser calls it - not every time the content becomes display:blocked through javascript...?
I guess my follow up question is: can this be prevented?
Scroll Pane Content - Accessing Values Within Content Mc
hey all -
i'm having a bit of a problem. i need to access the .text value of various text fields within a mc that is presented in a scroll pane. i need to check the value against another value, and i'm having trouble grabbing it.
here's what's not working:
//within a for loop where "i" is incrementing
myContent = scroll_pane.getScrollContent();
myText = eval(myContent + ".text" + i +"_txt");
trace (myText.text);
when I run this, myText ends up equal to: _level0.scroll_pane.tmp_mc.text10_txt
where i=10 in this case (all the others increment no problem)
however, if I trace (myText.text) I get nothing (not undefined, just nothing). however, if i forcibly trace(_level0.scroll_pane.tmp_mc.text10_txt.text), it will show me the .text of this text field.
any ideas as to what is happening here?
thanks
oh - flash mx on os x
Hiding/Masking Off-stage Content (external Content)
Hi,
I'm loading an image gallery into another movie. The image gallery itself uses XML to generate a row of thumbnails dynamically. In it's own player, this is fine, but when loaded into the larger movie, the row of thumbnails extends far beyond the container clip.
I've set the size of the container clip with an onLoad function, but I have no idea how to appropriately mask it so there is no spillover. Using a mask in the gallery clip doesn't work because the gallery is 100% scripted (unless I'm missing something terribly basic).
Is there a general method to use, aside from creating infinitely large opaque boundaries around the stage?
Thanks for any tips or insight!
AS3 Loader.content Access To Partially Loaded Content
I have a main swf that loads an external swf. The external swf is a fairly large video embeded on the timeline.
Ive got my Loader all setup correctly, handling PROGRESS, COMPLETE and INIT events all fine.
What id like to do (which i could do in AS2 very easily) is start the playing and accessing variables in the loaded swf before it finishes loading. If i do these things when the video swf is loaded completely, everything works fine.
Any attempt to access Loader.content or the container clip ive placed Loader.content in, BEFORE its finished loading (when it reachs, lets say, 20%), i get error:
#2099 The loading object is not sufficiently loaded to provide this information.
Anyone have any ideas on how it could be possible to start messing with loaded SWF content before all of its frames are loaded? Thanks in advance for lookin over my post!!
Content-Length Of Mp3 Not Receving Form Content Server
Hi,
we have develop one course using flash player 7 and action script 1.0 in macromedia flash. In this course we are facing one problem with mp3 file. we have used sound object to load external MP3 files. When these files are downloaded from content server we are not reciving content-length for this file in IE 6 + Flash player 8. If anybody knows the solution for this problem Please help me.
thsnks in advance..........
Not Reciving Content-length Of Mp3 File From Content Server
Hi,
we have develop one course using flash player 7 and action script 1.0 in macromedia flash. In this course we are facing one problem with mp3 file. we have used sound object to load external MP3 files. When these files are downloaded from content server we are not reciving content-length for this file in IE 6 + Flash player 8. If anybody knows the solution for this problem Please help me.
thsnks in advance..........
|