A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 35

Thread: [MX] having a .swf open up into another .swf?

  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    41

    [MX] having a .swf open up into another .swf?

    Ok, heres the deal. I have my main .swf file it opens and then I have navigation buttons at the top. When I click on them they open another .swf file below but the navigation buttons and logo remain at the top...so it opens it in the same frame correct? I am not sure how it is I am suppose to explain it. But what I would like to do is have a button on one of the pages of the main .swf file open another .swf just like the navigation buttons do. (keeping the navigation buttons and logo at the top) so it is like the main .swf file is staying open and just opening another .swf below? I just know what it is that I want to do but am not sure on how to do it. I copied the action script from an image on the main .swf that links to another .swf which is-

    onClipEvent (load) {
    col = 1;
    this.im.gotoAndStop(col);
    this.im.targetx = -56;
    }
    on (rollOver) {
    if (_root.flag_pressed<>1) {
    this.sq1.targetwidth = _root.over_value;
    this.sq1.targetx = 166;
    this.im.targetx = 0;
    this.im.slogan.gotoAndPlay("s1");
    _parent.b2.sq1.targetx = 111;
    _parent.b2.sq1.targetwidth = _root.other_value;
    _parent.b2.im.targetx = 91;
    _parent.b3.sq1.targetx = 55;
    _parent.b3.sq1.targetwidth = _root.other_value;
    _parent.b3.im.targetx = 36;
    _parent.b4.sq1.targetx = 0;
    _parent.b4.sq1.targetwidth = _root.other_value;
    _parent.b4.im.targetx = -18;
    }
    }
    on (releaseOutside, rollOut) {
    if (_root.flag_pressed<>1) {
    this.sq1.targetx = 0;
    this.sq1.targetwidth = _root.stand_value;
    this.im.targetx = -56;
    this.im.slogan.gotoAndPlay("s2");
    _parent.b2.sq1.targetx = 0;
    _parent.b2.sq1.targetwidth = _root.stand_value;
    _parent.b2.im.targetx = -56;
    _parent.b3.sq1.targetx = 0;
    _parent.b3.sq1.targetwidth = _root.stand_value;
    _parent.b3.im.targetx = -56;
    _parent.b4.sq1.targetx = 0;
    _parent.b4.sq1.targetwidth = _root.stand_value;
    _parent.b4.im.targetx = -56;
    }
    }
    on (release) {
    _root.gal_num = col;
    _root.flag_pressed = 1;
    _root.link = 1;
    _parent.b1.sq1.targetwidth = _root.pressed_value;
    _parent.b2.sq1.targetwidth = _root.pressed_value;
    _parent.b3.sq1.targetwidth = _root.pressed_value;
    _parent.b4.sq1.targetwidth = _root.pressed_value;
    // _root.gotoAndPlay("s7");
    _parent._parent.play();
    }

    However I do not know what to edit to make another image be clicked and it go to another .swf

    if anyone can help it would be much appreciated...I have been working on this for 3 days and have gotten only to where I am now on trying to figure this out...and I am fairly new to this whole flash thing... Please! if someone can help me that would be WONDERFUL AND GREATLY appreciated! Thank you!

  2. #2
    Member
    Join Date
    Mar 2007
    Posts
    41
    I don't know if it would be easier for me to upload the movie so others can see, if so please let me know. I really need the help! Thank you!

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Planet Earth
    Posts
    298

    Use nested movie clips

    Put a move clip on the stage, name it loadedSWFs.

    whenever you need to load another swf into it use

    Code:
    loadedSWFs.loadMovie("movie.swf") // replace movie with actual file name
    that's fundamental, then we can discuss the rest.
    ---
    Thinking outside of the box will get you fired if the "box" is strict budget.

  4. #4
    Member
    Join Date
    Mar 2007
    Posts
    41
    ok, I made a new loadedSWFs.swf is that correct? is that what you wanted me to do? I hope I did what you asked.

    All I want to do is be able to make an image linked to another .swf and that it will open in the same frame with the header of navigation buttons and logo still at the top. I wondered if there was any way to just do some sort of action script?

    anyway, thank you so much for the reply and help! I really appreciate it.. I will be standing by waiting for any more reply and help. Thank you again!

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    41
    ok, i made a blank flash doc named loadedSWFs.swf

    what now?

    thank you!

  6. #6
    Member
    Join Date
    Mar 2007
    Posts
    41
    can anyone help on what needs to happen next to solve this probem? thank you!

  7. #7
    Member
    Join Date
    Mar 2007
    Posts
    41
    anyone have any imput that they can give? thanks so much!

  8. #8
    Visions
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    42
    I think what 4sheezy was trying to say is that you can call a swf externally if needed. I am not sure what "look" you are looking for on this. Do you want it to look like a pop up window.. if so use window component in the component library and load the swf there if not
    a blank movie clip and on that movie clip use the loadClip() function(look in the actionscript library) or the createEmptyMovieClip() in the movie clip itself. then give it a _visible property and change it true or false when you need it to be available. Hope this gives you some direction

  9. #9
    Member
    Join Date
    Mar 2007
    Posts
    41
    Hi 420visions-

    Thanks for the reply. I am a bit confused but I will def. re-read and re-read until i get it...some how! :-( I didn't nes. want it to be a pop up...but if that is what I have to do to make it work..i will..

  10. #10
    Member
    Join Date
    Mar 2007
    Posts
    41
    On the main.swf I want to take the symbol p1_s1 I am trying to link that to another .swf file which is the gal6.swf HOWEVER, when I link it I want it to stay in the same frame, so the logo and navigation buttons are still on the top. Like on portfolio 1 when you click one of the pictures it opens to a gallery and it some how remains in the same frame and the logo and buttons are still at the top. I have checked and checked the symbols Pic_all_im_over but I don't see any action script to copy and use.

    All I need to do is figure out how to do this and I am pretty much confident that I can edit the rest of the template myself.

    I have my main33.swf and when you click on a symbol in (portfolio 2) (prego lady) I have it to where it goes to my gal6.swf here is the actionscript code-

    on (press) {
    loadMovieNum("gal6.swf", 1);
    gotoAndPlay(1);
    }

    It opens it fine and works but then when I try to go back at the top where my navigation bar is the navigation buttons no longer work?! I can hear it clicking like it is opening but behind the gal6.swf

    http://scudle.com/main/

  11. #11
    Visions
    Join Date
    Mar 2007
    Location
    Las Vegas, NV
    Posts
    42
    Ok after looking at the file ......just trying to get it straight you got an empty movie clip that you want to load diffrent swf's on..right? when one of the portfolio buttons is pressed you want to load gal 6 or gal 1 right? The only thing I can think of right now is evertytime you press a button call some kind of function that checks if a movie clip is loaded if there is one it will delete it, then loads the desired movie clip. Is this what you want?

  12. #12
    Very simple, you need to create an empty movieclip which will be a container for all your loaded SWFs. Instead of using loadMovieNum, you create an empty moviclip called 'loadedSWFs' (or whhatever you name the isntance) and every time you want to load a new swf simply do: loadedSWFs.loadMovie('whatever.swf');

    Place the container clip at the top left corner of where you want your movie to load.

    And BTW, you really need to read more CAREFULLY:

    4Sheezy said: "Put a move clip on the stage, name it loadedSWFs."

    To which you replied: ""ok, I made a new loadedSWFs.swf is that correct"

    Where in the world did you get the idea he wanted you to create a new SWF file?
    Last edited by shawnblais; 03-14-2007 at 04:53 PM.

  13. #13
    Member
    Join Date
    Mar 2007
    Posts
    41
    shawnblais- I am sorry I was confused. :-/ I did read it but I misunderstood what I read.

    I now have made a movie clip called loadedSWFs. But am I lost on what you mean by-

    Place the container clip at the top left corner of where you want your movie to load.

    How do I do this?

  14. #14
    Member
    Join Date
    Mar 2007
    Posts
    41
    420visions- yes I now have a movie clip called loadedSWFs. Yes, what I would like to do is say be at the gal1 then press the navigation button portfolio 2 and click on an image that will then bring up gal6 and then if I want to go back and look at another gal and I go to the navigation button portfolio 1 then it will take me back...but it just keeps clicking like it is going but it is showing up behind gal6?!

  15. #15
    Quote Originally Posted by oneloveonelife
    420visions- yes I now have a movie clip called loadedSWFs. Yes, what I would like to do is say be at the gal1 then press the navigation button portfolio 2 and click on an image that will then bring up gal6 and then if I want to go back and look at another gal and I go to the navigation button portfolio 1 then it will take me back...but it just keeps clicking like it is going but it is showing up behind gal6?!
    Because you're using loadMovieNum which loads SWFs to a sequential layers.

    If you use one container movieclip for all external SWF's, like we're trying to tell you, every time you load a SWF, it will replace the previous one.

  16. #16
    Member
    Join Date
    Mar 2007
    Posts
    41
    Quote Originally Posted by shawnblais
    Because you're using loadMovieNum which loads SWFs to a sequential layers.

    If you use one container movieclip for all external SWF's, like we're trying to tell you, every time you load a SWF, it will replace the previous one.
    I now understand that is my problem..however I am not sure how to do

    Place the container clip at the top left corner of where you want your movie to load.

    How do I do this? Thank you.

  17. #17
    Quote Originally Posted by oneloveonelife
    shawnblais- I am sorry I was confused. :-/ I did read it but I misunderstood what I read.

    I now have made a movie clip called loadedSWFs. But am I lost on what you mean by-

    Place the container clip at the top left corner of where you want your movie to load.

    How do I do this?
    Wherever you place the container movieclip on the stage, is where the loaded SWF will show up. By default the top left corner of the loaded swf, is aligned to the center of your container.

    A totally empty movieclip is sometimes hard to find(it shows up as a small dot on the stage), so make sure it's on it's own layer. Usually I'll place a little offstage text in the clip so I can find it easily.

    You'll see as soon as you load in a swf file, if it's not in the right spot just move the container till it's good.

    Also, if you want to implement a preloader you can easily reference the container clip after you've loaded the movie, like:

    nPercent = loadedSWFs.getBytesLoaded() / loadedSWFs.getBytesTotal()*100

    which gives you the percent loaded.

    So a sample load button is as simple as:
    loadedSWFs.loadMovie("gal6.swf");
    gotoAndPlay("preload");

    Where preload is a loop on the timeline that displays your loading animation until nPercent==100
    Last edited by shawnblais; 03-14-2007 at 06:43 PM.

  18. #18
    Member
    Join Date
    Mar 2007
    Posts
    41
    ok, so I want to put this- loadedSWFs.loadMovie('gal6.swf'); in my actions in the movieclip loadedSWFs ?

    how do I place a container movieclip?

  19. #19
    Quote Originally Posted by oneloveonelife
    ok, so I want to put this- loadedSWFs.loadMovie('gal6.swf'); in my actions in the movieclip loadedSWFs ?

    how do I place a container movieclip?
    Drag it from your library and name it!

    And that action is used for the buttons in your galery menu. Each button targets the empty clip, and loads a different gallery.

    button1 - loadedSWFs.loadMovie('gal6.swf')
    button2 - loadedSWFs.loadMovie('gal7.swf')
    button3 - loadedSWFs.loadMovie('gal8.swf')
    etc

  20. #20
    Member
    Join Date
    Mar 2007
    Posts
    41
    ok! i am doing that now...sorry..i am trying to get the hang of flash. I very much appreciate the help! Thank you.

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