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








HOW TO PRELOAD MY MAIN SWF (not External Files But My Main)


I've done a main.swf that i use as a big container for my website, in this main.swf i used the document class, where i import all the classes that i need for my interface and i load all the sections from externals .swf, preload this sections is not a problem, but i have this problem: how can i preload my main.swf if i have to put the code for the preloading into the document class, that is not working till its loading is not complete!?!?!? i mean it is like to say to the same object that i'm loading to check the loading of itself, the methods aren't be instanced, so.. looks not possibile to me.. wich way to follow?




Actionscript 3.0
Posted on: Sat Nov 22, 2008 12:42 pm


View Complete Forum Thread with Replies

Sponsored Links:

Preloader To Also Preload External F4v Files In Main Movie?
n00b alert... I did search the forum (and several others online), but either the code got too complicated for me to even attempt to adjust it, or I didn't find a relevant answer.
So I really hope someone here can help me out.

I've found a preloader code online that works like a charm. I don't really know what half of it actually means/does, but it preloads and then plays the mainfile.swf . Me happy.

But the "mainfile.swf" calls external f4v files, and the problem is that they do not get preloaded. (And that kinda was why I needed a preloader in the first place...)

I gave all the f4v files instance names within the mainfile (assume: video01.f4v, video02.f4v etc), and the f4v files themselves are in the same folder as the mainfile.swf.

What do I need to add to the code to get it to preload everything?
Thanks in advance!!


ActionScript Code of my preloader is attached.







Attach Code

var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("mainfile.swf"));

function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString() + "%";
}

function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(l);
}

View Replies !    View Related
How To Preload An External Swf In Main Swf
Hi I am a beginner as you can understand from my question

The question is:

InI have a "main. swf"; buttons will call the external swf's that they are linked to. Simply Home button calls the "home.swf" inside the "main.swf":

loadMovie("home.swf", _root.pageshere);

How can I write a preloading script to check whether "home.swf" is still loaded or not. I want to use one same preloading animation (which runs in the "main.swf") to the external files.

That's my problem. I will be happy with any help.

View Replies !    View Related
How To Preload An External Swf In Main.swf
Hi I am a beginner as you can understand from my question

The question is:

InI have a "main. swf"; buttons will call the external swf's that they are linked to. Simply Home button calls the "home.swf" inside the "main.swf":

loadMovie("home.swf", _root.pageshere);

How can I write a preloading script to check whether "home.swf" is still loaded or not. I want to use one same preloading animation (which runs in the "main.swf") to the external files.

That's my problem. I will be happy with any help.

View Replies !    View Related
How To Preload An External Swf In Main.swf
Hi I am a beginner as you can understand from my question

The question is:

InI have a "main. swf"; buttons will call the external swf's that they are linked to. Simply Home button calls the "home.swf" inside the "main.swf":

loadMovie("home.swf", _root.pageshere);

How can I write a preloading script to check whether "home.swf" is still loaded or not. I want to use one same preloading animation (which runs in the "main.swf") to the external files.

That's my problem. I will be happy with any help.

View Replies !    View Related
Preload External Swf's Into One Main Swf
Forgive me for asking what will probably be a very simple question but I have a nasty headache and I am tired of searching the web for the answer.

Basically I used a tutorial from here to add a preloader to my site. The preloader works for my main swf file, but it does not load the external swf files that I call during the movie playback.

Here is the code I used:

FRAME 1

----------------------------------------------------

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(3);

-----------------------------------------------------

FRAME 2

-----------------------------------------------------

gotoAndPlay(1);

-----------------------------------------------------

Because everything already works and is very simple and easy, I was hoping there were a couple of lines I could add to the existing script that would allow me to load external movies as part of the overall loading process.

I have searched and put forth an effort to figure this out but I would really appreciate an experts help at this time.

Thank you

View Replies !    View Related
[CS3] [AS2] Preload ALL External Content In Main Preloader...
Good afternoon, I hope everyone's having a good Sunday...

I've been struggling with this one for a while and despite intense Googling, haven't found anything but unanswered versions of the same question, so I thought I'd ask you guys...

I have a Flash project (CS3 & AS2) that was never intended to go on the net, but I now want to add to my personal portfolio online. It is one main movie that contains the navigation and a whole load of small SWF's that load into the levels above it using "loadMovieNum."

My problem is, is that it is crucial for all these external SWF's to be preloaded when you enter the site, in the main preloader of the main movie. This would mean they would all load instantly when called upon, instead of waiting for an individual preloader on each file.

I've tried combining all the SWF's into one file, which is implausible, and even bodging (with my limited AS skills) a preloader that loads all the movies in the first frame onto their various levels... which doesn't work.

I'm sure this must be a pretty common question and it seems like something that might be either really straight forward, or completely impossible, but any help anyone can offer would be greatly appreciated.

Take it easy,
Kristian

View Replies !    View Related
[CS3] [AS2] Preload ALL External Content In Main Preloader...
Good afternoon, I hope everyone's having a good Monday...

I've been struggling with this one for a while and despite intense Googling, haven't found anything but unanswered versions of the same question, so I thought I'd ask you guys...

I have a Flash project (CS3 & AS2) that was never intended to go on the net, but I now want to add to my personal portfolio online. It is one main movie that contains the navigation and a whole load of small SWF's that load into the levels above it using "loadMovieNum."

My problem is, is that it is crucial for all these external SWF's to be preloaded when you enter the site, in the main preloader of the main movie. This would mean they would all load instantly when called upon, instead of waiting for an individual preloader on each file.

I've tried combining all the SWF's into one file, which is implausible, and even bodging (with my limited AS skills) a preloader that loads all the movies in the first frame onto their various levels... which doesn't work.

I'm sure this must be a pretty common question and it seems like something that might be either really straight forward, or completely impossible, but any help anyone can offer would be greatly appreciated.

Take it easy,
Kristian

View Replies !    View Related
Can I Preload A External .swf File From The Main Navigation Page.
I need to know if I can have a preloader that works from the main navigation page that will load a external .swf that is not in the the main.swf movie. Please Help!

Detailed:
I am working on a site that the navigation page is its own movie or .fla, and the scenes that the buttons call are in there own .fla (there are 9 scenes). So when I export the navigation movie it becomes index.swf, and the scenes .fla is exported (sense there are nine scenes they are export in there own swf. so I have index_one.swf (which index_one.swf is scene1 and so on).
Now when i click on the button that calls the index_one.swf from the navigation page it sits there and the user does not now if the page is not working or its loading. so can I add any type of script to the main navigation page that would let me preload the index_one.swf. I would like it to show loading on the main navigation page and when it has completed it would go, to the new .swf file.

Thanks Jason

[Edited by motiongraphics on 07-19-2001 at 10:15 AM]

View Replies !    View Related
Main Mc Loads External Swf, Then Main Swf Buttons Stop Working
I have a portfolio site that I am building. The main site swf has a navigation menu, and a empty movieclip. Each of the buttons on the menu calls up an external swf to load into the main empty mc. When you click on 'home', the 'home' swf loads.. when you click on 'about', the 'about swf loads, I can switch between them, no problem.

This is where my problem comes in... I just created another external swf that has a gallery in it. The gallery consists of thumbnails and a larger image that are calling from an XML file. When this swf loads into the main mc, everything is fine. But then, the buttons on the main swf menu stop working! The buttons all work going between one another, except when you load the gallery and then you can't go anywhere else. Help!

let me know what code you need, if any. MUCH APPRECIATED in advance :)

example of whats happening:

http://christinevanetten.com/index2.html





























Edited: 04/18/2008 at 08:30:55 AM by christineski

View Replies !    View Related
Main Flash Loading External Swf Then Back To Main
SOLVED



Heres a rather complicated situation I am in.

I put together an after effect file and exported it as an swf. Work perfectly. There is no FLA


In my flash file, frame 1 is a preloader. Frame 2 is an Action script that says

loadMovieNum("page1.swf", 1);


And voila, the movie start to play.


Problem is, it doesn't go back to the main on frame 3.




Solution-
Using sorenson squeeze theres an option to load/unload movies that you compress into swfs. There was a stop at the end of my movie with no fla file.

View Replies !    View Related
Preloading External .swf's And The Main .swf All In The Main .swf's Preloader
Hello everyone

My question is would anyone know how to preload external .swf's and the main .swf all in the main .swf's preloader? All feedbacks are welcomed. Thank u.

toneDigital

View Replies !    View Related
Can External .swf And .txt Files Be Loaded Together With The Main .swf File?
Hi...

I have a problem with the loading of external .swf and .txt files.. When my main .swf file load finished i click on the links in my flash to navigate to the scene where it is supposed to load these external files.. it does appear but it only loads when im in the scene..

Does anyone knows how to solve this tricky question?

Thanks alot!

View Replies !    View Related
Loading External SWF Files Into The Main Swf File
Hello,

i'm quite new to flash and have taught myself so my knowledge in somethings is rubbish! I followed the Tutorial to load external swf files but the tutorial is for Flash MX I have flash MX 2004 what do i need to change to get it to work in this (as it doesn't at the mo) is the action script slightly different?

thanks for any help!!

View Replies !    View Related
Can External .swf And .txt Files Be Loaded Together With The Main .swf File?
Hi...

I have a problem with the loading of external .swf and .txt files.. When my main .swf file load finished i click on the links in my flash to navigate to the scene where it is supposed to load these external files.. it does appear but it only loads when im in the scene..

Does anyone knows how to solve this tricky question?

Thanks alot!

View Replies !    View Related
Dling External .swf Files While Main Movie Is Playing
Does anybody know a command to have your flash movie download external .swf movies within the "main" movie while playing. I have about 8 .swf's that are all linked together but the problem is the loading of each one seperatly (kinda lags a bit b4 each movie is loaded, because you have to download each and everyone) PLEASE help me out I'm working on a big project here at work Thank you!!

View Replies !    View Related
Error#1009 While Preloading External Swf Files In The Main Swf
HI everyone,

I hope you all have a nice day and there is someone out there who could help me :-)

I am loading external swf files into my main swf with this code:


ActionScript Code:
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
stop();


    var myLoader= new Loader();
    myLoader.x = 230;
    myLoader.y = 110;
    myLoader.name = "containerSwf"
   
    stage.addChild(myLoader);
    myLoader.load(new URLRequest("PFP GROUP web.swf"));

   
CladtekIntro_btn.addEventListener( MouseEvent.CLICK, loadCladtek);
function loadCladtek(Event:MouseEvent): void
{

      myLoader.load(new URLRequest ("CladTek.swf")); 
       
}

and so on I have made a few more buttons load different swf's.
The external swf files, in this case "PFP GROUP web.swf" and the rest of my swfs have their own preloaders in their own timeline with the following code:



ActionScript Code:
import flash.display.*;
this.stop();

this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);

function PL_LOADING(event:ProgressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;

lbar.scaleX=pcent/100;
lpc.text=int(pcent)+"%";
if(pcent==100){
this.gotoAndStop(2);
}
}

Then I export the movie PFP GROUP web.swf with simulate download and everything works fine, loading bar progresses OK. When I export my main swf and come to clicking on the button that loads PFP GROUP web.swf it gives me hundreds of Error messages WHILE the loading of this file is happening.This is what the Error says:


Quote:




TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PFPGroupweb_fla::MainTimeline/PL_LOADING(




I guess the Error is in the comunication between the swf's somehow because I don't get any Errors when exported on its own, and it does say that is in the PFPGroupweb_fla::MainTimeline/PL_LOADING(. I also can't figure out why is in the _fla file!?

If you know what the problem is can you please tell me, any help will be greatly appreciated. Thank you

Ananda

View Replies !    View Related
Dling External .swf Files While Main Movie Is Playing
Does anybody know a command to have your flash movie download external .swf movies within the "main" movie while playing. I have about 8 .swf's that are all linked together but the problem is the loading of each one seperatly (kinda lags a bit b4 each movie is loaded, because you have to download each and everyone) PLEASE help me out I'm working on a big project here at work :yikes: Thank you!!

View Replies !    View Related
Little Problem With Loading External Files Into The Main Frame
yes... okay, see, here's the problem.
i'm basically a newbie to flash so i still have a lot of trouble with it, and i started making my website in flash based on the tutorial here on kirupa.

now, instead of using a blank movie symbol for the contents, i transformed a vector form into a movie symbol and gave it the instance name contents, because i intended the content to show up in a irregular frame.

it works well so far, i mean, it opens and that, but there's a tiny little problem.
for some reason, instead of loading the external swf files correctly into the frame, they show up right in the middle of the frame, so the rest is cut.

oh well, i'm so bad at explaining, so let's see a few screenshots ^^""


on this one you can see what the frame is supposed to be like, it's the light ocre frame.



and here's what it looks like in the html preview:


kay, so... see the problem? i just don't get the contents to show up properly... it shows up exactly where that little cross is shown in flash... but i don't know what it means nor how to change it .___.
hope anyone can help me O___o""""


ah yes, by the way, on little question - how can i make my website open in a smaller window that's the same on every computer instead of adjusting to the internet explorer swindow size? i don't know if i make myself clear O.o""""" i just don't like it when i have a smaller website and there's this huuuge white background of the internet explorer...

View Replies !    View Related
How Do I Load External SWF Video Files Into Main Flash?
Hello,

I need to know how to be able to load external SWF video files into a main flash movie via buttons on the main flash. What I am trying to do is to show video clips in a window on the main flash movie. I know I need to convert the video clips to flash first. Could someone tell me how should I convert them in flash professional 8, then have on the main flash movie different play buttons which can each bring a certain clip to play in a window. I'd like to be able to also allow the viewer to control the audio of each clip, as well as pause the clips, start them over again, etc. I'm just trying to allow my viewers the choice of which clip they want to play into a window on the main flash movie and be able to control them as well. I'd really appreciate it if someone would help me. It's really hard to find a solution anywhere else.

Thanks!

Rob

View Replies !    View Related
How Do I Preload The Main Timeline Of My FLA?
the title pretty much summed it up....I want to preload the main timeline.
Do I use "root" or what?

plz provide a working example...thx in adv.!

View Replies !    View Related
[FLAMX2004] PRELOAD IN MAIN SWF
FOR A LONGE TIME I SEE IN THIS FORUM SAMPLES AND TUTORIALS ABOUT LOADMOVIE IN MAIN FLASH BUT I DONT DO LIKE SAMPLES.

PLEASE! I TRY IN KIRUPA.com TUTORIALS AND FORUM EXPLANE BUT I'M NOOB MAN!

please help me!
i need create a main flash w/ 5 swf files that load inner main
please

View Replies !    View Related
How To Preload Main Movie
Hi!

This code is to preload external swf files?


Code:
var request:URLRequest = new URLRequest("content.swf");
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
}
function loadComplete(event:Event):void {
trace("Complete");
}

loader.load(request);
addChild(loader);
How would I do to preload the main file if this code is at first frame in the main movie inside a function for example?

View Replies !    View Related
[FLAMX2004] PRELOAD IN MAIN SWF
FOR A LONGE TIME I SEE IN THIS FORUM SAMPLES AND TUTORIALS ABOUT LOADMOVIE IN MAIN FLASH BUT I DONT DO LIKE SAMPLES.

PLEASE! I TRY IN KIRUPA.com TUTORIALS AND FORUM EXPLANE BUT I'M NOOB MAN!

please help me!
i need create a main flash w/ 5 swf files that load inner main
please

View Replies !    View Related
How To Preload .swf's From Main Movie
I am loading multiple .swf's into a main .swf on different levels. So on the mains time line I have a frame that says this;

loadMovieNum ("AASPLASH*.swf", 8);
loadMovieNum ("NAVIGATION.swf", 3);
loadMovieNum ("AUDIO.swf", 5);
loadMovieNum ("SPINNER.swf", 1);

What I want on the main is to have is a % preloader that says, if these 4 movies are loaded go to a play them. This way when people view my site it looks seemless.

View Replies !    View Related
Preload Thumbs - Then Main Image
i've spent 2 days squinting at every preloader example on this site and haven't really found what i'm looking for.

i'm not sure i really understand the relationship between the timeline , the preloader actionscript and the actionscript in the main movie.

i've got a photogallery (gasp!! shock!!) that i'm populating with external .jpgs from an XML file (gasp again! how rare!)

i simply want a preload bar to visible as the thumbnails load. then, once loaded - a preload bar should appear when i click on the thumbnail that loads the main image.

my .fla file is currently only 1 frame so if the solution is multi frame - please let me know what i should put where etc.. i'm a pretty quick study i'm just having trouble relating all these preloaders to my project.

here's my code so far:


PHP Code:




myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("tot_lot.xml");
myPhoto.onLoad = function(success) {
    this.firstChild;
    numimages = this.firstChild.childNodes.length;
    spacing = 100;
    _global.thumbs_width = numimages * spacing;
    for (i=0; i<numimages; i++) {
            picHolder = this.firstChild.childNodes[i];
            thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
            thumbHolder._x = i*spacing;
            thumbLoader = thumbholder.createEmptyMovieClip("thumbnail_image"+i, 0);
        setProperty(thumbHolder,_alpha, 70);
        thumbLoader.loadMovie(picHolder.attributes.thmb);
        thumbHolder.title = picHolder.attributes.title;
        thumbHolder.main = picHolder.attributes.main;
            //setting rollover state for thumbs
        thumbHolder.onRollover = function() {
            this._alpha=100;
            };
        thumbHolder.onRollOut = function() {
            this._alpha=70;
            };
        //end rollover
                //set click on thumb action
        thumbHolder.onRelease = function() {
            loader.loadMovie(this.main);
            title_txt.text = this.title;
            };
    }
};







there maybe some extraneous code in there that doesn't actually do antything from my previous attempts at various things. i'll clean it up later!

i've also got some code that handles the scrolling navigation of the thumbnail bar but i left that out because it's not really relevant to the current situation.

i would be most grateful if someone could take the time to walk me through the basic steps (and most importantly - concepts!) to getting these 2 preloaders integrated into this project.

thank you thank you thank you.

dijon

View Replies !    View Related
Flash 9 - How To Preload The Main Timeline
Hi all,
I would like to know how to prealod the main timeline with or without the document class. Any idea?. I know i've to use loaderInfo but don't know where and how.Thanks.

View Replies !    View Related
Flash 9 - How To Preload The Main Timeline
Hi all,
I would like to know how to prealod the main timeline with or without the document class. Any idea?. I know i've to use loaderInfo but don't know where and how.Thanks.

View Replies !    View Related
Preload To Main Page Php...from Flash
Ello ...i just stuck up in the code below..hope someone can clear up for me...i just want to connect to php main page from flash let's say after the status show 100% loading i want to connectto php mainpage....is it possible?then i come up with this code below..but it's seem when it connect to page..it keep open new window...for same page..so how i gonna stop this..i just want connect the page once only....


ActionScript Code:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.getURL("www.blablabla.com/main.php", "_self");
}


any help would be great...

View Replies !    View Related
Login-> Preload-> Main Screen ?
Hey,

Im having trouble figuring out the best way to structure a flash application. Im not sure whether to have the login as a seperate .swf or to have the login and main screen on different frames. Also i want to preload the main screen but I would ideally like to have the login load right away. The main screen is filled with components and remoting methods and the login would also have a few components (text inputs, button) and use remoting (amfphp) as well. I want to be able to pass the resulting userid from the login to the main screen. OH and im using AS2 with most all the code in a seperate class.

Sorry that the question isn't structured better (I obviously have structuring issues), but basically im looking for some advice on how to set up flash remoting applications with a login.

Dan

View Replies !    View Related
[Preload] Main Mov + Level Swf's With % & KB Display
Last edited by ST. : 2003-10-01 at 11:52.
























HI!
I'am in panic.
I have MAIN movie, that have standart preloader script that shows % of loaded data.
The MAIN movie contains few LEVELS, where few movies are loaded.
The problem that when load MAIN movie, then it plays and others movies in LEVELS play with delay.

How to preload main movie + external files, and need to display actual % and KBs of loaded Movies+External movies.

View Replies !    View Related
Preload Various Swf Inside The Main Movie
I have the main movie that call 3 external swf , i try to make a preload like this, to start the to play only when the last extrenal swf get loaded but i got freeze on it,
and how can i put a dynamic text to change everytime start to load a another external swf
load main scene-> load elements(external swf) -> load adds( external swf).


TIA
molotophy

View Replies !    View Related
Can I Preload A Movie Clip That Is On Main Timeline?
Ive seen this done, and now I need to do it. I want to do a percentage preloader for a movie clip. I think my nesting is wrong. Here is the script as it is not working. If anyone knows how to do this, you will be helping me save the world. The crap below might be totally off. Feel free to bust on me.

cmov is the MC I want to load.

total = 250;
download = int(_root.cmov.getBytesLoaded() /1000);
if (download>=total) {
tellTarget ("_root.cmov") {
gotoAndPlay (2);
}
} else {
play ();
}

View Replies !    View Related
AS3 Monitor Progress Main Swf Loading (preload)
Never had any problem with loading and monitoring loading progress of external files.
Having some problems on monitoring progress of downloading of the main swf file...

------------------------------
In document class constructor:
I add listeners to loaderInfo of document class...

Code:
loaderInfo.addEventListener(Event.OPEN,openListener);
loaderInfo.addEventListener(ProgressEvent.PROGRESS,progressListener);
loaderInfo.addEventListener(Event.COMPLETE,completeListener);
and I create the object I'd like to use to visualize progression
(using a textfield now, but also tried dynamically drawn graphic bar)

Code:
loaderStatus = new TextField();
------------------------------

Code:
private function progressListener (e:ProgressEvent):void
{
trace("progress");

var percent:int = e.bytesLoaded / e.bytesTotal * 100;
loaderStatus.text = "Loading: " + percent + "%";
}

private function completeListener (e:Event):void
{
e.target.removeEventListener(ProgressEvent.PROGRESS, progressListener);
e.target.removeEventListener(Event.COMPLETE, completeListener);
trace("complete");
stage.removeChild(loaderStatus);
}
the progress and complete listeners give feedback through tracing.

the open listeners doesn't give feedback...
that's why I've moved the creation of the 'progression visualizer'
(whatever it is) inside the constructor of the document class...



I don't get it...
why we have a loaderInfo property accessible in root/document class
if it's useless to track the downloading of the main file


I've tried to search this and other forums
but I've find only info about preloaders in AS2, preloaders for external content
essential actionscript 3.0 from colin moock
has info about making a preloader in flash authoring environment
but it's using frame scripts...

shouldn't be possible to manage all the preloader stuff for the main clip
directly from the document class?
I know that I'm new to all this AS3 world but...

hope someone will read this
have a medium-size project and all my initial assets and class
have a dimension of approximately 300K so I absolutely need
a preloader for the main file


Any hints, suggestions, pointers are really appreciated
Thanks
Jo

View Replies !    View Related
URGENT - Stop Main Movie Looping After Preload
Hi there - this is a stoopid one - I have a preloader for an xml file and then a large movie clip. I preload using three key frames (First sets up the load, the second tests for success and the third just loops to the second).

Once the xml has loaded, I want to jump the loop and carry on to a KF which has a clip on that is highly complex, comes with animation and animated clips embedded.

How do I stop the main time line looping back to the preloader without stopping the main time line?

If I put in a stop(); on the timeline, then all of the animations on the large mc then shutdown. I either get the loop and the animations or no loop and no animations.

Help!!!!

frank

View Replies !    View Related
Conflict Between Main Preloader And Load Movies Inside The Main.
Greetings.
I am able to make preloaders for my individual .swf files and have them loadmovie into target into my main movie, however if I also want to preload my main movie (the parent that contains all the swf files) I get conflict. Essentially I want to preload the main movie, once there the viewer upon clicking certain buttons can view other swf movies each of which have there own preloader. It appears that the preloaders I have tried are "either one or the other" choice i.e. preload main or preload the swf files inside main.
I am sure it's in the coding....anyone have a preloader or a tut' for preload main (with % be nice) and then still able to have preloaded swf inside.
Thanks!

View Replies !    View Related
Referencing Clips On Main Timeline From My Main Document Class
Hi All,

I'm trying to reference clips on the main timeline either in or via my main Document class, but if I declare any clips as public in the class body as I would have done is AS when linking an external class, I get:


Code:
1151: A conflict exists with definition tfLength in namespace internal.
If I don't declare the clip, then I can reference it from within the same class with this.tfLength, but other classes complain it the Document classes tfLength variable doesn't exist!

So how do I reference a clip on the timeline in my class?

Thanks,
Dave

View Replies !    View Related
Preload Main Movie Via Document Class & Add Details To Stage?
Hi Guys,

I have what I think might be a dumb question on my behalf or maybe I am missing something but is it not possible to added a preloader movie clip that i create to the stage via the document class? i.e. if i wanted to use this method of preloading my movie, is it possible to add a movie clip to the stage with the status? Everything I try just doesn't seem to work Currently, when i test within flash using simulate download, my stuff is added to the stage, after the movie is loaded? I've moved my content on the stage to frame 2 with the correct frame label.

cheers for any help,
stacey


Code:
package {

import flash.display.*;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.net.*;
import flash.text.*;

public class SiteLoader extends MovieClip {

var preloader_site_mc:MovieClip = new MovieClip();


public function SiteLoader():void {


createPreloader();

//this.loaderInfo.addEventListener(Event.INIT, initApplication);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);


}


public function showProgress(theProgress:ProgressEvent):void {

//get the values
TextField(MovieClip(preloader_site_mc).getChildByName("preloader_site_percentage")).text = "" + (theProgress.bytesLoaded / theProgress.bytesTotal * 100);

//update width of bar by amount changed as a percentage
Sprite(MovieClip(preloader_site_mc).getChildByName("preloader_site_progressBar")).scaleX = theProgress.bytesLoaded / theProgress.bytesTotal;

}

public function onLoadComplete (myEvent:Event):void {

gotoAndStop("loaded");


}


public function createPreloader():void {

//create the preloader itself dynamically
var sprite_preloader_site_progressBarBorder:Sprite = new Sprite;
sprite_preloader_site_progressBarBorder.graphics.lineStyle(0.5,0x30304a,0.5,false,LineScaleMode.NORMAL,CapsStyle.NONE);
sprite_preloader_site_progressBarBorder.graphics.moveTo(550,420);
sprite_preloader_site_progressBarBorder.graphics.lineTo(735,420);
sprite_preloader_site_progressBarBorder.graphics.moveTo(735,420);
sprite_preloader_site_progressBarBorder.graphics.lineTo(735,425);
sprite_preloader_site_progressBarBorder.graphics.moveTo(735,425);
sprite_preloader_site_progressBarBorder.graphics.lineTo(550,425);
sprite_preloader_site_progressBarBorder.graphics.moveTo(550,425);
sprite_preloader_site_progressBarBorder.graphics.lineTo(550,420);
preloader_site_mc.addChild(sprite_preloader_site_progressBarBorder);

var sprite_preloader_site_progressBar:Sprite = new Sprite;//b6c0df or fbda9b
sprite_preloader_site_progressBar.name = "preloader_site_progressBar";
sprite_preloader_site_progressBar.graphics.lineStyle(2,0xb6c0df,0.2,false,LineScaleMode.NORMAL,CapsStyle.NONE);
sprite_preloader_site_progressBar.graphics.moveTo(552,423);
sprite_preloader_site_progressBar.graphics.lineTo(734,423);//dont have a width yet
sprite_preloader_site_progressBar.scaleX = 0;
preloader_site_mc.addChild(sprite_preloader_site_progressBar);

//ADD TEXT FIELDS

//create new instance of the font
var preloader_site_font:Font = new Arial_Embedded();

//create a format for the fields
var preloader_site_TextFormat:TextFormat = new TextFormat();
preloader_site_TextFormat.font = "Arial";//
preloader_site_TextFormat.color = 0x57578f;//0xfbda9b;
preloader_site_TextFormat.size = 10;

//create the fields & their attrs
var textField_preloader_site_loadingText = new TextField();
textField_preloader_site_loadingText.autoSize = TextFieldAutoSize.LEFT;
textField_preloader_site_loadingText.selectable = false;
textField_preloader_site_loadingText.name = "preloader_site_loadingText";
textField_preloader_site_loadingText.defaultTextFormat = preloader_site_TextFormat;

var textField_preloader_site_percentage = new TextField();
textField_preloader_site_percentage.autoSize = TextFieldAutoSize.NONE;
textField_preloader_site_percentage.selectable = false;
textField_preloader_site_percentage.name = "preloader_site_percentage";
textField_preloader_site_percentage.defaultTextFormat = preloader_site_TextFormat;

var textField_preloader_site_percentSymbol = new TextField();
textField_preloader_site_percentSymbol.autoSize = TextFieldAutoSize.LEFT;
textField_preloader_site_percentSymbol.selectable = false;
textField_preloader_site_percentSymbol.name = "preloader_site_percentSymbol";
textField_preloader_site_percentSymbol.defaultTextFormat = preloader_site_TextFormat;

//add content to those text fields
textField_preloader_site_loadingText.text = "LOADING DATA";
textField_preloader_site_percentage.text = 0;
textField_preloader_site_percentSymbol.text = " %";

//set the positions
textField_preloader_site_loadingText.x = 550;
textField_preloader_site_loadingText.y = 400;//move above registration point
textField_preloader_site_percentage.x = 700;
textField_preloader_site_percentage.y = 400;
textField_preloader_site_percentSymbol.x = 720;
textField_preloader_site_percentSymbol.y = 400;

preloader_site_mc.addChild(textField_preloader_site_loadingText);
preloader_site_mc.addChild(textField_preloader_site_percentage);
preloader_site_mc.addChild(textField_preloader_site_percentSymbol);

//add to stage
this.addChild(preloader_site_mc);


}


}



}

View Replies !    View Related
Preload Random Images In Main Movie Every 10 Seconds After Load Complete
Hi there,
I am working on a flash web site and I have a hald decent code for it but there are some bugs i cant figure out.
www.fadlighting.com/test
The following is the concept:
Load a random image from the folder on the server. Build preloader that showes size of image and percent remaining to load image. Wait 10 seconds and load new random image.

So far I was able to do so with the expert help of the Bible for Flash.
The following is the code i scrached together, This portion is at frame 1 of main time line
function loadFile(){

images = 13;
directory = "http://www.fadlighting.com/test/random/image_";
image = directory add Math.ceil(Math.random()*images) add ".jpg"
intro_holder.loadMovie(image);
var loadObj = intro_holder;

var initObject = {
_x: intro_holder._x +590 ,
_y: intro_holder._y +240 ,
target: loadObj,
loadExit: null
};

_root.attachMovie("loader","loader",2, initObject);
updateAfterEvent();
setInterval(loadFile, 10000);


}

loadFile();
// setInterval(loadFile, 10000);

// intro_holder.unloadMovie();
// updateAfterEvent();

the following code is in a Movie Clip called intro_holder in the library on frame 1 of its timeline
function checkLoad(obj) {
var lBytes = target.getBytesLoaded();
var tBytes = target.getBytesTotal();
var percentLoaded = Math.floor((lBytes/tBytes)*100);
bar._xscale = percentLoaded;
percent.text = Math.floor(percentLoaded)+"% of "+Math.floor(tBytes/1024)+"KB loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
clearInterval(checkProgress);
_parent[loadExit]();
obj.removeMovieClip();
} else {
count++;
}
}
updateAfterEvent();
}
checkProgress = setInterval(checkLoad, 100, this);
stop();

the code works but it does not wait for the image to be loaded before starting countdown for 10 seconds... and in between loads something is off... uhmmmm I can email fla if interested to long to post.

Thanks!!!

View Replies !    View Related
Preload Random Images In Main Movie Every 10 Seconds After Load Complete
Hi there,
I am working on a flash web site and I have a half decent code for it but there are some bugs i cant figure out.
www.fadlighting.com/test
The following is the concept:
Load a random image from the folder on the server. Build preloader that showes size of image and percent remaining to load image. Wait 10 seconds and load new random image.

So far I was able to do so with the expert help of the Bible for Flash.
The following is the code i scrached together, This portion is at frame 1 of main time line
function loadFile() {

images = 13;
directory = "http://www.fadlighting.com/test/random/image_";
image = directory add Math.ceil(Math.random()*images) add ".jpg"
intro_holder.loadMovie(image);
var loadObj = intro_holder;

var initObject = {
_x: intro_holder._x +590 ,
_y: intro_holder._y +240 ,
target: loadObj,
loadExit: null
};

_root.attachMovie("loader","loader",2, initObject);
updateAfterEvent();
setInterval(loadFile, 10000);


}

loadFile();
// setInterval(loadFile, 10000);

// intro_holder.unloadMovie();
// updateAfterEvent();

the following code is in a Movie Clip called intro_holder in the library on frame 1 of its timeline
function checkLoad(obj) {
var lBytes = target.getBytesLoaded();
var tBytes = target.getBytesTotal();
var percentLoaded = Math.floor((lBytes/tBytes)*100);
bar._xscale = percentLoaded;
percent.text = Math.floor(percentLoaded)+"% of "+Math.floor(tBytes/1024)+"KB loaded.";
if (lBytes>=tBytes && tBytes>0) {
if (count>=12) {
clearInterval(checkProgress);
_parent[loadExit]();
obj.removeMovieClip();
} else {
count++;
}
}
updateAfterEvent();
}
checkProgress = setInterval(checkLoad, 100, this);
stop();

the code works but it does not wait for the image to be loaded before starting countdown for 10 seconds... and in between loads something is off... uhmmmm I can email fla if interested to long to post.

Thanks!!!

__________________
Anthony Palermo
aderium@bellsouth.net
http://www.aderium.com

View Replies !    View Related
Controlling Swf's Files From Main Swf
Hi everyone,

Can anyone help me out? I have a main swf file with three buttons. When click on button1, it preloads content1.swf. However, in content1 there is a animation that starts at frame1 and stops at frame 5.

From frame 6 to frame 10 it plays a it's closing sequence and stops at frame 10. Now is there a way that I can control this with a button from the MAIN.swf?

I want content1.swf to play it's closing sequence from button1 that is in MAIN.swf.

The code that I have now is out of wack:
----------

OnRelease
if (_root.nextMovie = content1._visible) {
flash.content1.gotoAndPlay(32);
}

---------

This is meant to show if content1.swf is active or visible, then goto frame32 (which is closing sequence) in content1.swf and play.

Can anyone help me with this?

Thanks for your time!

View Replies !    View Related
Including SWF Files Into Main?
Hi,

I am developing the following flash site
http://dialspace.dial.pipex.com/town...son%20Godfrey/

Currently I have a seperate html file with its own swf file for each page, so when you click one of the buttons it opens the new html and loads the movie for that page.

However, how do I get the site to have a smoother transition between pages, without screen flashes etc??

Reading this forumn I think I have to have only 1 html file with an associated main swf file which 'includes' all the other swf files in it?? I have no idea how to do this, can anyone help??

Thanks

View Replies !    View Related
Including SWF Files Into Main?
Hi,

I am developing the following flash site
http://dialspace.dial.pipex.com/town...son%20Godfrey/

Currently I have a seperate html file with its own swf file for each page, so when you click one of the buttons it opens the new html and loads the movie for that page.

However, how do I get the site to have a smoother transition between pages, without screen flashes etc??

Reading this forumn I think I have to have only 1 html file with an associated main swf file which 'includes' all the other swf files in it?? I have no idea how to do this, can anyone help??

Thanks

View Replies !    View Related
Loading Swf. Files In Main Movie
Here is my website:

I am having a problem with my website.
On my main movie swf. file, I have four links which should lead to a separate swf. file or a movie clip.

This is what I want to do, but I don't know to do it:

After you click on the portfolio link I want either a movie clip or a swf. file to load on top of my main swf. file. The swf. file should be located exactly on top of the film strip design that you see in the main movie. If you click ona diff. link, the swf. file should disappear and a diff. swf. will load. Is this possible? I was thinking of creating movie clips for the main swf. file instead of of separate swf. files. If i do that, I'm not sure where I would put the action script in the main movie to load the movie clip. I'm still new to flash.

If you create a swf. file to load on top of the main.swf, will the white background from the swf. file be visible. I wanted to create a swf. file just using text and there is always a colored background for a swf.file. Can you make the background of a swf. transparent?

If someone has a better way to organize my site, please let me know.

View Replies !    View Related
Loading Swf. Files In Main Movie
I am having a problem with my website.
On my main movie swf. file, I have four links which should lead to a separate swf. file or a movie clip.

This is what I want to do, but I don't know to do it:

After you click on the portfolio link I want either a movie clip or a swf. file to load on top of my main swf. file. The swf. file should be located exactly on top of the film strip design that you see in the main movie. If you click ona diff. link, the swf. file should disappear and a diff. swf. will load. Is this possible? I was thinking of creating movie clips for the main swf. file instead of of separate swf. files. If i do that, I'm not sure where I would put the action script in the main movie to load the movie clip. I'm still new to flash.

If you create a swf. file to load on top of the main.swf, will the white background from the swf. file be visible. I wanted to create a swf. file just using text and there is always a colored background for a swf.file. Can you make the background of a swf. transparent?

If someone has a better way to organize my site, please let me know.

My website:

View Replies !    View Related
Problems Loading .swf Files Into Main.fla
Hi,

I have a main.fla which are loaded with few .swf files on its main timeline using loader component. On Frame 1 of main.fla, I tried to load in intro.swf. It got loaded but I have 2 problems:

1) There are many images in intro.swf which are loaded into itself using loadMovie("filename", targetarea). It works perfectly when I test movie in intro.fla. But when test main.fla, the images could not be loaded. Why?

2) On the main timeline of main.fla, I would like to play intro.swf first then play "home" frame of the main timeline. I guess I have to go to the last frame of intro.fla to tell it to gotoAndPlay("home"). But it didn't work. What should I do?

Many thanks,
yen

View Replies !    View Related
Loading Multiple Swf Files In Main Swf
Hi there,

In my main swf i'm loading multiple swf's. The all have there own holder with different coördinates(x,y).This setup seems to make the hole thing run slow. Any advice on how to make this kind off setup run smooth?

Any way I can preload them and the make them visible one at a time? Like first preload them. swf1 loads first then swf2 after 5sec for instance then after 15sec swf3,...

Any advice,help would be welcome. Hope to here from anyone. Need to get my site to run smooth.

Grtz,

View Replies !    View Related
Two Swf Files Viewed At Same Time From A Main.swf
What i want to do is to load two diferent .swf (actually i want to load 4) files in another .swf files and that they could be viewed at the same time from main.swf , i hope you can answer and undestand what i want , thanks in advance

View Replies !    View Related
Loading Main MC Inside Main MC
Hello, Can I ask a question? I have fiinsihed Lazaro Claiborne's
tutorial on "Building A Simple Website."

It works great. My question is - if this makes sense: I want
to put a main2.swf inside my main.swf. Inside of main.2, I
wanted it to have a menu that would also call a .swf file(s)?

I want to make a site on space for my kids at school. In
going to some of these sites, they get lost with overkill
of data. My kids attention level is the third grade. I can
keep their focus really good with Images as I try to teach
them this section of science.

I wanted Main to hold a menu of Planets, Nebulas, etc.

When I click Planets to open that .swf, I wanted a menu in
that .swf to show each planet close up for them to see one
by one.

I saw some things in the forum that seem to come close, but
I dont know enough yet to know if they actually fit what I am
trying to ask?

Thank You - Skyler A. 1/20/07

View Replies !    View Related
Loading Multiple Swf Files Into A Main Movie
I seem to be having difficulties figuring out how I can load a smaller sized swf file into a main movie which is larger in flash 5. I want to load and position the smaller sized swf files in a certain x and y position but it seems to default to the 0, 0 postion on layer 1. I am using load movie then I tried to add set property value to x and y but that seemed to shift the main movie.
Basically I have a TV screen on the main movie and want to load and unload different swf files as I change the channel. Could anyone help me with this

View Replies !    View Related
Restrict Direct Access To Files But The Main
I have a all-flash-site which on demand loads several swf-files in to the main.swf.(e.g. if you type www.mySite.com and hit the button movie movieOfTheDay.swf is loaded.)

And I want to avoid people being able to directly access those files using http://www.mySite.com/movieOfTheDay.swf .

Best would be if they where be directed to index att all times.

Does it make sense?

My webspace is hosted.

Any Ideas?

greets

andreas

View Replies !    View Related
LoadMovie Removes Files In Main Stage ?
I hope someone can help.
I am loading an external SWF file into my main stage using a button action, and specifying the instance that it should replace ("this_mc"), but when it goes to that frame ("this_frame") all the other images on that frame disappear.

Any ideas?

on (release) {
gotoandStop ("this_frame");
loadMovie ("thing.swf", _root.this_mc);
}

P.S. the frame does not have a stop(); action on it, as I have found that this causes problems.

Boxx42

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