Preloader for multiple scenes

Hi, I'm trying to make a web site, I have 7 scenes and everything is working perfect. But here's my question.
When I try to make 1st scene as a preloader nothing happens. Preloader never shows up and it jumps directly to 2nd scene "Main"
Here's my code:
stop();
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void {
          var total:Number = this.stage.loaderInfo.bytesTotal;
          var loaded:Number = this.stage.loaderInfo.bytesLoaded;
          bar_mc.scaleX = loaded/total;
          loader_txt.text = Math.floor((loaded/total)*100)+ "%";
          if (total == loaded) {
                    gotoAndPlay(1,"Main");
                    this.removeEventListener(Event.ENTER_FRAME, loading);
Also if I delete my contents in the "Main" scene and leave a single image, code works perfect.
Preloader shows up and then loads my "Main" scene.
How can I code it, as it first calculates my whole scenes, and shows my 1st scene "preloader" at the beginning.

I followed the tutorial, here's the code he suggested.
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS. loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE. done);
l.load(new URLRequest("main.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);
When I try to export this, flash gives me an error with line 2 and line 3.

Similar Messages

  • Preloader for multiple images

    I want to create a preloader which loads multiple images at a
    time.
    i tried the normal script with getBytesTotal() but it
    provides the bytes of currently loading image, so the preloader
    only works for one image at a time.
    how can i get the size of all images that i want to load ?
    Thanks

    Thanks for the help
    I can load the images in sequence one after another. But
    there are few points to be considered here.
    1. I want to display all images at once, when they all are
    loaded.
    2. I want to display only one preloader for all images while
    they are loading.
    3. I can't hardcode the size of images because images will
    keep changing for the movie. So i can't use a particular size. (and
    hardcoding the values for dynamic data is not a good coding
    practice i guess.
    Thanks

  • Need Preloader for Multiple SWF files

    SORRY FOR THE DUPE POST, THE OTHER CAN BE DELETED. MY ADOBE
    ID PROFILES WERE MESSED UP.
    Hi forums, I'm new to Flash. I did the following:
    1. Created a complex home page, about 3.5MB in size, due to a
    large graphic I had to use many times over and couldn't make into a
    symbol (long story). It's called INDEX.SWF, with accompanying
    INDEX.HTML file from Flash
    2. Split pieces of the INDEX.SWF file into multiple SWF files
    to make it load faster
    3. Created multiple layers in INDEX.SWF using loadMovieNum to
    call to multiple SWF files from step 2
    This works OK, but I think a preloader would optimize my page
    animation. However:
    1. I don't understand how a preloader file gets recognized on
    the site load. If I create a file called PRELOADER.FLA and publish
    it, how does the site know to use it first? Does it need a special
    name?
    2. Once I understand #1 above, I might be able to use some
    sample preloader files I've found. It seems like all I have to do
    is change the actionscript to point to my main file, but not sure
    yet. I'll get to that next once I understand how the file even gets
    recognized and loaded. Thanks for your help!

    PLEASE DELETE THIS POST AND USE NEWER ONE FROM
    MOUSEHOUSESITE, I APOLOGIZE FOR DUPE POST DUE TO MESSED UP ADOBE
    ID.

  • Basic preloader for multiple swfs?

    I've looked at 100+ discussions around the web, not one good answer.
    I want some AS3 script equivalent to the following script (which I've made-up):
    loadallthefollowingswfs.intocache("home.swf", "products.swf", "contact.swf");
    I want a bunch of different swfs, all of which are in the same directory, to be loaded into the cache prior to viewing any of the swfs.
    I would like to put this script into the first frame of an index.swf
    Upon loading ALL of the swfs into the cache, it will move on to frame 2 of the index.swf and continue forward.
    All of the other discussions around the web state to either "have each swf load once it is opened" (I don't want that, I want them all preloaded into the cache prior to viewing any one of the swfs), or the discussions say "you should combine all of the flas into a single fla and just preload that one swf file (I don't want that either, I want seperate fla/swf files).
    Anyone have any suggestions on how to load multiple swfs into the cache when accessing one frame of an swf?
    Thank you.

    Greetings,
    Actually I just want to ask you guys about  how will I be able to use these snippet? I tried to insert a trace inside the else area of the if statement, but, didn't showed up any results in the output window...
    BTW: I just paste this snippet inside a new layer new flash file and saved it along with the two .swf files.
    var swfA:Array=["home.swf","works.swf"];
    var index:Number = 0;
    var targetMC:MovieClip=this.createEmptyMovieClip("targetMC",this.getNextHighestDepth());
    targetMC._alpha = 0;
    var mcl:MovieClipLoader=new MovieClipLoader();
    var lo:Object = {};
    lo.onLoadInit = function(target:MovieClip)
    index++;
    if(index<swfA.length)
    loadF();
    else
    // all are  loaded.  do whatever
    trace("Load Ok...");
    loadF();
    function loadF()
    mcl.loadClip(swfA[index],targetMC);
    here's my code
    var swfA:Array=["home.swf","works.swf"];
    var index:Number = 0;
    var targetMC:MovieClip=this.createEmptyMovieClip("targetMC",this.getNextHighestDepth());
    targetMC._alpha = 0;
    var mcl:MovieClipLoader=new MovieClipLoader();
    var lo:Object = {};
    lo.onLoadInit = function(target:MovieClip)
    index++;
    if(index<swfA.length)
    loadF();
    else
    // all are  loaded.  do whatever
    trace("Load Ok...");
    loadF();
    function loadF()
    mcl.loadClip(swfA[index],targetMC);

  • Multiple scenes not working on any computer except my own.

    HI everyone,
    I try to run a swf or html file of my fla file and it only works on my machine but not on my laptop. I have the latest flash player installed but it still doesn't work.  Can anyone advise. My laptop works for single scenes swf and html but not for multiple scene file.
    Aron

    it just sits there and nothing moves or comes on when I hit the play button in my application.  I have tried running a swf file through firefox and an html publications of my file but they don't seem to work on my lap top except for on the original computer I created the app on.
    Could you or anyone please tell me if these links work http://dl.dropbox.com/u/307778/Gemoro%20BovoMetzia%2023b-1-9%20Scenes.html
    http://dl.dropbox.com/u/307778/Gemoro%20BovoMetzia%2023b-1-9%20Scenes.swf
    Thanks for your help
    Aron

  • How do I make multiple text bold, for example scene headings or character names?

    How do I make multiple text bold, for example scene headings or character names?

    You can do that by editing the template of the document.
    Open the document, go to Edit->Template. A dialog will launch which will have element types on the left and it's properties on the right.
    Select Scene Heading(or Character name) on the left. On the right, go to 'Text' tab and click on Bold checkbox.
    Press OK.
    Hope this helps.
    Cheers,
    Sunny

  • Possible to have multiple views for one scene?

    Away3D allows multiple Views to be created for one Scene, allowing different camera positions for the same geometry.
    Can Proscenium support this? I've been banging my head against a brick wall for a while now...
    Joe

    Hi Kopaacabana,
    (I  feel like I'm in one of those post-apocalyptic scenes where the last two humans left on earth finally meet.....)
    Thanks for answering!
    Yes, I've actually got two cameras quite happily working in the scene, the problem is that I need to re-use the geometry for the scene in two windows, or at least, two separate parts of one window simultaneously. Away3D can do it very easily, where one sets up a 'View', which has a 'Scene' it views. With Proscenium it seems that the whole thing is tied up with an Instance3D, which is fine for one camera, but the scene nodes seem tied up as children of some root scene node. I've tried assigning the scene data as a child of two instances of BasicScene (hacking the stage3ds[number] to be different for each), but that causes an exception.
    Just changing the activeCamera changes the view to the new camera, where I actually need to be able to render to two windows/screen areas from one set of geometry.
    I would have hoped that the paradigm would have been 'here is some geometry, lights, etc., now do with it what you will'
    Adobe, are you there to help us out, like, anyone at all? Are we wasting our time with this?
    Joe

  • Using a function in multiple scenes

    I have a .fla project being created under CS4, using
    ActionScript 3.0, that consists of multiple scenes.
    In the code attached to the first scene, I define some
    functions that are used as methods on buttons:
    function MouseDown(TheKey:Object):void
    TheKey.alpha=0.6;
    function MouseUp(TheKey:Object):void
    TheKey.alpha=1.0;
    function AlphaPoint6(event:MouseEvent):void
    MouseDown(event.currentTarget);
    function AlphaonepointO(event:MouseEvent):void
    MouseUp(event.currentTarget);
    And I use a couple of the functions as EventListener methods
    on buttons
    Key1.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key1.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    So far so good.
    Then, I create a second scene in which I have some other
    buttons.
    When I try using the same functions as eventlisteners on
    these buttons, in the code for the second scene:
    Key11.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key11.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    then, I get the error messages
    1120: Access of undefined property AlphaPoint6
    1120: Access of undefined property AlphaonepointO
    BUT, if I try declaring these functions again with the script
    of the second scene, I get the error message
    1021 Duplicate Function definition
    So, I seem to be stuck between a rock and a hard place. On
    the one hand, when the compiler parses the second scene, it
    believes those functions are defined (as it is not happy if you try
    defining them again). On the other hand, the compiler does not
    think they are defined. as it considers them to be undefined
    properties.
    Does anyone have an idea about how to resolve this conumdrum?

    One option is to not use scenes. Just take what you have as
    scenes and either place them in the one timeline, or convert them
    into movielcips. In my own design work, I have never used scenes.
    When I first encopuntered them via someone else's design, I
    immediately disliked them because it meant I had to search thru
    inobvious places to find things that needed to be revised. Other
    folks that help in these forums have their own reasons for
    promoting not using scenes... troublesome, unreliable, outdated,
    etc

  • Multiple Preloaders for Multiple Movie Clips

    Designed in Flash 8, the site's timeline is all in Scene 1
    and is comprised of an introduction, which contains a short video,
    and 6 movie clip categories that the user selects to view. Since I
    want the intro to play as soon as possible, I'd like to limit the
    first preloader to just the video in the intro and not
    _root.getBytesTotal. Then, as the viewer watches this short video,
    the rest of Scene 1 movie clips will keep on loading. After the
    intro, the viewer will choose which of the 6 categories to view.
    These categories are identified with buttons which play the
    particular movie clip. Since I don't know the order of the
    categories they will select, I thought there should be a separate
    preloader for each category. Hopefully, after they view a category,
    the rest of the categories will have loaded and the loading time
    will be nil. The design for the preloader is comprised of a status
    bar and a percent loaded. Is there a way to limit the
    _root.GetBytesTotal to specific frames? I know I could break these
    categories up into separate SWF files but then I loose the
    advantage of one loading while another is being viewed.

    MovieClipLoader is a built in class of functions that will
    allows you to easily load Media (swfs/jpgs) from external sources.
    This will create a MCL object
    var mcl:MovieClipLoader = new MovieClipLoader
    We want the MCL object to receive events for any movie that
    is loaded into the main timeline
    mcl.addListener(this);
    Ok. now we have a movie clip loader that is able to recieve
    events. Since we want to show the progressive download and want to
    do something with that content after it loads, we need to declare
    two event handlers onLoadProgress and onLoadInit. onLoadProgress is
    pretty straight forward. onLoadInit executes it's action as soon
    all of the AS on frame 1 of its time has finished loading. In this
    case, we want two different things to happen. 1st, load the first
    clip and show it.... 2nd, load all remaining clips into the buffer.
    But first, lets declare those next...
    function onLoadProgress( target:MovieClip,
    bytesLoaded:Number, bytesTotal:Number):Void {
    // standard preloader code goes here
    function onLoadInit( target:MovieClip ):Void {
    // display the clip - this will be as easy as just calling
    our loadClip function for the mcl...more on that in a minute
    // If you want something special to happen, i.e. movie fades
    in or a mask is applied to it, you'd do that here.
    Now all we need to do is call the loadClip member function
    for the MovieClipLoader. Just replace the two parameters with the
    location of the swf and then the name of the instance you want it
    to load into
    mcl.loadClip( "myswf.swf", targetMovieClip );
    The other movie clips are now a breeze as well. For each
    button, just add an on(release) or onRelease = function (depending
    on your situation) to just call that mcl.loadClip() line from up
    above. Just change the movie you want loaded.
    Let me know if you need more help...

  • Is there a way to make multiple Scene Menus?

    I am using Premiere Elements 8.0 to make a DVD of different slideshows. I was wondering if there is a way to make multiple Scene Menus from a single Main DVD Menu. I want to be able to link to a second scenes menu not connected to the first one, almost like a Deleted Scenes or Special Features option on a DVD.
    Thanks for all the help!!

    Not directly in PrE. The Menu Sets are designed to automatically generate the necessary Scene Menus, based on the DVD Markers, and linked from the Main Menu.
    One can use an authoring program, like Sony's DVD Architect to do what you want. One would Export/Share the Timeline, and then Import that into DVD Architect.
    There are some tutorials, and also a link to Steve Grisetti's book on Sony DVD Architect on the Muvipix site.
    Hope that this helps, and good luck,
    Hunt

  • Multiple scene interface in javafx

    Hi,
    How can i achieve multi scene interface under single stage with common menu bar in javafx ?
    i.e,multiple scenes should change in single stage and Menu bar should be common for every scene.
    I am using javafx scene builder to build Gui’s.

    i believe the answer is that Adobe is following Windows Programming User Interface Guidelines, that Microsoft itself doesn't always follow.

  • How to use Keychain for multiple users on one computer?

    I have a new Macbook Pro with Yosemite.  I just moved over from PC for my work computer and the Keychain thing is killing me!  I am a social media consultant so I manage multiple accounts for multiple clients.  I need a way to log in and out as them on many different platforms.  The reality is that I am the only user but I log in and out of different things as if this was a public computer with multiple users. 
    PC allowed me a drop-down option with each login.  For example the email box could be clicked and then I could select the client email that I needed to fill in.  The password would then auto-populate.  Is there any setting I can change to make this happen on a Macbook? I have been logging in, deleting the info in Keychain, then logging in for the next client, delete...etc.
    Most password managers don't work because of this same problem.  Please don't recommend a password manager app unless it can handle logging in and out of (for example)10 different LinkedIn profiles.
    Any advice would be greatly appreciated!

    Tanja Turtsanyi wrote:
    I have a new Macbook Pro with Yosemite.
    Apple>About This Mac>More Info>Service
    Please read the warranty paperwork that came w/your computer.
    You have 14 days to return the computer w/no questions asked. 
    You have 90 days of FREE phone tech support on top of your standard 1 year warranty unless you also purchased AppleCare which gives you an additional 2 years of coverage plus FREE phone support.
    Strongly suggest that you take FULL advantage of the above before it runs out.  Let Apple deal w/the problems.
    Mac OS X (10.4)
    Conflicting info:  Please update/correct your profile so that you can receive the correct troubleshooting suggestions.  This will assist the users in trying to help you.  Thank you.

  • Itunes for multiple family members

    My situation is I've been using iTunes since its inception and built quite a library. I've been through multiple ipods and now on to iphones for multiple family members. All the while using one itunes account on separate devices for multiple family members. Now that we have iphones its become necessary to create separate icloud accounts for each family member. This creates a problem for those with new icloud accounts. The iTunes music library can no longer be shared on separate devices (that I know of). The music library and playlists I have built over years cannot be shared with those devices that now have separate icloud accounts. I am aware of "family sharing" and have set that up going forward but how do I resolve the issue of all the music and playlists that were shared when we all used one itunes account, prior to creating separate icloud accounts? I hope this makes sense. For example my wife and son no longer have access to any of the music/playlists on their iphones that they used to have prior to creating their own accounts. Even though all purchases made before and after creating separate icloud accounts were made using the same credit card.
    I believe I could just go back to having the other devices sign back into my itunes account and I think that may resolve the issue but what happens to purchases that were made on the other devices while they were signed into their own accounts? Another point that comes up is that we all have gift card balances on each itunes account. This is so confusing

    This is great news as I've been struggling with this issue for some time. Mainly because my wife is a little old school and likes to put music on CD's and this solves that problem. Thanks again!!
    Mr Mars,
    You are welcome!  I hope you have achieved the expected degree of "harmony." 
    Family Sharing:  A new way to bring harmony to your family’s digital life
    Ed.

  • I have one apple ID for multiple devices in my family.  I'd like to keep it that way for itunes/app purchases.  I would like a simple step 1, step 2, step 3 response on what I need to do to separate all other features like imessage, contacts, emails, etc.

    I have one apple ID for multiple devices in my family.  I'd like to keep it that way for itunes/app purchases.  I would like a simple step 1, step 2, step 3 response on what I need to do to separate all other features like imessage, contacts, emails, etc.
    I have been reasearching how to do this on the internet, but I haven't found an easy explanation yet.  My family is going crazy over each others imessages being sent to others in the family and not being able to use FaceTime because of conflicting email addresses.  I have read that if each person gets their own iCloud account, this would work.  However, I need to know what to do after I set everyone up with their own iCloud account.  Do I make that the default email address to be contacted or can they still use their hotmail email addresses.  Any help- with easy explanation- would be much appreciated!!

    We do this in my family now.  We have one account for purchases, so it is used to share music and apps (I think that is in Settings/iTunes & App Stores).  Each iDevice has this configured.
    Then, each of us has our own iCloud account that is configured under Settings/iCloud.  That then allows us to have our own Mail/Contacts/Calendars/Reminders/Safari Bookmarks/Notes/Passbook/Photo Stream/Documents & Data/Find My iPhone/and Backup.  That Backup piece is pretty sweet and comes in handly if you replace your iDevice.  You can just restore from it.
    So we all share the Apple Store account but we all have our own iCloud accounts to keep the rest seperate or things like you mentioned are a nightmare.
    In answer to what iCloud does for you: http://www.apple.com/icloud/features/
    Think of it as an internet based ("cloud") area for all of those items listed in my response.  What you need to remember is photo stream only maintans the last 1000 pictures so don't count it as a complete backup solution for your pictures.  Even though I rarely sync with a computer these days, I do still try to sync my phone with iPhoto (I have an iMac) so that I have copies of all of my pictures.  1000 may not stretch as far as it sounds.
    Message was edited by: Michael Pardee

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

Maybe you are looking for

  • Download file from AL11 into CSV to load MD into BPC

    Hi All I have an issue in downloading file from AL11 which is in the form of CSV. 1) I have exported the masterdata for Costcenter using a Open hub. 2) The file is residing at the app server AL11 in the form of CSV. 3) I want to down load the file in

  • Java Applet in ASP.

    Is it possible to embed a java applet in asp? If so would it be possible to use a java applet to encode a string of text to be sent to a database?

  • Testing Custom Resource Adapters

    Hi All, I am currently in the process of developing and (unit) testing a custom resource adapter. I noticed that there is a SkeletonResourceTests.java file although it has a dependency on the com.waveset.junit package which appears not to exist... Do

  • Updating Business Rule access and security

    Hi All, We have recently load balanced the planning servers, as a part of this currently we have to update "Location" and "Acces Privileges" tabs to reflect "All Locations". There are hundreds of business rules for us across all servers. I was hoping

  • How reload software 513

    it asked me for my password and typed it in and it said in vaild password then type black berry it did that for 5 times then it said wipe memory then now it says reload software 513