Results 1 to 7 of 7

Thread: how to load an swf file inside itself

  1. #1
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy how to load an swf file inside itself

    hi friends please help me to load an swf file inside with it. it is for my site i will explain u my friend please don ignore my questions.....
    my first swf file is my menu as header the next page should be my about us page as an .swf file likewise the third page for portfolio as other .wsf file similarly
    for other two pages ...... so please help me my friends to do these things plzzzzzzzzz.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    To just load another .swf into an existing Flash project (without a preloader):

    1. Create a shape on the stage that is the same size as the .swf that you want to import. Turn it into a MC and give it an instance name (anything will do, i'll use menuHolder in this example).

    2. Add the following actionscript to import your menu.swf into menuHolder

    Code:
    menuHolder.loadMovie("menu.swf")
    Note: Make sure the registration point is in the upper left hand corner.

    You could also use some of the other methods of the MovieClipLoader class (especially if you want a preloader).

    HTH

  3. #3
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    As I sift through posts to solve a problem I though I might add a prudent question here:

    Has anyone had a problem loading a swf into a swf -have it load ok, and then have the new swf display but "freezes"

    I had it work the first time -what things would make it display and stop like that?

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by evan View Post
    As I sift through posts to solve a problem I though I might add a prudent question here:

    Has anyone had a problem loading a swf into a swf -have it load ok, and then have the new swf display but "freezes"

    I had it work the first time -what things would make it display and stop like that?
    Hmm...peculiar. Memory issue? or relative paths, perhaps?

  5. #5
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    I have messed around some more

    the background is the fla and swf versions run fine by themselves

    it's when I use a manging file to load it I get this:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at DEMO_BETA_5_fla::MainTimeline/DEMO_BETA_5_fla::frame1()

    weird.
    If I comment out the external class I use -the error is gone -but what's the point.
    -any insight otherwise I'll find a workaround somehow.

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    That does indeed sound like a path issue. You have to keep in mind that references to _root and the main timeline within the embedded SWF change once you import it. Could that be the problem?

  7. The Following User Says Thank You to Medyman For This Useful Post:

    evan (08-05-2008)

  8. #7
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    Thanks for checking back, but there aren't any _root refs there.

    BTY , FYI
    harsath24330:
    This link might be usefull
    -if you want to control alot of swfs without coding it's a fun toy.(No I do not work for them -nor do I get anything for the link -but I should)
    Last edited by evan; 08-05-2008 at 07:46 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •