Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Importing a .swf file

  1. #1
    Join Date
    Mar 2006
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default Importing a .swf file

    Can I import an .swf into the library and it workk correctly. If so how.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Not into the Library. What you would do is just call it from the main timeline of the first movie.

    For instance, if you have first.swf and second.swf you would upload both to the same folder.

    In the main timeline of first.fla you would put

    Code:
    background.loadMovie("second.swf");
    If you have the load on a button it would be:

    Code:
     on(release){
        _root.gotoAndPlay(whatever number/frame);
    }
    and on the last frame of your animations to load:

    Code:
    onEnterFrame = function(){
    loadMovie("second.swf", _root.getNextHighestDepth());
    }
    loadMovie is used either as...
    loadMovie(url , target , method);
    or
    mc.loadMovie(url , method);
    In both cases, method is optional.

    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default maybe Im having the same issue

    I made a animated swf and tried importing it to the flash library to be in a main piece of work...The animated piece need to fly around and fade out..
    But when I import it the animated piece is all broken up and doesnt animate....
    ARGH!!
    Didnt the older versions of flash import more smoothly?

    Thanks!

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Why would you want Flash to double in size and work twice as hard?

    If you have your main swf you want to put inside another movie, instead of making it an swf copy ALL frames and make it a new MC. Then import this MC into the other movie.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I also have this problem too. May I ask one question? please follow to what I have done.

    1. When I made 2.fla which is going to be the final one. It must be contained 1.swf which I had already made like sky have many clouds go infinitely from right to left.(At 1.swf, each clould is symbol that has their own timeline with code gotoAndPlay(01); at the right end frame, over timeline.)

    2. I imported 1.swf to Library and put it at frame1 and extended frame to be background for 2.fla

    I found that the 1.swf is not work properly. Clouds were not imported, it was just clear blue sky with nothing goes by.

    Could you please suggest to make 1.swf work perfectly in 2.fla?

    1.jpg is 1.swf which it works properly.
    2.jpg is 1.swf in symbol of 2.fla which cloulds not work properly.




    Thanx
    Bryan
    ^^

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

    Default

    What's your code in 1.fla? It's almost impossible to guess what's going on without some code.

    What I suspect is that your're using relative paths that are incorrect. If you're using _root in your 1.fla, then that's 100% the problem.

  7. #7
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Medyman..

    May I send you the link for downloading this file? So you could see what's wrong.

    First is 1.fla which has clouds works properly.

    http://www.mice.co.th/1.fla

    Second is 2.fla which 1.swf has been already imported to layer 1 but no clouds.

    http://www.mice.co.th/2.fla


    Thank you so much
    Bryan
    ^^

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

    Default

    Bryan,

    I see what's happening here. You have two options (this is all done within 2.fla):

    1) Reimport the swf. First, double click on 1.swf in your library. Then, delete Layer 1. Create a new layer. Select the first frame in that new layer. Next, go to File > Import > Import to Stage. Choose 1.swf from your HDD. Click Open. It'll take a few seconds to import..and all should be well.

    2) Import the swf programatically. Click on 1.swf on your stage, go to the properties panel and assign it an instance name (i'll use animation for this example). Then, create a new layer on the main timeline, rename it to actions and click on the first frame in that layer. Then, add the following ActionScript 2.0:
    Code:
    animation.loadMovie("1.swf")
    The code assumes that you have 1.swf and 2.fla in the same directory. If you don't, either move them so they are or change the path.

    Test and if done right, you'll have imported the SWF.

    The second method is by far the most efficient way to do it. It keeps your file size down. Ideally, you should add a preloader. Lee Brimelow has some great video tutorials on how to do this at gotoAndLearn().

  9. #9
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanx Mr. Medyman,

    Thanx Mr. Medyman,

    I'm trying..and will let you know if succeed.

    Bryan
    ^^

  10. #10
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanx Medyman ^^ but more question..

    Medyman,

    I've already did follow your instruction then it's work!!...I'm really feel thanks to you deeply from my hearth ^^...

    But I still do not understand the point.

    1. Why do I reimport 1.swf ? even though I have 1.swf into library and it's already on the stage.
    2. Why use import to stage from directory instead drag 1.swf from library to stage?
    3. The code animation.loadMovie("1.swf") seems like it runs file 1.swf from directory, not from Library, so why do we need to have 1.swf in the library ?
    4. If I put just .jpg with static background at the layer1, then rename it to animation, and put that code at the first frame, layer2..Can I? because I knew I have 1.swf in the same directory.

    Sorry for a lot of questions, because I just start using Flash for 1 month.

    Thanx Medyman
    Bryan

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
  •