A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: load external swf problem

  1. #1
    Junior Member
    Join Date
    Dec 2006
    Posts
    3

    load external swf problem

    I am trying to load an external swf into a movie. When I use the loadMovieNum, it loads into the correct spot on the stage, but will not play. when I use the loadMovie, it loads and plays, but I can't get it to be placed where I want it on the stage. When I use the loader component, it loads properly, but won't play. Any suggestions?

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    loadMovieNum() is NOT for loading into movieClips..but rather _levels..

    using loadMovie() is by far the best way...

    example:
    //load .swf into empty movieClip
    containerClip.loadMoive("external.swf"):
    //position clip
    containerClip._x = 100;
    containerClip._y = 100;

    make sure the clip you are loading your external.swf into HAS the instance name of containerClip...

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    Hi Whispers, I have a similar problem:

    So, if I wanted to have an external slideshow play in a pictureframe I would create a movieclip called PictureFrame (with instance name of PictureFrame) then insert the script:

    PictureFrame.loadMovie("slideshow.swf");

    Should that work?

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    yes.. if on your stage.. you have a movieClip, with the instance name of pictureFrame.

    and you want to load something INTO that movieClip (referred to as a containerClip often)..a video, .swf or image.. you would do:

    pictureFrame.loadMovie("external.swf");
    pictureFrame.loadMovie("external.jpg");

    etc..etc..

  5. #5
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    And what if I wanted to do that inside a movieClip?

    So I would have the stage then a movieClip containing that code with the pictureFrame movieClip inside that?

    Would that be:

    containerClip.pictureFrame.loadmovie("whatever.swf/jpg/mp3/etc")

    All things having the relevant instance names of course.

    Probably simple for you but it always starts to boggle me!

  6. #6
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    yes.. you just follow the path..

    if you have a movieClip called

    containerClip

    and inside containerClip you another movieClip called holderMC

    you would just do:

    containerClip.holderMC.loadMovie("external.swf");

  7. #7
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    It doesn't appear to be working!

    I was testing it with just using an image for now, the exact script I have used is below:

    stop ();
    pictureFrame.containerClip.loadMovie("Picture3.jpg ");

    The way I have organised the path in the fla is 'Stage/pictureFrame/containerClip' and that script above is within the pictureFrame movieClip.

    When I run the swf nothing shows up in the frame! The swf is in the same folder on my computer as the picture.

    Do I need to offset the x and y axis or anything like that?

  8. #8
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    if your putting the code IN the pictureFrame clip..then there is no need to put it in the code.

    its basically looking for those names... if you put that code INSIDE the pictureFrame clip...its going to look for a clip called pictureFrame..then inside that a movieClip called containerClip.....etc..etc..

    so you will just do this:
    containerClip.loadMovie("Picture3.jpg");

    if you were to put that code on the MAIN timeline in frame 1.. then it would have worked.

  9. #9
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    Ok, I've changed the code to what you have said but still nothing seems to come up in the frame?

    Any other ideas? Something I may have missed?

    Thanks

  10. #10
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    post your .fla

    are you sure your giving the clips INSTANCE names?

    non-progressive .jpg's only..

  11. #11
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    Ok, I've put together a barebones fla to cover the example

    Thanks very much for your help, be aware I'm using (the vintage) Flash 5.
    Attached Images Attached Images
    Attached Files Attached Files

  12. #12

  13. #13
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    Well that's a step in the right direction, but it still hasn't worked when I've tried with swf!

  14. #14
    Member
    Join Date
    Jan 2003
    Location
    Oxfordshire, UK
    Posts
    48
    Hmmm, interestingly if I change the instance and filename to all lower case it works!!

    So where Picture3 didn't work picture3 does. Literally all I did was change the upper P to a lower p on both the instance name and swf, and it works!!

    Strange but true.

    Thanks for your help, was good discussing!

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