ActionScript 2.0 :: Better To Have The Preloader Code In The External Swf Or In The Main Movie?
May 31, 2005
When importing external swf's, would it be better to have the preloader code in the external swf or in the main movie? I've seen threads about this everywhere but I don't see the difference. Once the movie pops in it starts preloading right? Is there a faster result when the preloader is in the main movie?
View 2 Replies
Similar Posts:
Apr 4, 2011
I need a preloader to include an external .swf (iPhone_334x500.swf) that is dynamically added later in the timeline. Currently, the preloader goes to 100% and then begins to load the external swf before completing and going to frame 2. Rather than just appear to sit at 100% for 20 secs while it is still loading my external swf, I would like to include the external swf's load time in the preloader data.
This is my "preloader" code on frame 1, which is empty except for the AS. (Just a basic bar and percent preloader.) I included all of my code just in case, so please ignore the font embedding and masking if it makes it easier.
[Code]....
View 3 Replies
Dec 23, 2004
I want to load six seperate .swf's into the main movie while the main movie loads too. So in simpler words, i want to be able to load all of the swf's the same time i am loading the main swf.
View 2 Replies
May 2, 2005
I need to preload 2 external .swfs, one containing animation and one containing sound, and I need them to start playing at the same time. As of now I have a general preloader on the main timeline, but as you might expect, after the preloader finishes, there is a lag while the .swf's are being loaded. I thought everything was solved, until a friend of mine looked at it in dial-up, and the preloader just kept looping 10 times before the animation started, so now I'm starting over. Part of my complication I believe is that I'm using loadMovieNum into levels as opposed to loading the external .swf's in a separate container MC (that's what I've noticed most people recommend for this problem), but I tried doing that technique several times with no luck. Right now my main movie, index.fla, has a preloader MC in the first frame, with this AS attached to the clip:
Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
[Code] .....
The clip contains a loadbar, static text (which just says 'Loading'), dynamic text (which tells the percentage), and a 'stop' in the actions layer. In the actions layer within my main movie, there is a 'stop' on the first frame as well. On the second frame, there is this AS:
Code:
var audioOn = false;
loadMovieNum("musicfile.swf", 1);
loadMovieNum("1movie.swf", 2);
stop();
In order that the animation and music starts at the same time, within my animation .swf (1movie.swf), I have this AS on the first frame of the actions layer:
Code:
if (_level0.audioOn == true) {
gotoAndPlay(2);
}
Within my musicfile.swf, there is this AS on the second frame of the mp3:
Code:
_level0.audioOn = true;
My main objective is to be able to use my preloader to preload both of these .swf's concurrently in my main movie so that they may start at the same time.
View 1 Replies
Sep 20, 2003
I have a main swf loads a serveral swf's from the menu.how can i use the main preloader to loads the external swf's ?
View 4 Replies
Apr 1, 2012
I have an External Swf with its own Preloader that is loaded into my Main swf,It works fine when i am testing it in Macromedia Flash 8 However when i upload all of it to my site and i click the button that loads the External swf in to my main swf it loads the hole main swf again and not the external swf. (NOTE i load the external swf into a MC ''myContainer2'' on the main swf) Here are my codes:
External Preloader
onClipEvent (enterFrame)
{
percent = Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100);
gotoAndPlay(percent);
[code]....
View 1 Replies
Sep 3, 2009
My external swfs are taking 8-10 secs gap in loading inside main swf, that's why i want to load my external swfs with dynamic content at the same time when my main swf loads.
Code of preloader
Code on 1st frame:
onClipEvent (load) {
total = _root.getBytesTotal();
}
[Code].....
View 3 Replies
Jul 11, 2009
this is my final bug then I can finally launch this bloody site. here's my problem, I am loading an external .swf, which contains a pre-loader. the preloader in the external .swf works fine when I test it online by itself (not being loaded via main.swf) But when I test the external.swf through the main.swf the preloader does not work. the external.swf just plays through like it does not recognize the stop in the first frame to initialize the preloader skipping it altogether.here is my code:
[Code]...
View 3 Replies
May 2, 2005
I've tried to approach this from several angles, employing several of the tutorials, attachments found in various threads, etc, and nothing has worked. So, please bear me as I ask yet another question regarding this subject.I need to preload 2 external .swfs, one containing animation and one containing sound, and I need them to start playing at the same time. As of now I have a general preloader on the main timeline, but as you might expect, after the preloader finishes, there is a lag while the .swf's are being loaded.thought everything was solved, until a friend of mine looked at it in dial-up, and the preloader just kept looping 10 times before the animation started, so now I'm starting over. Part of my complication I believe is that I'm using loadMovieNum into levels as opposed to loading the external .swf's in a separate container MC (that's what I've noticed most people recommend for this problem), but I tried doing that technique several times with no luck. Right now my main movie, index.fla, has a preloader MC in the first frame, with this AS attached to the clip:
Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
[code].....
View 1 Replies
Mar 7, 2010
I can not execute a code from nested movie inside of my main movie when I declare import like that:[code]I get these errors: 1172: Definition com.greensock:easing could not be found.
View 8 Replies
Oct 9, 2010
Been trying to load my main SWF through my external preloader, however no mater what i do I'm getting this: VerifyError: Error #1014: Class flash.text.engine::FontDescription could not be found. Could this be due to TLF embedded fonts or things being loaded on the first frame of my main site?
View 1 Replies
Nov 5, 2009
how to link the main movie to the preloader, so it counts the load and loads the main movie when it's done?
View 1 Replies
Apr 30, 2003
I am creating a full site in flash. The main movie has an empty movie clip in the middle of the movie to load external movies as the user clicks on the links. Everything has worked good so far as the linking has only gone 1 level deep. However, when I created a new external movie, and had buttons on it for another external page, but yet to open in the main movie, I can't get anything to work. Example.... In the main movie, the user clicks on the archive link, and the external archive movie is loaded into the main movie. Now, on this archive movie, there is a button on it that links to a another movie (say text effects.swf). However, when they click this button for text effects, I can't get it to load into the main movie clip and replace the archive movie that was currenlty there.
View 14 Replies
Nov 30, 2006
i would like to have a preloader run in a movie clip rather than in the main scene...http:[url]....i have followed this tutorial exact and it works when i create it on the main scene,but the loading bar and text doesnt work when i build it in a movie clip.
View 6 Replies
Sep 23, 2007
I'm in need of a preloader, (or easy tutorial on how to create one), that will run a progress bar and also play a short welcome animation all the way through... regardless of connection speed. One that checks total frames of mc against total bytes loaded or something.
View 5 Replies
Feb 1, 2006
- i have 3 separate movie clips (a,b,c)
- my main movie is (a) and when i click a button there, it will go to external movie (b)
- under external movie (b) there's a movie clip that includes my animation and content button
- if i click on the content button on movie (b), external movie (c) will pop up [ it will not replace movie (b) but will just overlap it, it's like a small pop up ]
i did the actionscript and when i'm testing external movie (b), it's working... it's showing/popping up movie (c) but when i tried it on the main movie (a), the movie (c) is not popping on the (b) err, sorry if it's a bit confusing / how i explained it. but hopefully somebody will get the idea. and it won't also return on the main movie (a) when i click on a link from the external movie.
View 5 Replies
Oct 10, 2002
I'm still a rookie in flash and I'm having a little bit of trouble with some actionscript. I've gotten as far as placing the buttons and assign the correct actionscript for them to work. Everything is working fine with the buttons activating the external .swf into a blank movie clip in the main movie. Ony thing is, I would like the external movie assigned to the first button to open once the movie is loaded.
I thought by using the same actionscript i used on the button {and removing the on(release) tag} and placing on the first frame of the main movie would help, but it doesn't.
View 2 Replies
Jul 19, 2011
So I have been trying to figure out a way to control multiple clips using the same "on press" & "on release" statements located on 1st frame of main timeline. A variable is being set to a value that correlates to the name of each movie clip as an interaction occurs.Ex: user clicks from a selection of buttons & depending on the button clicked it sets clipNum = "1" through "21".What I want is to have something like the following code that will give the user the ability to click and drag the clip with code on the main timeline similar to the following:
_root["drag_" + clipNum].onPress = function () {
startDrag (_root["drag_" + clipNum]);
};
[code].....
View 2 Replies
Sep 7, 2010
onClipEvent (load) {
MinX = 0;
MaxX = 200;
this._x=100;
FRAME = _root.p1;
}
[Code]...
p1 is the instance of the movie which I am trying to move with slider. When I apply above code on the handle of the slider with instance name 'handle' everything works perfect. Slider moves and so do the movie. Now instead when I bring the same code to the main timeline to do the same, onClipEvent does not work, it gives error. So I replaced it with the code written below. Now I can move the handle but movie is not moving.
[Code]...
View 1 Replies
Jan 9, 2010
my problem is that i need to make a reisze, cause the screen resolution for other users. My main and news movie works perfect, but the others movies re-scale everything bigger. The problem of the external loaded movie is: this movie needs the funktion:
Stage.scaleMode = "noScale";
Stage.align = "TL";
If i dont have this code inside the movie is not going to resize fullscreen into the main movie. Inside this movie im scalling photos and some mc's You can take a look what i mean under: [URL]
If you take a look to the bar where the Number of pictures (30) are you will see that the lower bar and the pictures is not going to scale to fill the full screen if i delete the this code;
Stage.scaleMode = "noScale";
Stage.align = "TL";
View 3 Replies
Jan 2, 2005
I wrote this AS for my preloader which schould be able to load a movie clip after pressing a specif button in the main sceene:
[Code]....
1) The problem is that to be able to target a movieclip I will need to give it a instance name. Where can i find this function in MX ?
2) I cannot understant how I schoul put a loadBar being a small movieclip on the main timeline, I think( the same timeline the container clip is at ) or maybe not ? well I am bit confused now..
Well I have done already a sceene preloader for my site and it works perfectly and i did not experience any problems as Im having now with this new kind of preloader.
View 2 Replies
Apr 21, 2008
I'm creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file
loadMovie("deepbartesting.swf", maincontent);
this.onEnterFrame=function(){
if(movieClipName._currentframe==5){
[Code]....
the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?
View 1 Replies
May 22, 2003
I can't believe I didn't knwo this before!..or maybe I did...! then I forgotI load a movie_root.sub.loadMovie("subm.swf", 1);How do I make a preloader into the loaded movie_root.getBytesTotal(); and _root.getBytesLoaded won't work now cuz _root.is nt the main timeline of the main movie!hat am I supposed to use?_level1. ? _root.sub. ? _parent. ?
View 7 Replies
Sep 21, 2010
I like to play external preloader before it's load original movie index.swf. But I have a problem on resizing index movie. Sample files on link [URL].
Here is preload AS3 code:
package{
import flash.display.*
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
[Code] .....
View 5 Replies
Aug 4, 2009
I have the following preloader code which works fine when loading movies individually, but when I put all files on server and try and load my external movie clip it does not load.[code]
View 2 Replies
Oct 11, 2009
I'm building a website, in which the 'Gallery Page' has a link to an external swf file, which is a scrolling clip of thumbnails.
What I want to do, is create each thumbnail into a button, which will then play a Movie Clip from a frame located in the Main swf file. (So basically, each thumbnail button is a small photo, will play that photo in a large scale as a movie)
eg.
thumbnail1_btn needs to go to main swf and play movieclip1.mc, frame 1
thumbnail2_btn nends to go to main swf and play movieclip1.mc, frame 2
View 2 Replies
Jan 21, 2003
I have a problem with preloading external swf's into my main movie actually I have a a seperate preloader setup for each external SWF and when i click a button to load an external movie its not showing a preloader it anoying to wait while movie loading without seeing a prelaoder.
View 8 Replies
Jan 5, 2005
I am a bit new to the world of externally loaded swf's. I am trying to load an swf into my main movie, and then access/control the movieclips within that newly loaded swf, but for some reason it is not working.
Here is a quick example:
this.menu.createEmptyMovieClip("myMovieClip_mc",this.menu.getNextHighestDepth()+1);
this.menu.myMovieClip_mc.loadMovie("\menu\standard.swf",this.menu.getNextHighestDepth()+1);
this.menu.myMovieClip_mc._lockroot = true;
trace(this.menu.myMovieClip_mc.option);
this.menu.myMovieClip_mc.onRollOver = function() {
trace("Hello?");
this.bounce(120);
}
Okay this code does sucessfully create the movieclip but my onRollOver function does not work, and I cannot access any of the movieClips within myMovieClip_mc such as option, it traces out as undefined.
View 2 Replies
Sep 15, 2007
I am trying to place an external .swf into my main movie.
I created a container movie for the .swf in the main .fla:
Code:
this.createEmptyMovieClip("mapcontainer",this.getNextHighestDepth );
mapcontainer._x = 163;
mapcontainer._y = 101;
[Code]....
I imagine that the solution lies in readjusting _root for the fact that the external .swf is now placed inside a parent, but I don't know how to do that.
n.b. my final movie is meant to run offline.
View 2 Replies
Nov 5, 2008
I have two files main.swf and external.swf i have use the following script on main.swf to do animation
import mx.transitions.Tween;
import mx.transitions.easing.*;
[Code]....
which work perfectly fine. Now due some reason i had to place the navigation bar in the external movie clip , in external.swf Using the same script how can i control the textBox animation which is on the main.swf??
View 1 Replies