A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: Best way to load SWF

  1. #1
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273

    Best way to load SWF?

    I took a long break from a project I was working on and I am just now getting the itch to "finish" it. I was working on a menu page with similar function to this one. http://www.fluoro.com.au/

    I have the background image sliding with the button click but I'm not sure the best way to load the pages/menu items. I'm not explaining this very well. I want to click the nav button and the background slide to a set location (that part I have no problem) then once it gets there the content will load. So when you get to the page with this slider menu some content will load in the center and then click the button and that content goes away the thing moves yada yada new content in the center. So in short what is the best way to do this unloading loading contraption? I've been searching old post and I think I know but would like a clear explanation that fits this issue. Thanks in advance.
    Last edited by semaj23; 09-10-2005 at 12:03 PM.
    I don't have answers.


  2. #2
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Yes I know, who wants to help someone making a site about a guy in a wagon? But come on it's a nice wagon.
    I don't have answers.


  3. #3
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Anyone?
    I don't have answers.


  4. #4
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    you could try using loadMovie and unloadMovie
    eg at the end of the nav buttons move you could try
    _root.creatEmptyMovieClip("holder",1);
    holder.loadMovie("yourmovie.swf");
    or something like that

    or if the stuff you want to load is in the library then use attachMovie instead

  5. #5
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Ok I'm not getting it at all. Where should the script go and how do I keep it from loading immediately instead of loading as soon as the background stops.

    If only action scripting grew on trees...
    I don't have answers.


  6. #6
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    could you explain a little bit more as to how and what you are doing/loading. for instance - you say you want to wait untill the background has loaded - is this a movieClip?

  7. #7
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    The main movie will load and all it will contain is the sliding background and navigation buttons. When one of the buttons is clicked the background will slide to it's assigned location. After the background has moved to that position the content will display in the center. When another button is clicked that content will go away and the background will move to it's assigned position and the appropriate content will load. Attached is the Slider fla and the episodes swf. I appreciate all the help.

    Apparently 300kb is the size limit for uploads so here's a link to the zip folder.

    http://www.WagonNation.com/squirrel/SliderTest.zip
    I don't have answers.


  8. #8
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    hi
    sorry to say i cannot find all the stuff in the fla - eg were are the tweens that i presume you have used when for example the email button is pressed - the "slider" does something - but what i cannot work out.if it is tweened then you coould place the loadMovie() code at the end of that. Explain it slowly to me - my problem is that there is code all over the place (as is often the case with flash ) and i cannot fathom it out .an alternative is to send me the bit that needs the loadMovie adding to it and not the rest of it
    sorry about this

  9. #9
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    This is the code on the episodes button
    Code:
    on (release) {
    _root.x=531;
    _root.y=385;
    }
    This is the code on the main timeline frame two that sets the starting position for the background.
    Code:
    x=-188;
    y=-56;
    This is the code on the main timeline frame three that sets the variables for the background movement.
    Code:
    startx = _root.back._x;
    starty= _root.back._y;
    
    moved = x-startx;
    moved1=y-starty;
    
    _root.back._x=startx+(moved/3);
    
    _root.back._y=starty+(moved1/3);
    That's all the code to make the episodes button move the background. Then what I need to happen is that the content loads after the background has made the move.
    I don't have answers.


  10. #10
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    I'm only asking for a little help.
    I don't have answers.


  11. #11
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    sorry i was away for a nght or 2
    how about
    if(the _x or _y value of the backgroud == whatever ) {
    then do the LoadMovie() thing;
    }
    so something like this
    if(_root.back._x>=520) {
    _root.loadMovie("episodesMovie.swf");
    }
    now when i put this on frame 3 with the AS you have there it works but locks up my computer - some i guess your episodesMovie goes into some kind of loop or at least it uses 100% of my processor.
    anyway - this is just a basic help - if you need more please get in touch

  12. #12
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    That works great except that it takes the place of my main movie instead of loading in front of it. I need the background and everything to stay and when another button is pressed the existing movie goes away, the background slides to the new position and new content loads into that. Just like the example posted.

    I've also figured out why your processor jumps to 100% when the episodesMovie comes up. It's the static but I can't figure out a way around it. No matter what I do if I use that static effect it burns up the processor. I'm going to make a new thread about that and see if anyone has ideas for that one.

    Thanks for all the help.
    I don't have answers.


  13. #13
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    dont load the movie into _root - maybe use createEmptyMovieClip() and set the depth to that of infront of what your background is

  14. #14
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Doesn't seem to load at all now. I know I'm missing something really simple.
    I don't have answers.


  15. #15
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    if(_root.back._x>=520) {
    _root.creatEmptyMovieClip("holder",100);
    holder.loadMovie("EpisodesMovie.swf");
    }

    ???
    I don't have answers.


  16. #16
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    something like that would be fine (does it work?) - as long as that brings the swf to the foreground - so - what is the depth of the background??? and then set the depth in the loadMovie to put it infront of the background

  17. #17
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    No, it doesn't seem to work. I've played around with the level and still can't get it to show up. I've set it to 1000 and above. I'm not sure what the depth of the background is. How would I find that. I'm at a loss.
    I don't have answers.


  18. #18
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    have to say that i am stumped - maybe repost the question and try again.
    the way to find out depth is with getDepth();
    ie.
    _root.back.getDepth()

  19. #19
    Superwagon semaj23's Avatar
    Join Date
    Jul 2004
    Location
    Ohio
    Posts
    273
    Ok, I'm still trying to figure this thing out but I can't seem to make it work. I've looked at the code on the fluoro site but I can't make heads or tails of it. I'm lost when it comes to action script.

    Any ideas?
    I don't have answers.


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