A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Loading on-top of exisiting swf (then unloading previous swf)??

Hybrid View

  1. #1
    Member
    Join Date
    Jul 2006
    Posts
    60

    [F8] Loading on-top of exisiting swf (then unloading previous swf)??

    Hi

    I'm currently building a site with 1 main file, and 4 swfs loading into a Empty Movie container within the main file. An example of the code I'm using (on buttons) to do this is
    Code:
    on (release) {
    	loadMovie("Reels.swf", "_root.container");
    This works fine, but instead of just replacing the existing swf with the new one, I'm trying to create a transistion where the new loaded swf covers over the exisiting one. I have added a fade/wipe to the start of each external swf, but because they are all loading into the same movie container on the same level, I'm not getting the effect I'm after.
    I'm still learning AS, is it possible to load an external swf into the movie container on the next level (to the exisiting one), then after a short time unload the swf in the previous level? As I say, I in the process of learning flash/AS, so any advice is greatly received, even pointing in the direction of a tutorial to learn.

    Thanks
    Wayne

  2. #2
    Get Squared Away.
    Join Date
    Feb 2000
    Location
    Allentown, PA
    Posts
    543
    hmmm...lets see...I would say make a new layer above the layer where your empty container is, and call it "fade". Then in the fade layer create a movie clip that has a graphic in it that is the same size and color of your stage. Give this movie clip an instance name of "fader_mc". In this movie clip transition your graphic from 100 opacity to zero (fade out) and then back to 100 opacity. The transition should take place over maybe 30 frames or so, with 3 key frames (frame 1 - 100%, frame 15 - 0 %, frame 30 - 100%). Add motion tween. Put a stop action on frame 1 and on frame 15 (where the graphic is 0 %).

    Then on your buttons have something like this:

    Code:
    on (release) {
                 fader_mc.gotoAndPlay(16);  
                 //you can also give this frame number a label, in which case use this
                 fader_mc.gotoAndPlay("fadein");
    	loadMovie("Reels.swf", "_root.container");
    }
    Then in your 4 .swfs that get loaded, put an action on frame one that says something like this:
    Code:
    fader_mc.gotoAndPlay(2);  //or the label name
    This should give the effect that each clip is fading out and then back in when a button is pressed.

    Hope this helps.

  3. #3
    Member
    Join Date
    Jul 2006
    Posts
    60
    Hi

    Thanks for your reply. I will give that a go tomorrow at work, and let you know how I get on.

    Wayne

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