dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Must Be A Way

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Location
    Boston
    Posts
    4

    Must Be A Way



    Within an html doc, how can one movie (menu.swf) replace a second, separate 'content' movie???
    EX- clicking 'contact us' from menu.swf replaces 'aboutus.swf' with 'contactus.swf'?
    I know the ID/NAME attributes within the EMBED/OBJECT html tags must come into play?!?!?!

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Why not just load contactus.swf into a _level on top of menu.swf?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Jan 2002
    Location
    Boston
    Posts
    4
    thats the current method, but contactus.swf must be designed to fit onto level0 - an 800x600 movie that's 3/4 blank

  4. #4
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hello,
    you can load another html page that contains contactus.swf into the current html page if you need to:

    Code:
    on(release){
    getURL("contactus.html", "_top");
    }
    Although you can do this, I do not suggest it unless you really have to. Doing a page reload makes your site look very unprofessional.

    Heres what I would do:
    Instead of the above, or loading your contactus.swf into a level in your menu.swf, I would load contactus.swf into an Mc located on the _root timeline of your menu.swf

    Loading movies into Mcs allows for better positioning and control of the loaded swf.

    Here is the basic way to load an swf into a clip:

    Create a blank movie clip in your menu.swf above the other content.
    The movie clip does not really need to be blank. Anything inside the movie clip will be replaced when you load something into it.
    Hint: Locate the holder Mc in the upper left hand corner of your menu.swf, that will give you a starting point to start adjusting where you want it. When you load anything into a clip the it use the upper left corner of the clip as its reference, not the center.


    Give the movie clip an instance name of holder.

    Add this code to your button:
    Code:
    on(release){
    loadMovie("contactus.swf", "holder");
    }
    or

    Code:
    on(release){
    _root.holder.loadMovie("contactus.swf");
    }
    Now that you have your loading set up, you need to think about creating a preloader for the content you are loading.

    You can preload a movie clip just like you preload the main movie.
    You can use a basic if(_root.getBytesLoaded() == _root.getBytesTotal()){, but instead of targeting the _root, you target the clip you want to preload, like this:
    Code:
    if(_root.holder.getBytesLoaded() == _root.holder.getBytesTotal()){
    //do something here
    }
    If you ned preloader help, let me know and Ill post an FLA.

    Good luck and I hope I was of help...
    3PRIMATES

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