Loading
I loaded my flash movie into dreamweaver to post on the web. How do I get a little box that says loading while the page loads the movie. Or better yet, one that tells you how long until it loads.
FlashKit > Flash Help > Flash General Help
Posted on: 05-09-2004, 09:09 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Small Flash File Loading Into HTML - Weird Sporadic Loading
Hi,
I'm hoping someone can help...
I have a very small Flash file (less than 5k) loaded into a table cell of an HTML page .
On occasion (on Mac/IE) there is a flash of white appears in the table cell before the file starts. On other occasions only a portion of the file appears (while the rest of the cell is white). And at other times, none of the file appears (the table cell that it's in is appears as white).
The background of the flash file is orange (not white) so I guess that means that none of the Flash has loaded. Sometimes when I refresh the page, the problem resolves itself.
Does anyone know what the problem may be? Is there any sort of pre-loading JavaScript that would help, even though the file is very small to begin with?
Thanks for any help, I really appreciate it!
Loading Multiple Swfs And Xmls Started Before Finished Loading
Hi,
I have a encounter a problem regarding loading of the swfs and xmls files.
A preloader is done for these items. However it started playing before everything (swfs and xmls files) is loaded.
I have an array to contains all the files to be loaded. Using this array, i checked and see if the items are all loaded. If loaded, they will jump to the ready frame.
Anyone have any idea what is wrong??
Thanks.
Q On Loading Techniques Tutorial Http://www.kirupa.com/developer/mx/loading.asp
Well i was looking over
http://www.kirupa.com/developer/mx/loading.asp
And i got pretty stumped over when loading a mp3
I have 5 layers
and a mp3 named chillbeat.mp3
do i create a 6th layer for the code and just put it there???
and if i have a button to play it where would i put this
mySound = new Sound();
mySound.loadSound("music.mp3",true);
is that just the WHOLE CODE for that load mp3 process??
Combining External SWF Loading With Dynamically Loading Text Tutorial
I am trying to combine the external SWF loading tutorial with the dynamic text loading (via XML and CSS) tutorial.
Everything loads fine, except the stylesheet is not applied to the text. It must have something to do with the swf being externally loaded, correct?
Any ideas how to fix this?
Here is the code for Frame 1 of the externally loaded swf.
Code:
//init TextArea component
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite=true;
//load css
kungFuStyle = new TextField.StyleSheet();
kungFuStyle.load("example.css");
myText.styleSheet = kungFuStyle;
//load in XML
kungFuContent = new XML();
kungFuContent.ignoreWhite = true;
kungFuContent.load("example.xml");
kungFuContent.onLoad = function(success)
{
if(success)
{
myText.text = kungFuContent;
}
}
midframe=10
All the files are in the same dir.
Loading A Frame In _root And Also Loading An External Movie Problems.
First of all, hello everyone and nice to meet you
I have been hacking at a problem for a couple of days now and I am in need of help to solve it. Please excuse my noobishness, but I have a lot to learn when it comes to flash.
Here is my scenario:
I have my main movie (_root)
In the actions layer of my main movie I have:
Code:
this._lockroot = true;
I have a button that loads a new external movie at the end of which I want to load a particular frame in the main movie. I call this from the external movie:
Code:
on (release) {
_root.gotoAndPlay(610);
}
Everything up to here works brilliantly....But my problem arises when I also try to load an external movie onto level 5 at the same time as I am instructing the main movie to play frame 610 from an external movie. I want the external movie to call frame 610 in main, and also load a new external movie on level 5 in the main movie. I have tried about every way of loading movies that I can think of but I can never get the external movie to load along with frame 610 of the main movie. I even tried _root.loadMovieNum("myexternalmovie",5) right after my first root call, like this:
Code:
on (release) {
_root.gotoAndPlay(610);
_root.loadMovieNum("myexternalmovie",5)
}
Is that possible or do I have to approach this entirely differently? Thanks for any responses
Help Problems Loading External Text And Loading The Movie Into The Explorer
Hola a todos!
I have some troubles with my movies. I'll explain.
(Sorry for my poor English - I'm Spanish!)
I'm developing a website for a Real State Agency in Spain. My idea is make it enterely with Flash, but It's the first time I face Flash. I've found in the tutorials of kirupa.com the greatest help! But, still that, I need more help!
My first problem comes when loading the .swf into the explorer. I made a simple .html file that calls the .swf file to be loaded. The explorer says it's loaded, but I have to press the "Reload" button to see the movie. Can you say me why?!!!!
My second problem... well. I'll need a few minuts to explain it!
I have created a main scene. Inside the main scene I load the movies of the different sections of the site. This new movies loaded onto the main movie contain texts from external .txt files. There's no problem with the texts that are just a few words, as in the section "Acerca de". But when I need a bar to show the whole text I find that the bar doesn't work in the first time that the movie is loaded, and you have to click again in the section to access the whole text, I mean, to make the bar work. Have I explain myself?
Well. I think you should visit the site to see my problems.
Is this: http://www.wk-inmobiliaria.com/FLASH
This website is, of course, incomplete. I'm still working on it.
Could someone help me????
---- Help me Obi Wan: You're my only hope!!!!
Thanks a Lot.
Raul.
Combining External SWF Loading With Dynamically Loading Text Tutorial
I am trying to combine the external SWF loading tutorial with the dynamic text loading (via XML and CSS) tutorial.
Everything loads fine, except the stylesheet is not applied to the text. It must have something to do with the swf being externally loaded, correct?
Any ideas how to fix this?
Here is the code for Frame 1 of the externally loaded swf.
Code:
//init TextArea component
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite=true;
//load css
kungFuStyle = new TextField.StyleSheet();
kungFuStyle.load("example.css");
myText.styleSheet = kungFuStyle;
//load in XML
kungFuContent = new XML();
kungFuContent.ignoreWhite = true;
kungFuContent.load("example.xml");
kungFuContent.onLoad = function(success)
{
if(success)
{
myText.text = kungFuContent;
}
}
midframe=10
All the files are in the same dir.
Loading Bar That Shows Loading Time Of HTML Page Not The Movie
Hi,
I have a flash intro that I'm using for my site, but I would like to (if possible), have an intro HTML page that uses JS to pre-load the images on the site and show my loading FLASH movie while the page pre-loads.
I would like the flash movie's loading bar to reflect the images that are pre-loaded on the HTML page.
Question-1: Is that possible to do?
Question-2: Where do I start? I don't even have a loading bar. All I want is just a simple rectangle that has a bar inside that moves from left to right indicating that the page is almost finished loaded. Then when the page has pre-loaded the images I need it to re-direct to the main page.
Can someone help me accomplish this, or tell me where to find out how to do this.
Thanks!
NATE
design@spyderix-designz.com
http://www.spyderix-designz.com
Loading .swf Files While Main Movie Clip Is Loading
Hello,
I know How to do a Loadmovie command, but I can only get it to work when I goto the Movie Clip that I have that command in. For ex:
In movie clip B I have a command: loadMovie ("Submovie.swf", "_root.MovieClipB");
Which works fine.
What I want to do is while movie clip A is playing I what a command to Start the Load movie function into MovieClip B.
I have tryed many diff. commands and Cannot get it to work
Any help?
Thanks
Movie Loading Into Bankmc Is Loading Blank After Its Been Published
I created this site where it loads movies into a blankmc on in the main Fla file. It works fine when I view it on my computer. And Broadband connections show no problem. But on dial up connection. when you click a bar on the navigation. The fla movie loads in blank. You have to click another button then click on the previous but to load. Why is that?
here is the site (its for some community developer)
Doubletree Lake Estates
Thanks for you time..Let me know if you need to see the file and I'll attach it.
Patrick
Loading Components Externally- Site Loading Problems
Hi there!
i learned a little while ago something new about components.Intialli noticed that with afew sites i had made that when i loaded the sites up.I would have about a 10 second delay or so before even the preloader would kick in properly.I was then asked by someone at Flash kit if i was using any components.Turns out i was.Basically now the site in question i am using a textfield and text scroller, so components i guess these are called. Anyhow for some weird reason i guess these are what are giving me that small pause before the loader actually kicks in. So I was told i should load the components in an external swf.How exactly does this work then? What kind of set up do i need to make for this.First i have the preloader which is included in my main site swf.All of the components are also included within the main site swf.And then i have 28 external swfs with photos in each of them. If someone has any good pointers on how this could be set up right please lets me know.
To be honest this site in question that im working on is really catered for Cable users.So you dont really even notice this little pause before preloader problem.But i still would like to figure this out for the odd joe who is still on a 56k.
Cheers!
Chris
test Site can be seen at www.vistakuva.fi/ju
Loading Dynamic Textbox While Dynamically Loading Movie
Hi All,
So, I've got a movie on the stage (but offstage) called: Card. Inside this MC is a dynamic textbox called: CardName. I'm using a for loop to create a column of cards w/ their corresponding textboxes.
Here's the code:
for (var j = 1; j<=6; ++j)
{
var name = "Card_"+j;
var y = (j-1)*game.spacingY + game.originY;
game.path.attachMovie("Card", name, ++game.depth);
game.path[name]._x = x;
game.path[name]._y = y;
game.path[name]._width = game.cardSizeX;
game.path[name]._height = game.cardSizeY;
game.path[name].CardName.text = "card #" + j;
}
The cards and the textboxes inside the card MCs load fine but the actual textboxes don't change from the default text I've hard-coded in. How can I reach the dynamic textbox inside the card Movie Clip to manipulate the text.
Thanks.
Problem With Loading New External Mc Before Existing One Has Finished Loading
Hi all,
I've been building a flash website which loads various external movieclips with preloaders into a main movie using either target or level. All is working fine, except when a user clicks on a button to load an external movieclip (the button actually goes to a frame label and then said frame contains the loadmovie action), but then decides to click on another button which loads another movieclip before the original has finished loading. This basically breaks flash, causing the movieclips to start looping erratically (even though I have stop actions in place).
Obviously this problem doesn't occur when I test locally, but please follow this link to see what I mean. Click on the 'locations' or 'recent shoots' sections and then try to load a new movie before an existing one has completely loaded:
http://www.david-vernon.co.uk/365_2/365.html
Now I've experimented with adding 'unloadmovie' to buttons and frames to no avail (though as I'm loading new movies into the same target this shouldn't be the problem surely?), so my only thought is that the preloader actionscript might be causing a problem. Here's the actionscript I'm using on frame 1 of all my external movies:
Code:
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded() >=getBytesTotal()) {
play();
clearInterval(myInterval);
}
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;
percent.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";
}
I'm not very good with actionscript and I'm really stumped with this, so any help would be greatly appreciated!
Thanks,
Dave
Dynamic Loading Text File Not Loading Correctly
I am loading info from a text file (noticeBoard.txt) using the following code;
sourceTXT = "noticeBoard/noticeBoard.txt";
nodeSource = new LoadVars();
nodeSource.onload = gotoAndStop(printText);
nodeSource.load(sourceTXT);
Then writing it into a textfield when the timeline moves to the 'printText' frame.
The swf is working when I load my html page (notice.htm), with all my values being displayed. If I then navigate away from this page to one where I write more info to the text file and then return to notice.htm the latest info in the text file does not show in my swf. Even if I refresh the html page the new info does not appear until I shut my browser window then reopen it.
Does anyone have any suggestions to why this info is not coming in on the fly?
Thanks
Loading Two Movies & Loading Entire Current Movie
well, having a bit of problems with figuring out my preloader :/. Iv been able to figure out how to load a single external movie with a dynamic preloader graphic that tracks percent and stuff, but i have not been able to figure out how to load multiple external files but useing the same graphic to track the percentage of the loading for the two as if they where 1. Also have not been able to figure out how to make a preloader for the current movie. LIke have the preloader at the beginning of the movie and have it stop, and run the preloader for the load of the rest of the movie file, then continues to play the intro of the same file after loading has been compleated. my code for what i'm able to do is below, any help woudl be helpfull :). Thank you guys and girls^^
Attach Code
var requestObj:URLRequest = new URLRequest ("waterIntroAnimation.swf");
var loaderObj:Loader = new Loader();
loaderObj.load(requestObj);
b1.visible=false;
loaderObj.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,preloadProgress);
loaderObj.contentLoaderInfo.addEventListener(Event.COMPLETE,preloadComplete);
function preloadProgress(event:ProgressEvent):void{
var loadedPercent:int = event.bytesLoaded/event.bytesTotal *100;
preloader_mc.loadingBar_mc.loaderText_txt.text=loadedPercent+"%";
preloader_mc.loadingBar_mc.loaderMask_mc.scaleY=loadedPercent/100;
}
function preloadComplete(event:Event):void{
preloader_mc.visible = false;
b1.visible=true;
}
External Swf Loading Into Target Movieclip Loading Problem
Hi Everyone,
Can someone please help me...
I’m trying to load a SWF movie into a target movieclip called ‘blankmc’.
The SWF movie is loaded from an absolute URL (eg. http://www.somedomain.net/img/20042005113934movie3.swf )
My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG!
Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
//EXAMPLE CODE:
loadMovie( URL ,"blankmc");
blankmc.getBytesLoaded() ;
blankmc.getBytesTotal() ;
//This works with JPGs but not SWFs
Thanks in advance!
J
ps. i am using Flash MX
Loading External Images Loading Bar (Movie Clip)
I have managed to have external images loaded with the progress bar. However, when I place these items into a movie clip the preloader no longer works. can someone please take a look at the flash file for me.
http://www.bloggot.co.uk/file.zip
Showing Total Progress Of A Loading MC And A MC Loading Inside Of It.
When entering a page I want a main.swf to load, using the MovieCLipLoader. When main.swf has completed loading, it automatically starts loading another swf, home.swf, into itself in a specific area.
I want to display the total download progress of loading the main.swf and home.swf.
First when the whole download progress is done, I want the main.swf together with the home.swf to be visible.
Any ideas on how to do this ?
External Swf Loading Into Target Movieclip Loading Problem
Hi Everyone,
Can someone please help me...
I’m trying to load a SWF movie into a target movieclip called ‘blankmc’.
The SWF movie is loaded from an absolute URL (eg. http://www.somedomain.net/img/20042005113934movie3.swf )
My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG!
Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
//EXAMPLE CODE:
loadMovie( URL ,"blankmc");
blankmc.getBytesLoaded() ;
blankmc.getBytesTotal() ;
//This works with JPGs but not SWFs
Thanks in advance!
J
ps. i am using Flash MX
Loading Main Timeline Diff. From Loading External Swf's?
Last edited by enkriptid : 2008-06-30 at 04:16.
hey peoples, im still learning how to load things , my methods are working so far..
what ive been doing to load external swfs is using a intermediate "loading swf" that works between the main timeline and the desired swf to be loaded.. so far it works and is simple enough for me to work with now, but my question is, how do i go about preloading the main timeline if there are mc's being exported .. i tried my previously mentioned method but no dice.. if theres a rock-solid technical answer id like that..my goal is to have most of my site(illsci.com) in actionscript .as files, doc. classes and xml as of now so im looking for a method i can implement using script if i can, if there is one. perhaps a metatag trick of some sort
Loading Flash AFTER Html Finishes Loading - IE Not Working
Im using some javascript to load a flash music player after the rest of the gfxs have loaded (IE was trying to load the first song while the gfx were loading & was slowing the page load down to a CRAWL) ... I found this code on the web & THINK I did it right.
in my onLoad I have window.document.soundPlayer.setVariable('loaded', 'true');
my object is named soundPlayer
Then in my Flash (using MX if it matters) I have 3 blank keyframes at the beginning of the movie. In the first keyframe I have a dynamic text box called loaded with the var set to false. The in the 2nd keyframe I have this actionscript:
if (loaded == "true") {
gotoAndPlay (4);
}
then in the 3rd keyframe I have this code:
gotoAndPlay(2);
It works fine in ALL browsers except IE. In IE the movie is just sitting there flashing on & off even when everything else has loaded. I cant actually tell if its working right in the other browsers because Im testing it on my local machine but it loads & starts playing .... more than I can say for IE!
Any ideas on this one? Im not a flash guru ... only use it when a customer cant live without it! Thanks
Help, It Keeps Loading From The 1st Loading Scene When The Site Is Online
Please Help? I made a flash site with intro, main page and several sub-pages. Each sub pages is a seperate swf file with loading scene above it. And the main page contains 3 scenes...first is preload scene, second is intro movie and the last is the main page layout. It works perfectly in my local computer, when I upload online...things mess up...After the into movie and main page scene fully loaded and played...when I tried to click into the sub pages...it could not go to sub page loading scene...rather than it jumps back to the very first intro loading scene...it keeps happen the same thing until the whole sub pages movie were loaded. Question? How can I fix this problem...I am thinking is the mistakes of the loading scene. I am so confuse right now...don't know how to do...interesting is, it works perfect locally and totally mess up when the site is online...
Loading Pictures From A File Like Loading Text..how To Do It?
I don't know if this is possible...but I'll ask it anyway.
I know how to load text into a flash movie from a text file, (the load variables function), but is it possible to load an external picture file, like a jpg or a gif in the same way without using the flash program?
If it's possible, can someone please tell me how it is done?
Thanks,
JRL
http://www.xtranix.com
Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.
///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");
myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door
var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");
//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};
stop();
}
function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture
----------------------------
Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?
Loading Order - Dynamically Loading Images
Flash 5
I am trying to control the loading order of dynamically loading images. If I have 12 placeholders (4 columns by 3 rows) for the images (e.g. 12 instances of a movie clip) each of which loads a different JPG or SWF. I want the 1st instance/placeholder to completely load the image dynamically before the next instance starts to load the next image and so on. How can I ensure image1 is dynamically loaded before image2 and then image3 etc...
If I put each instance on a separate frame on the timeline will it stop on each frame until the instance is loaded before moving onto the next frame? I have seen the effect im trying to recreate on both:- www.rui-camilo.de and www.andyfoulds.co.uk
Many Thanks in advance.
Dynamically Loading MP3 ... Loading Details In Text Box ...
Hi, I am loading an MP3 dynamically in Flash ... but am having problems get'n the bytesLoaded to show in my text box. I've tried changing it round heaps ... pullin apart others ... what's the trick?
I'm an intermediate user and have double checked all the basic's ...
What am I missing?
wanna see me coding? Here:
Code:
mySounda = new Sound();
mySounda.loadSound("Track2.mp3",false);
loadBytes = Math.round(mySounda.getBytesLoaded()/ 1024);
loadTotal = Math.round(mySounda.getBytesTotal()/ 1024);
percent = Math.round((loadBytes / loadTotal)* 100);
textd = percent + "% Loaded";
mySounda.onLoad = function(success){
mySounda.start(0,1);
textd = mySounda.id3.TIT2;
playing=true;
}
And all I get in the text box is: "100% Loaded"
Even when I do a streaming view.
Anyone?
Loading Xml Data - The Rest Of The Movie Is Not Loading
I have a custom FLV player that loads an XML file from our server to get the movie details, then once the data is successfully loaded the swf advances to frame 2 where the player loads the flv and the interface (stop FF, RW, etc.) Problem is that when I load the swf the first time, all of the XML is successfully loaded (I know from trace that all vars are set...), and the swf advances to frame 2 to actually show the movie and controls but it is a blank screen. if you refresh the page that contains the swf, everything loads fine. This has only begun since I added the XML functionality, so I am thinking the XML loading is the reason but I can not for the life of me figure out...
has anyone else experienced a similar problem?
the swf player is only 11k so I know it should be loading fine...
see example below:
http://www.vidrokker.com/viewpage/NzA%3D
Any input is greatly appreciated,
-nathan
example below:
MC's Within MC's Different Behaviour Betewen AS-loading And Stage Loading?
Sorry about the too long topic title, but it sort of got even more incomprehensible when I made it shorter.
Now, on to the problem:
I've got a movie clip that consists of a few other movie clips. This is to maintain a certain degree of order in the chaos.
I use action script to load the container mc on the stage. Now I want to change some properties of on of the contained mc's, but they seem to be unreachable.
So I did a little testing and I found out that when you just place an instance on the stage, those contained MC's are accesable, you can see in the debugger that the container MC contains other stuff.
But if the MC is loaded with attachMovie(), the debugger does not show that the container has other mc's within it, and therefor I cannot change the properties of those mc's.
Any thoughts about how I can solve this problem?
PS. Of course I can give up this ordering business and just attach multiple movies. Although this circumvents the problem, I would prefer not to do this because:
1. I'd like to stick to the 'certain degree of order'.
2. I wish to learn how this works.
Sequencial Imagem Loading To Random Loading
I've downloaded a free script that reads several JPG files and it makes a sequencial slideshow.
This is the function used:
ImageFader.prototype.loadXML = function (x) {
var _xml = new XML ();
_xml.ignoreWhite = true;
_xml.path = this;
_xml.load (x);
_xml.onLoad = function () {
for (var a = 0; a < this.firstChild.childNodes.length; a++) {
var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
var _pause = this.firstChild.attributes.PAUSE
var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
this.path._dataProvider.push ({img:_img, transition:_trans, pause:_pause});
}
this.path.startFading ();
delete this;
};
};
My question is...
How to change that script to it loades random jpg from the xml in stead if loading img1, img2 from xml.
Anyone can help ? Thanks in advance
[AS] Loading Main Image While Loading Thumbnails
Hello,
I've got a custom gallery of sorts going on and there's a problem with it... There's 146 photos that have thumbnails loaded in and when clicked open up a larger photo in the presentation.
What happens is while the thumbnails are loading, if one that has loaded is clicked, the main image movieclip runs, but the photo itself doesn't load. It won't load until all the thumbnails are loaded in.
Is there a way to tell the clip to load it too? Or interrupt the thumbnail loading process then restart once the loaded image has completed?
Here's what I'm using...
[Thumbnail loader]
ActionScript Code:
stop();
var tSpacer:Number = 100;
var imagesT:Array = [];
var imagesM:Array = [];
var thisWid:Array = [];
var thisHgt:Array = [];
var imgNum:Number = 0;
var loadthis = "http://www.hpiracing.com/swf/2007/b2v/photoloader.php";
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = parseMe;
import flash.display.*;
function loadBitmapSmoothed(url:String, target:MovieClip)
{
// Create a movie clip which will contain our
// unsmoothed bitmap
var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
// Create a listener which will notify us when
// the bitmap loaded successfully
var listener:Object = new Object();
// Track the target
listener.tmc = target;
// If the bitmap loaded successfully we redraw the
// movie into a BitmapData object and then attach
// that BitmapData to the target movie clip with
// the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip)
{
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);
bitmap.draw(mc);
};
listener.onLoadStart = function(targetMC:MovieClip)
{
//trace("started loading "+targetMC);
targetMC._parent.mc_photoPreloader._visible = true;
targetMC._parent.mc_photoPreloader._width = 0;
};
listener.onLoadProgress = function(targetMC:MovieClip, lBytes, tBytes)
{
targetMC._parent.mc_photoPreloader._width = (lBytes/tBytes)*100;
};
listener.onLoadComplete = function(targetMC:MovieClip)
{
border._visible = false;
targetMC._parent.mc_photoPreloader._visible = false;
};
// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
function parseMe(success:Boolean):Void
{
trace("XML Loaded");
if(success)
{
thisChild = this.firstChild.firstChild.childNodes;
numItems = thisChild.length;
//trace(thisChild);
//trace("Loading " + numItems + " XML entries...");
for(i=0; i<numItems; i++)
{
//trace(thisChild[i].childNodes[1].firstChild.nodeValue + "
");
randMax = 5;
var rotRand:Number = random(randMax);
var rotRand2:Number = random(randMax);
if(rotRand > (rotRand/2))
{
rotRand2 = -(rotRand2);
}
mc_photoholder.attachMovie("mc_photoLoader", "mc_photoLoader" + i, mc_photoholder.getNextHighestDepth());
mc_photoholder["mc_photoLoader" + i].mc_photoPreloader._visible = false;
mc_photoholder["mc_photoLoader" + i]._y = (tSpacer * i) - 5;
mc_photoholder["mc_photoLoader" + i]._x = rotRand2;
mc_photoholder["mc_photoLoader" + i]._rotation = rotRand2;
//trace("Loading clip " + thisChild[i].childNodes + " into " + mc_photoholder["mc_photoLoader" + i].mc_photohere);
imagesT.push(thisChild[i].childNodes[0].firstChild.nodeValue);
imagesM.push(thisChild[i].childNodes[1].firstChild.nodeValue);
thisWid.push(thisChild[i].childNodes[2].firstChild.nodeValue);
thisHgt.push(thisChild[i].childNodes[3].firstChild.nodeValue);
//var thisWid:Array = [];
//var thisHgt:Array = [];
}
loadImages();
}
}
function loadImages():Void
{
var imgTotal:Number = imagesT.length;
//trace("imgTotal = " + imgTotal);
loadImg = imagesT;
loadBigImg = imagesM;
widths = thisWid;
heights = thisHgt;
for(j = 0; j < imgTotal; j++)
{
thisMc = _root.mc_photobarleft.mc_photoholder["mc_photoLoader" + j];
thisMc._highquality = 2;// = true;
thisMc.which = loadBigImg[j];
//trace("W = " + widths[j] + " and H = " + heights[j]);
thisMc.thisWid = widths[j];
thisMc.thisHgt = heights[j];
//trace("Which = " + thisMc.which);
loadBitmapSmoothed(loadImg[j],thisMc.mc_photohere);
thisMc.onRelease = function()
{
//trace("MC was clicked.");
var bigPicHolderMC:MovieClip = _root.mc_photoBigAnim.mc_bigPhotoHolder.mc_photoBigLoader;
var bigPicMC:MovieClip = bigPicHolderMC._parent._parent;
var bigPicFrameNo:Number = bigPicMC._currentframe;
//trace("Current Frame = " + bigPicFrameNo);
if(bigPicFrameNo == 1)
{
bigPicMC.play();
}
bigPicMC.which = this.which;
bigPicMC.thisWid = this.thisWid;
bigPicMC.thisHgt = this.thisHgt;
//trace("Which = " + this.which);
bigPicMC.unloadPhoto();
bigPicMC.loadBigPic();
}
}
}
mc_photodragger.onPress = function()
{
this.startDrag(false,108,0,108,250);
}
mc_photodragger.onRelease = function()
{
this.stopDrag();
}
mc_photodragger.onReleaseOutside = function()
{
this.stopDrag();
}
mc_photodragger.onEnterFrame = function()
{
//trace(this._y);
}
mc_photoholder.onEnterFrame = function()
{
//0 - 250
var maxDrag:Number = 250;
var curDrag:Number = mc_photodragger._y;
var perc:Number = Math.round(((curDrag/maxDrag)) * (this._height - maxDrag - tSpacer));
//trace("Perc = " + perc)
this._y = -(perc);
}
trace("Loading XML");
myXML.load(loadthis);
[Main Image Loader]
ActionScript Code:
var which:String;
var thisWid:Number;
var thisHgt:Number;
var maxRight:Number = 500;
var keepmoving:Number;
var playStatus:String;
mc_bigPhotoHolder.mc_photoPreloader._visible = false;
mc = new MovieClipLoader();
preload = new Object();
mc.addListener(preload);
function loadBigPic()
{
var thisTarget:MovieClip = this.mc_bigPhotoHolder;
//trace("W = " + this.thisWid + " and H = " + this.thisHgt);
mc.loadClip(this.which, thisTarget.mc_photoBigLoader);
//trace("New num = " + (Number(this.thisWid) + 20));
var bgWid:Number = Number(this.thisWid) + 20;
var bgHgt:Number = Number(this.thisHgt) + 50;
var thisY:Number = Math.round((maxRight - (bgWid - 20))/2);
trace("Moving photo to " + thisY);
thisTarget.mc_photoBigBg._width = bgWid;
thisTarget.mc_photoBigBg._height = bgHgt;
thisTarget._x = thisY;
thisTarget.mc_photoPreloader._y = bgHgt - 20;
}
preload.onLoadStart = function(targetMC)
{
//trace("started loading "+targetMC);
targetMC._parent.mc_photoPreloader._visible = true;
targetMC._parent.mc_photoPreloader._width = 0;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes)
{
targetMC._parent.mc_photoPreloader._width = (lBytes/tBytes) * thisWid;
trace("thisWid = " + thisWid);
};
preload.onLoadComplete = function(targetMC)
{
border._visible = false;
targetMC._parent.mc_photoPreloader._visible = false;
};
Please let me know if it can be done.
Thanks!
Loading Dynamic Textbox While Dynamically Loading
Hi All,
So, I've got a movie on the stage (but offstage) called: Card. Inside this MC is a dynamic textbox called: CardName. I'm using a for loop to create a column of cards w/ their corresponding textboxes.
Here's the code:
for (var j = 1; j<=6; ++j)
{
var name = "Card_"+j;
var y = (j-1)*game.spacingY + game.originY;
game.path.attachMovie("Card", name, ++game.depth);
game.path[name]._x = x;
game.path[name]._y = y;
game.path[name]._width = game.cardSizeX;
game.path[name]._height = game.cardSizeY;
game.path[name].CardName.text = "card #" + j;
}
The cards and the textboxes inside the card MCs load fine but the actual textboxes don't change from the default text I've hard-coded in. How can I reach the dynamic textbox inside the card Movie Clip to manipulate the text.
Thanks.
External Swf Loading Into Target Movieclip Loading
Hi Everyone,
Can someone please help me...
I’m trying to load a SWF movie into a target movieclip called ‘blankmc’.
The SWF movie is loaded from an absolute URL (eg. http://www.somedomain.net/img/20042005113934movie3.swf )
My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG!
Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
//EXAMPLE CODE:
loadMovie( URL ,"blankmc");
blankmc.getBytesLoaded() ;
blankmc.getBytesTotal() ;
//This works with JPGs but not SWFs
Thanks in advance!
J
Loading One Movie Vs. Loading Multiple Movies?
Greetings All,
I'm looking for some advice on the approach to loading multiple content "panels" on a website -- let's say we have a mini-intro panel (logo, tagline, etc.) and a news panel (rotating blurbs you can click on).
From a performance and optimization stance, is it better to:
1) create each panel as its own .SWF and load each one separately on a web page;
2) create each panel separately, and then use loadMovie(); to insert one into a layout space within the other;
3) just build all the functionality into one big honkin' .SWF.
I'm leaning away from Option 3, just for "simplicity of development" reasons.
My concerns are performance quality (will one approach run slower than another?) and bandwidth issues (how will dial-up users experience different approaches?).
I'm sure some of you have run into this before. I'm interested in your opinions.
Thanks.
Loading Works Then Loading Text Pauses
Loading Works then Loading Text Pauses
http://www.plan-be.co.uk - the loading bar works fine but then disapears but the text remains!? I have done three pre-loaders beofre and never had this problem, any ideas?
Help With Loading Flash Page Loading Clocks
Hello users i don't really know alot about flash. What happens is when i click on the link to open one of my .swf it takes about 6 seconds but all you see is a white box until then. How do i put one of those loading clocks where it has loading 1-100 % until my flash is ready to be viewed.
Thanks guys
GBRadio
wakeup.to/gbradio
Loading Main Swf While Loading Swf Is Running, Is That Possible?
Hi
I have one intro movie, called intro.swf. In it is one button which allows to skip the intro.
If you skip or if the intro is over you'll jump to site.swf.
Now I wonder if there is a way that the site.swf loads while the intro is running. So if the intro is skipped or over it wan't take as look to load the site.swf
The site is online http://www.arjero-webdesign.lu
Loading A Scene Vs. Loading A New Movie
When you are in a Flash site and you click a link and a "loading" bar comes up, is it always loading a new flash movie (a whole different .swf file), or is it sometimes loading just a new scene?
If so, how do you make it so a scene does not load until the user clicks a link to take them to that scene?
Thanks in advance,
Marcus
Animated Loading/un Loading Of Mclips
hi,
i want to make a movie clip load into the place of another clip when the user presses a button. i want the loading and unloading to be animated
Any help would be great.
New LoadVars Remote Loading Just Not LOaDInG
Ok heres the deal. this script works great locally but remotely it chokes.... I havent been able to figure out what the issue is yet but would greatly appreciate the pointers.
Ok I have a movie clip that does all the work with the instance name of "SmartText" inside this I have five frames "Start,Loading,return,checkit and Loading" all in that order.
in Start(the first frame) I have the following frame functions:
container = new LoadVars();
//need only change the names and maybe levels
container.load(_global.textname);
function percentages() {
percentloaded = Math.round((quant/total)*100);
if (_global.vat ==4){
_level2.txtinfo.MyText.wintext.window_text.htmlTex t= "<i>loading"+percentloaded+"%</i>";
}
else {
_level2.txtinfo.MyText.window_text.htmlText = "<i>loading"+percentloaded+"%</i>";
}
}
function finload() {
//which means if on services page
if (_global.vat == 4) {
_level2.txtinfo.MyText.wintext.window_text.htmlTex t =container.window_text;
_level2.title.htmlText =container.title;
}else if (_global.vat == 2){
//which means if on home page
_level2.txtinfo.window_text.htmlText = container.window_text;
_level2.txtinfo.title.htmlText = container.title;
}
//if on aboutus
else if (_global.vat == 1){
_level2.txtinfo.window_text.htmlText = container.window_text;
}
//if on contact
else if (_global.vat == 7){
_level2.txtinfo.window_text.htmlText = container.window_text;
}}
basically I have started the new LoadVars and created two functions
percentages(), which should generate percentage loaded and finload()which should load the info in the correct location.
Loading (second frame) I have the following AS:
quant = Math.round(container.getBytesLoaded());
total = Math.round(container.getBytesTotal());
percentages();
if (quant>=total) {
gotoAndPlay("checkit");
}
return (third Frame) I have:
gotoAndPlay("loading");
checkit (fourth Frame) I got:
quant = Math.round(container.getBytesLoaded());
total = Math.round(container.getBytesTotal());
percentages();
if (quant>=total) {
gotoAndPlay("loaded");
} else {
gotoAndPlay("loading");
}
Loaded I simply have:
finload();
stop();
thanx again to all who attempt to unravel my mistery.
cheers
Problem With SWF Loading SWF Loading Variables...
Hi. This is no doubt a common question, but I couldn't find an answer (sorry). So here it is:
I have a main SWF movie, which loads in another SWF. The loaded SWF then loads in Variables from a TXT file. I set it all up to load from the same directory...
A. It works perfectly from the harddrive.
B. It works perfectly on my server, if the HTML, SWFs and TXT are all in the same directory.
C. If the HTML is in a different location than the SWFs and TXT, here is the problem: The main SWF will load the next SWF just fine, but that loaded SWF cannot find the variables file (txt)!
To explain the set up:
"domain_com/movie.html" -> loads move from "domain2_com/movies/file1.swf"
Then file1.swf goes and loads "file2.swf" and finds it in the same directory as itself.
WHERE should the TXT variables file be then? Cuz it doesn't load it if it's in the same directory as the rest. It doesn't load it if it's in the same directory as the HTML page. It doesn't load it if it's in the root of the Domain2... NoTHING. I have the variables file copied EVERYWHERE imaginable and it just won't load it.
BUT as I said, everything DOES work if it's all contained in the same directory, including the web page!
~Ray B.
Loading Vars And Loading Jpgs
Hi there,
Haven't been working with Flash much since Flash5. Now I'm starting all over in MX2004 and I can't get things to work.
Here's the plan:
I've got a php script that reads a directory and returns the total of images; the image names (img0 = bababa.jpg); and the directory in which they are located.
I want to create a photoalbum in which I dynamically load these jpgs one at the time. I was thinking to create a holder for each jpg and then set the visibility of the others to 0 or swap depths. Another solution ofcourse is to load a different jpg in the same holder clip.
Well here is the script I've managed to script/copy/paste together:
Code:
var mainTimeline = this;
varSender = new LoadVars();
varSender.cacheKiller = new Date().getTime();
varReceiver = new LoadVars();
varReceiver.onLoad = function (success)
{
if (success)
{
mainTimeline.cc_status.text += (this.total);
// this.total is a variable reveived thru the php file
} else {
//clearInterval(varPreloader);
mainTimeline.cc_status.text = "load failed!"
}
}
//varPreloader = setInterval(checkVarStatus,100);
function checkVarStatus () {
var kbLoaded = Math.floor(varReceiver.getBytesLoaded()/1024);
var kbTotal = Math.floor(varReceiver.getBytesTotal()/1024);
if (kbTotal == undefined)
{
kbTotal = "???";
}
mainTimeline.cc_status.text = kbLoaded + " / " + kbTotal + "Kb";
}
varSender.loaddirectory = "commissions";
varSender.sendAndLoad("http://localhost/pruigrok/load.php", varReceiver, "POST");
/////////// start jpg load //////////
MovieClip.prototype.loadjpg = function(picName, holderName)
{
var h = holderName==undefined ? "holder" : holderName;
this.createEmptyMovieClip(h, 1);
this._visible = false;
this[h].loadMovie(picName);
this.onEnterFrame = function()
{
if (this[h]._width > 0)
{
this._alpha = 99;
//delete this.onEnterFrame;
this._visible = true;
this.onComplete();
}
else
{
this.onLoading();
}
}
};
x = this.createEmptyMovieClip("xxx",1);
x.onLoading = function()
{
if(this.hhh.getBytesLoaded())
{
this._parent.cc_status.text = Math.round(this.hhh.getBytesLoaded()/this.hhh.getBytesTotal()*100)+"%";
}
}
x.onComplete = function()
{
this._parent.cc_status.text = Math.round(this.hhh.getBytesLoaded()/this.hhh.getBytesTotal()*100)+"%";
this._x = 100;
this._y = 100;
};
datum = new Date();
var count = 0;
function CC_loadJPG()
{
if(count+1<=varReceiver.total)
{
x.loadjpg("http://localhost/"+varReceiver.imgfolder+varReceiver["img"+count]+'?'+datum.getTime(), 'jpg'+count);
//varReceiver.imgfolder and varReceiver.img0 thru varReceiver.img10 are received thru the php file
count++;
}
}
stop();
I placed it in a frame of the main timeline. So the script automatically loads the vars onenterframe. Then on click I call the CC_loadJPG function which loads a jpg.
I think it's the best solution to load the jpgs in different holder clips. But how would I do this? And still have the loading status work? And how would I best hide the other holder mc's when the new jpg is loaded?
Any hints?
Cheers,
Gekke_Hollander
Loading Multiple .jpgs With One Loading Bar
ok, i have a dynamic slideshow thing, and i want to load all the thumbnails with just one loading bar to represent the progress of them all...they are loaded from an XML file, and im using the MovieClipLoader class to load them...any examples for code? i can post my project if youre still confused, its just kinda big right now
When Loading Two .swf's In A Web Page, One Stops Loading
Hi,
I'm having a problem with two swf's loading on a webpage. It only seems to happen when I use slower connections. I have preloaders set up for both swfs. One swf file will completely load and the other will start. However after getting a certain percentage done it quits. The point at which it stops changes. Depending on how quickly the page loads. Also it doesn't always do this but probably 60% of the time. Sometimes one swf file stops and other times the other one stops. I've let the page sit there and load for several minutes without it loading. The link to the page is
http://www.moriahis.com/mir3.html .
Please let me know if you have any suggestions.
Thanks,
Tenney
Loading External Swf, Then Loading Data...
I'm kinda new, im switching to flash from Swishmax... Concept is kinda the same but some parts are different...
I have my main swf loading an external swf which is than loading >
loadVariablesNum ("discography.txt",0);
now when I run the external swf by it self , it loads correctly.
But when I run the main swf, and it loads the external swf correctly the data being loaded does not come in at all... Ive pulled it off before on swishmax but on the real flash coding i cant
Loading XML Vs Loading From Database? Which Is More Efficient?
Hi,
Once weekly I query my database to get the "Top Whatevers", and when they are determined I put them in a TopWhatevers table so that it can be queried easily via AMFPHP. I'm wondering if it would be more efficient to have the query write the results to an XML file which the swf could refer to rather than having to perform a database query every time. The AS3 E4X feature is slick but I'm not sure which is better for performance.
Also, I think I read somewhere that you could store the results within the swf itself and update them periodically when need be. Is that true?
Any thoughts?
Thanks!
Loading Text Loading Something Unwanted
sorry if this thread has been repeated.
i followed the tutorial for loading external text files. works great. only problem is that when it's done loading, my dynamic text field returns: "_level0.extTxt" (extTxt is the instance name of the text field). is there anyway to avoid this message from appearing? any help is appreciated.
thanks in advanced.
cmplx
----
XML Loading In Flash, Not Loading In Browser
Could anyone give me a clue as to why when i test a movie in Flash my XML document is found and successfully loads (xml.status returns 0). However when the swf is used inside a browser, the swf can no longer find the XML document ( or something else ) ???
is there a way to pipe XML.status into a javascript function or some way to see what is going on inside of the browser environment?
thanks for any help.
-
Loading Text Loading Something Unwanted
sorry if this thread has been repeated.
i followed the tutorial for loading external text files. works great. only problem is that when it's done loading, my dynamic text field returns: "_level0.extTxt" (extTxt is the instance name of the text field). is there anyway to avoid this message from appearing? any help is appreciated.
thanks in advanced.
cmplx
----
|