A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Please help - preloading external swf files

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    13

    Please help - preloading external swf files

    Flash 8 -

    I am currently working on a site and need help with preloading. Here is a link to the work in progress: http://www.jessicakarp.com/houston/main.html

    What I need is an easy way to preload the swf's in the "what we do" section. Is there a way I can put some code in the frame that targets the movie clip to tell it to preload it before it loads it?

    In other words, can I do all the preloading from the main movie?? If not, what are my options?

    I would really appreciate any help. Thanks!

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    add blank frame#1 with a stop(); action to all external movies
    load them from a frame action in the main movie
    when you want to show the movie, send it to frame#2

    hth

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    what do you mean by:

    "load them from a frame action in the main movie"

    Currently I have this:

    Button script-

    on(release) {
    _root._root.gotoAndStop(3);
    }

    Frame script-
    loadMovie("aboutus.swf", "aboutusplace");
    stop();

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    say you need to load 2 swf files - a.swf and b.swf,
    both "parked" on blank frame#1 into the main movie,

    you could do this with Actionscript on frame#1 of the main movie

    this.createEmptyMovieClip("holder0",1000);
    holder0._x= holder0._y = 50;
    holder0.loadMovie("a.swf");

    this.createEmptyMovieClip("holder1",1005);
    holder1._x= 100; holder1._y = 50;
    holder1.loadMovie("b.swf");

    to start a.swf -
    holder0.play();

    b.swf to go to a frame label -
    holder1.gotoAndPlay("b_label");

    hth

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    But that doesn't preload them. My issue is that the external files are so large that if you click the link nothing happens until the page loads. I don't really understand the whole math part of the preloader. Too much code makes my head spin. I really appreciate your help!

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the method i posted will load the files into the cache

    if you seek a full-event preloader search the forum,
    there are many examples in the forum archives

  7. #7
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    I spent the majority of the day today doing just that and I can't find one that I could get to work. It totally confuses me.

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    Basic Flash Preloader
    Learn the basics of creating a preloader for basic Flash movies.

    http://gotoandlearn.com/download.php

  9. #9
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    Thanks for your help! I set up the preloader and it works except it seems like there is a pause still before the movie loads. If you go to the link below, click "what we do" and then click tradeshows you'll see what I mean.

    http://www.jessicakarp.com/houston/main.html

  10. #10
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    Okay, now that I know someone will help me... I am wondering if you would mind taking a look at this one last thing. I hope I can explain this correctly. The company that I am designing this website for wants to be able to click the main buttons in the navigation without actually going anywhere and then have the buttons that drop down navigate the page. The "what we do" section is a good example of this. The problem is that when I set the other buttons to not navigate anywhere they malfunction. I am uploading a file for you to see.

    If you click "who we are" it works fine, but if you click "what we do" next and select any item under that section and then try to click about us again nothing happens. I can't figure it out and have been pulling my hair out for a week. The weirdest part is that if you click an item under "how we do it" and then click "what we do", it works fine. If you would help me out on this one i'll be your bff! LOL
    Attached Files Attached Files

  11. #11
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    sorry but i do not have time this week for fix-em-ups

    try creating a new thread and post your file,
    with luck someone might spot the problem

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