A Flash Developer Resource Site

Page 5 of 9 FirstFirst 123456789 LastLast
Results 81 to 100 of 172

Thread: loaded Movies and preloaders

  1. #81
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522

    Misunderstood...

    Milosav,

    I think you might've misunderstood my earlier question about putting flash onto cds or using it in Director..I'm very familiar with those two methods...what I was referring to was LoadMovie in those mediums...since bandwith isn't a problem, you probably wouldn't need separate swfs. So, I'm wondering how you would do what we've been doing..having a main flash movie and only using 1 frame...having a stop action...can you load things into movie clips that are stored in the flash library? This way everything would be included in the one flash movie since file size isn't a prob and you could do alot of different things in one frame of the movie without using a bunch of scenes (I'm used to using flash 'scenes' and I'd like to find an alternate to this..loadmovie has helped!)...

    As for publishing to exe or swf that topic I'm very familiar with

    Any ideas...?
    Foochuck
    http://www.myspace.com/foochuck

  2. #82
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi again,
    foochuck:
    As far as I know loadMovie() is the only method to import a
    movie onto the timeline. Though you can use runtime sharing of
    Symbols to pull symbols into your movie from a central library.
    You cannot assign actionscript that affects runtime shared Symbols
    making them less versatile. So other than having all your content
    in the Library then using attachMovie to attach it to the timeline
    I am no wiser than you. I can see what you are looking at and it
    sounds very appealing!!!

    foochuck and aaron: there are a lot of typing errors in the last script I posted (I will try and be more carefull)!!

    I have tested the script since my last post and there is a problem with this approach ... your progress bar does not appear until 20% into the load. That was with the preloader bar either loaded into
    a MC instance or into a level.

    Aaron and I have been looking into this problem and one solution
    is. To make a base Movie that consists of less than 1KB.
    All it has is a preloader script that firsts loads the preloader
    into level 4 then charts the load of your real main movie into a
    movie clip instance on the base Movie timeline.

    Aaron you can check this at:
    http://www.trump.net.au/~Milosav/aaron

    I have tested this at a connection speed of only 14400bps
    and the loader appears and begins it's stuff within 4 seconds!!!!
    I think that you may not get it much faster than this.

    It also means that you can use this preloader whenever you need
    it with the same _level4.LoadBarFill._xscale= type calls.

    The .fla files are available at:
    http://www.trump.net.au/~Milosav/aaronA.zip

    foochuck this work that aaron has done answers some of your
    questions. And it shows the benifits of having a Control Movie
    if you want to call it that with your preloader code centralized.

    Aaron let me know what you think.

    Milosav

  3. #83
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Back again,

    Wrong URL on the .zip file

    This is right:
    http://www.trump.net.au/~Milosav/aaron/aaron.zip

    Sorry.

    Milosav

  4. #84
    phoenix
    Join Date
    Mar 2002
    Location
    Auckland, New Zealand
    Posts
    55

    Milosav Help me please :eek:

    Milosav, I;ve been following/reading your replies to these fellows, but I felt like I was jumping into the middle of a conversation. So I figure it may be better if I post my question anew.

    SITUATION:
    I have a main.swf which contains 4 buttons, each to load an external movie. Each external movie has the same dimension as main.swf, which look like a rectangle with contents inside. Let's call the external files: a.swf, b.swf, c.swf and d.swf. Now, I want to completely cover main.swf (_level0) with the newly loaded external .swf, which I load into level 1.

    Each external movie is so big that I need a preloader that comes up while a.swf is being loaded into _level1. So I created preloader.swf and put it into _level2. At the beginning of my main.swf I had a frame action to load preloader.swf and store it in _level2. I make sure preloader.swf had an empty keyframe at frame 1 and stop(); script.

    PROBLEMS:
    Problem 1
    I clicked button 1 and my playhead goes to a framelabel which contains frame actions:
    loadMovieNum ("a.swf", 1);
    _level2.gotoandPlay(2);

    My preloader works for awhile and then froze, while a.swf is loaded into level 1 and froze halfway too. I know this because a.swf has a sound object that supposed to play after around 3 seconds.

    Problem 2
    I got rid off the preloader and wanted to see wheter a.swf has been loaded properly. It turned out that the sound object in a.swf doesn't work and I can not interact with most part of a.swf. a.swf has a scroller function and rollover functions. None of them work.

    Could you help me on this matter Milosav?

    Thank heaps,
    Phoenix2779

  5. #85
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    Man Milosav, you are an expert! I haven't looked over the fla's cuz the school doesn't have flash. I'm sure that it will work beautifully. Thanks for all your help!

    Aaron

    Have you seen how many people have viewed this thread??

  6. #86
    Junior Member
    Join Date
    Dec 2002
    Posts
    23
    milosav, did you forget about me?

  7. #87
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi tgfx,

    No haven't forgotten you ... just trying to cover everyone.

    The load count numbers and stopping the movie returning to
    do a load even though the .swfs may be loaded.

    I was hoping to post back on that latter today and have a
    new example and .zip on my web space. Will post back later
    with that.

    Milosav

  8. #88
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi Phoenix2779,

    Jump right in the more heads put together the better.

    It is really difficult to tell what is wrong with a
    preloader as most Movies are put together in a unique
    way.

    Can you .zip up your main Movie with the four buttons
    and your preloader.swf and attach ttem to this thread?

    I will have a look at them. If the .zip file is larger than
    102Kb post back and I can give you my email.

    p.s What version of flash do you use??

    Milosav

  9. #89
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi to those just viewing this thread,

    There have been a number of examples put together
    through this thread you can find them at the following
    URL's. If you have any questions concerning them post
    back. They all deal with loadin .swf's preloaders and
    pre loader bars. Mutliptle .swf loading etc.

    Example 1: load .swf's from basic frame action.
    View it working at:
    http://www.trump.net.au/~Milosav/example1
    Get the .zip file at:
    http://www.trump.net.au/~Milosav/exa...e_part_One.zip

    Example 2: load .swf's from buttons and change MC Properties.
    View it working at:
    http://www.trump.net.au/~Milosav/example2
    Get the .zip file at:
    http://www.trump.net.au/~Milosav/exa...e_part_Two.zip

    Example 3: load .swf from button with preloader and bar.
    View it working at:
    http://www.trump.net.au/~Milosav/example3
    Get the .zip file at:
    http://www.trump.net.au/~Milosav/exa...part_Three.zip

    Example 5: load .swf's from buttons each with preloader and bar.
    View it working at:
    http://www.trump.net.au/~Milosav/example5
    Get the .zip file at:
    http://www.trump.net.au/~Milosav/exa..._part_Five.zip

    Hope they help.

    They all build on the previouse example so are easyier to
    follow.

    Milosav

  10. #90
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    Milosav,
    It does work very well! Just a few things i dont understand.
    The whole 'current stage' thing i dont get and do i just use the loader i was using because in the zip there was no loader?

    Thanks a lot!
    Aaron

  11. #91
    phoenix
    Join Date
    Mar 2002
    Location
    Auckland, New Zealand
    Posts
    55

    Thanks Milosav

    Cheers for those links Milosav. I managed to fix my script bugs beforehand, but your links pretty much sum up the basic preloading and external swfs matter.

    Would you be able to check my new post entitled "Music Loop won't play after LoadMovie?"

    That will be great,
    Phoenix2779

  12. #92
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi tgfx,

    Ok I worked on your files and have uploaded it to may
    web space.

    You can view it at:
    http://www.trump.net.au/~Milosav/tgfx
    and get the .zip fla file (still B-I-G) at:
    http://www.trump.net.au/~Milosav/tgfx/neonB.zip

    I have thought about what you are doing and this is
    a method I use when dealing with a small data base of
    .swf .jpg's.

    Create a directory structure in your root directory
    that suits the content types / groups. In your case the
    content is a data base of images.

    So in this example I have created the directories.
    "artImages"
    "funkyImages"
    "commImages"

    So in your nc-loader a _global variable is initiated.

    _global.currentImageDirectoryPath="artImages/";

    It is set to the path to your default set of images.

    In the button events we now
    1: check to see if the user is already viewing the
    current image set related to this button.
    2: If they are then nothing needs
    to happen.
    3: If the current images set is not the image set related
    to this button then change the _global variable to the
    directory related to this button.

    on (release) {
    //1:are they already looking at this image set.
    if(currentImageDirectoryPath!="artImages/")
    { //3:no they want to see a different image set
    //so change the _global variable
    _global.currentImageDirectoryPath="artImages/";
    //load a new image set.
    gotoAndPlay("art");
    }
    //2: nothing happens
    }

    Your back button just goes back to the "Buttons" frame label.

    Have a good look at it ... let me know what you think.

    With this method you always can find out where your
    user is by checking the _global variable. It also means
    that you can easily expand your data base. Without messing
    with your main data base engine.

    Look through the movies and check how I have used the
    currentImageDirectoryPath variable. I think you will see
    what I am getting at.

    If you like it we can make it tighter.

    I have one suggestion. I think it may be a good idea to
    allow the users access to the images that have already loaded.
    It would be easy to do this by just inserting some script.
    This way they could check out what has loaded then when they
    came back more images would be loaded for their viewing.

    Post Back

    Milosav

  13. #93
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    justplainsoccer & Phoenix2779

    Phoenix2779,
    I do not know very much about audio and the problems that
    you may encounter. I "think" that foochuck has dealt with
    this more than me ... so foochuck ??

    justplain soccer:
    Just use the loader.swf you were using. I don't think
    it has changed since the last time. (if I am wrong here
    post back).

    The preloader script with the if(currentStage==1) in it
    works in two stages.

    Stage 1: if(currentStage==1)
    Checks if "loader.swf" is fully loaded. If it is we can then
    use it to monitor the loading of the main Movie. So we set
    the currentStage flag variable to currentStage=2;
    and start loading the mainMovie "GeneticSite1.swf"

    Stage 2:if(currentStage==2)
    Checks the download "GeneticSite1.swf". If all of the main
    "GeneticSite1.swf" is loaded ... close down the preloader.
    start the movie.

    Hope that helps explain it a bit more. Play with the script
    and you will soon find out what this do ... it is a great way
    to learn new stuff. It can be a lot of fun bending someone's
    code ... As long as you keep a copy of the original.

    Milosav

  14. #94
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522
    Milosav,

    Perhaps I should start a new thread on this question but I was hoping you'd be able to look at/answer it

    My question is - I'm interested in learning more of what you can do with controlling buttons/movie clips all from one script. It has given me alot of ideas with things I've already done and it seems to be a way of saving alot of time. I'm wondering if a script that controls the buttons in a frame action can be global..? Perhaps work throughout the whole movie and not have to be loaded in each frame that the buttons are in. Also wondering how you can do animations through a script and if this saves time, loads the movie faster and/or is a recommended way to animations.

    Until I had read this post from you I didn't know you could control buttons without attaching an action to them like you've done in your previous examples. I'd like to see what else can be done to buttons and movie clips..perhaps if you are too busy you can point me to another source that might have some examples of this scripting and such...

    Thanks again
    Foochuck
    http://www.myspace.com/foochuck

  15. #95
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522
    Phoenix2779,

    I looked over your post about audio and it looks like you've already been given the answer to your problem. If not let me know and I'll look over your movie to see if I can help in any way.

    Foochuck
    http://www.myspace.com/foochuck

  16. #96
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522
    Milosav,

    I'm also interested in learning how a nice flash website can be built using only 1 scene. I've heard scenes aren't really that reliable to use. I'd like to see how this could be done.

    I use scenes alot because I bring my flash movies into director and I can't use loadmovie in director (as far as I know) so since file size isn't a problem (final media is either cd-rom or intranet) I can have all of the flash presentation within 1 movie. I'm wondering how I could go about not using scenes...maybe I should be starting a new thread for this. Sorry.

    Any help would be appreciated.

    Foochuck
    http://www.myspace.com/foochuck

  17. #97
    phoenix
    Join Date
    Mar 2002
    Location
    Auckland, New Zealand
    Posts
    55

    Thanks guys

    foochuck,

    no sweat, gparis has helped me with his/her simple suggestion. All I had to do was add 'this' into my bgm2=newSound(this).
    Thanks anyway for noticing my remarks.


    Milosav,
    keep up the good work, you're helping many people including those who are not actively engaging in the board, like me.

    Cheers,
    P2779

  18. #98
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi foochuck,

    Maybe you should start a new thread on some of these
    questions there are lot things that I and maybe others
    logged onto this thread do not know about.

    But try here first!!

    _global functions .....

    Here I declare a _global variable called updateMyCounter

    _global.updateMyCounter=function(){
    counter++;
    }

    I can now call this from anywhere with updateMyCounter();
    So you can call a _global function from within a button
    event like. This works for me so far...

    button1.onRelease=function(){
    updateMyCounter();
    }

    I think if you know enough actionscript you should use it to
    do your own animation and tweening "if you can". The final
    .swf file can be much much smaller. And if you use Flash MX
    setInterval to do your animation timing you are free of the
    Movie frame rate as you can use updateAfterEvent(); to
    refresh the visuals making for much smoother animation. Of
    course if you are not sure what you are doing you may create
    bad slow script.

    You sre already starting to not use scenes by breaking your
    movies into seperate .swf's ... if that's what you mean.
    I think it is a good way to deliver multi-media without
    the user having to wait forever to download. I never use
    Scenes,in most of my movies 1 try and keep to 1 Frame,
    2 Frames if I have to, and 3 Frames only if I can find no
    other solution. I control many smaller MC's with actionscript.
    But this is not all my movies and there are lots of times
    that I use flash to do tweens and other things because they
    ARE good at what they do.

    Milosav

  19. #99
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522

    Back to the Lesson at Hand...

    Milosav,

    Okay I have a new loadmovie question for you. What if I have a mainmovie.swf and I have 4 different movies I'd like to automatically load into it..but heres the catch..each sub-movie (1.swf, 2.swf, etc...) would load randomly each time the page is displayed. Only one sub-movie would load each time..for example say each one was a news article or a different product...and I want flash to randomly load 1 out of the 4 sub-movies..how could I got about doing this? Of course I'd also like to have a preloader for each sub-movie as well...

    In case you're wondering I got the idea to do this from macromedia.com's homepage..it looks like they do something like this in the main flash interface that loads...they have buttons down the left side of the page and it looks like they load a random movie each time you visit/refresh the page.

    Any ideas???
    Foochuck
    http://www.myspace.com/foochuck

  20. #100
    Senior Member
    Join Date
    Nov 2002
    Posts
    195
    Hi foochuck,

    Ok loading a random .swf out of 4 posssible .swf's

    Your .swf's are named with an index number.

    Movie1.swf
    Movie2.swf
    Movie3.swf
    Movie4.swf

    Then first you generate your random number.

    RandomMovieNumber=Math.round(Math.random()*3+1);

    Then you would just call loadMovie() like:

    loadMovie("Movie"+RandomMovieNumber+".swf","mc_hol der");


    I would most probably put it all in a function like:

    function loadRandomMovie()
    { //generate your random number
    RandomMovieNumber=Math.round(Math.random()*3+1);
    //load your movie using the random number
    loadMovie("Movie"+RandomMovieNumber+".swf","mc_hol der");
    //if our loader bar is loaded into a level (level4)
    //make it visible and set it up.
    _level4._visible=true;
    _level4.theBar._xscale=0;

    //start your preloader
    preloaderInterval=setInterval(loadCheck,100);
    }

    //your function that does the load checking and scales
    //your progress bar
    function loadCheck(){
    dataLoaded=mc_holder.getBytesLoaded();
    dataTotal=mc_holder.getBytesTotal();

    if(dataLoaded>=dataTotal && dataTotal>0)
    { //your movie is loaded
    //if your loader bar is on _level4
    _level4._visible=false;
    //maybe you play your loaded .swf
    mc_holder.gotoAndPlay(2);
    //stop your preloader checking
    clearInterval(preloaderInterval);
    }
    //if not loaded yet then scale your loader bar
    //if it is loaded into level 4 like some of our
    //other examples
    _level4.theBar._xscale=(dataLoaded/dataTotal)*100;
    }

    So when you wanted to load your random movie just

    loadRandomMovie();



    Hope that helps...

    I have a question for you.

    When publishing projector files that are to be played in
    the flash Player. Have you found there is any need for any
    loadChecking or loader bar ???? What if you were loading a
    multi MB .jpg file with say
    loadMovie("images/image1.jpg","mc_holder1");
    Is there a large lag before the image will appear ??????

    Milosav

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center