Actionscript 3.0 :: Main .swf Begins Playing Before Preloader Completes
Jul 9, 2009
I just followed Lee Brimelow's 'Preloading in Actionscript 3.0' tut - it was easy to follow and implement. However, when I upload my files to my webserver to test, the .swf that I'm loading begins to play before the preloader completes. Actually, to be precise, the main swf has an audio file in the background that begins before the preloader completes. The stage of the main swf doesn't appear until the preloader completes. Prior to this, I was using a 'scenes' method of preloading, that didn't have this problem, but I kept running into a 1009 error, so thought I'd try a different method...
Here is the actionscript for my preloader:
Code: Select allvar l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("CelebrateV4RPLY.swf"));
[Code].....
View 4 Replies
Similar Posts:
Nov 28, 2009
when a external swf file gets loaded into main swf file, i need to detect while playing external file reach to end so that i can unload that file and move to another frame on root of main file. I am not getting how to identify external swf play reach to end so that i can unload swf and jump to root specific frame of main swf.
View 1 Replies
Jul 15, 2003
why there is a gap of 5secs (ish) between my swf opening and my preloader starting (at like 90% complete)?My first frame contains 228kb of info, could that be it? If it is, I cant see what it is to cause this.
View 3 Replies
Oct 4, 2010
My external .swf is playing before it's even finished loading from the COMPLETE event. W
I can understand it might work like streaming an mp3 or something... but it's not like anyone can see the first parts of the loading movie while the preloader does its thing. I also want this to be automatic... so I can avoid having the user click to enter or click to start after the preloader is complete. Lastly, the loading .swf has stop() on frame one...
Preloader Code:
Code: Select allintro_mc.mask_mc.scaleY = 0;
var childrensApp:Sprite= new Sprite();
var childrensAppLoader:Loader = new Loader();
[Code].....
View 9 Replies
May 27, 2011
I have an external preloader that plays music while the main swf is loading. Everything works fine but it sounds a little abrupt when the music just stops as soon as the swf is loaded. Is there a way to start fading out the music when the progress bar gets to, say, 80%, so that by the time the main swf opens, the music is completely faded out?
View 9 Replies
Mar 9, 2004
[URL]
They have an MC or something play and then a preloader and then addtional MCs...
Is it really just an MC that plays and then a preloader and then an MC? I thought we had to have a preloader at the beginning of our site.
View 2 Replies
Mar 9, 2004
[URL]
They have an MC or something play and then a preloader and then addtional MCs...
Is it really just an MC that plays and then a preloader and then an MC? I thought we had to have a preloader at the beginning of our site.
View 2 Replies
Feb 23, 2009
I have a basic preloader for my site:
First Frame
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
[code]....
View 8 Replies
Feb 16, 2007
Below is the action script to load an external .swf and display the preloader (typical 100 frame). My problem is that, the .swf will begin to play behind the preloader as the content is still loading, it will not wait for the content to fully download. I appear to have everything setup almost exactly like most of the MovieClipLoader tutorials i've seen and I cannot fix this problem.
Code: Select allvar myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
[Code].....
View 7 Replies
Aug 1, 2003
my question is why the transition animation sosen't work on this code i already read the tutorial at kirupa, but im using diffrent code
View 5 Replies
Aug 26, 2008
Every time I try to make one ...the preloader loads with the content instead of playing and checking to see if all the content has been loaded and then continuing.
View 1 Replies
Jan 14, 2009
So, I have this file with a couple buttons. When each button is clicked it opens an external swf image. While the external swf is loading a preloader shows 1...100. I want to have a movie symbol also show up while the external swf is loading. How would I do that? Can I have it only show when the event starts, then have it disappear when the event completes..
I have my two buttons on one layer, actions on a second layer, and preloader counter on third layer.
View 9 Replies
Oct 2, 2009
Reference Site: [URL] Also see attached source file.
I've just built my first preloader, and the first time loading it, it works great in Internet Explorer 8 (with latest flash player), but on reload or on reopen of browser, it doesn't autoplay the second scene (main scene). Works great in Firefox and Chrome.
I've searched the internet up and down with no luck on solving this problem.
Here is my ActionScript 3.0 for the preloader:
[Code].....
View 2 Replies
Mar 23, 2012
External swf is playing when preloader does not complete.I can not access external swf.My codes;
package com
{
public class MainClass extends Sprite
{
[code]....
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
Feb 17, 2010
I have just started to work in AS3 and stuck in a problem. I have created a fla document named main.fla I have defined the document class as Main which is attached. The problem is preloader shows only when the file is completely loaded. How can I appear the progress preloader for the main file.
View 4 Replies
Nov 22, 2009
I have been trying to figure out the following:
main.swf - contains my photo gallery application
preloader.swf - loads the main.swf file and on COMPLETE event displays it
At the moment the gallery list is in the XML file and the XML file is loaded from the main.swf file. However, as the XML file will grow, I want to preload the XML file along with main.swf file in the preloader.swf and then pass the XML data to the main.swf file so that main.swf file can use this XML data and can create the galleries from there. I am using AS3 Project in Flex Builder 3.
View 5 Replies
Mar 29, 2009
Yet another dilemma with my external SWFs. How do I get the external SWF to only begin playing once the preloader ahs finished loading the complete file. Currently when the SWF file comes it has already started playing part way through the file.
View 2 Replies
Jun 15, 2009
I would like to make a preloader that has a movie clip playing. It's basically a looping movieclip. Also, I have an animation to play as the actual preloader.What would be the best way of going about this? I have basic actionscript skills but, i'm trying to learn a best practice to use while utilizing as3.
View 2 Replies
Mar 23, 2012
External swf is playing when preloader does not complete.I can not access external swf.My codes;
package com
{
public class MainClass extends Sprite
[code]......
View 2 Replies
Oct 3, 2009
I don't have much experience with buttons and barely any with action script. I am trying to make a button that is a non-animated symbol on up, a glowing version of the symbol on over, and on down the symbol swaps to an animated symbol that moves across the screen.
But, on the down state, the symbol does not animate like it is supposed to. When I hold the mouse button down, the glow goes away, but the symbol just does not animate as specified in the symbol that appears during the down state.
I tried experimenting with making the button move on the main timeline, adding a stop() command in one of the layers of the up-state symbol, and then adding a play() command to one of the layers of the down state symbol, but nothing seems to work.[code]...
View 4 Replies
Nov 5, 2009
I bought an mp3 player that was supposed to prevent multiple instances of the player from playing at the same time. In other words, if I was playing an mp3 on one instance of the player and then pressed play on another instance, it would pause the original mp3. However, it is not functioning like this and the author of the flash player is not responding to my emails. I've included the code below:
magicmp3.fla:
Code:
if (songName == undefined) {
songName = "songs/VanessasDub.mp3";
}
[Code]....
View 5 Replies
Feb 1, 2010
I have 2 files. I loaded img.swf to the main file and try to make preloader in main.fla file.
But after compile i get error: 1084: Syntax error: expecting identifier before modulus.
Code:
var req:URLRequest=new URLRequest("img.swf");
var myLoader:Loader=new Loader ;
function imgFileLoaded(event:Event):void {
[Code].....
View 7 Replies
Dec 11, 2010
I'm using the sample external preloader file supplied with CS5 as the basis for my customised pre-loader. It's working fine except that once the main site has loaded and is open, the preloader remains loaded in the background.[code]...
View 7 Replies
Aug 13, 2009
I'm using a preloader SWF to load my content SWF and XML file, and when the COMPLETE event fires I'm using the following code to send my XML data to the content SWF -ActionScript Code:evt.target.content.sendXML(XMLData);I then have a sendXML function in the content SWF that picks up the data.This works - but I can't access XMLData right away (it's null if I trace it). But if I set up a timer with a tiny delay which then checks XMLData, the information is there.It seems to be a bit of a dumb way to do things. Has anoyone else got a better solution or a way that will allow access to the variable right away?
View 3 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 24, 2009
I have three FLV videos playing on my main time line.they are each set to auto play and the are each on individual frames.lets say frame 30-31 and 32.how do I have the video stop playing once it detects that the user clicked out of that frame?my problem is the video or I guess it's just the audio keep on playing even though I am already viewing some other page.
View 2 Replies
Oct 16, 2010
I've created six movie clips of cursive text effect using masking for the animation. Each clip is approximately 160 frames long. I need to play these sequentially, one after the other, when the page loads. structure multiple clips to play after each other?
View 3 Replies