A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to stop looping of imported SWF

  1. #1
    Member
    Join Date
    Nov 2007
    Posts
    36

    How to stop looping of imported SWF

    I created a simple swf that spins a letter then stops. I converted the transformation to a timeline and added stop(); at the final keyframe. I then import it into another FLA.

    Once it's in my main swf and I add it to the stage, it loops. How to stop the looping?

    Thanks!

  2. #2
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    What do you mean by import it into another flash ? If you mean that you are loading it dynamically into a container in the main .swf file then it shouldn't loop. If you are importing the .swf file as if it were an image that's bad, don't do that.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    36
    1. I created the D.swf (a spinning D that ends right side up). It doesn't loop.
    2. I open another FLA and use File > Import, and import the D.swf to the library. It shows up as D.swf with a Symbol in the library files.
    3. I drag the D.swf onto the stage.
    4. When I publish, the D.swf loops.


    What do you mean by loading it dynamically into a container?

    Thanks - and sorry for the stupid questions.
    Last edited by benflashkit; 01-31-2008 at 05:57 PM.

  4. #4
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    As I said, do not import .swf files into .fla files that way.
    The reason it loops, is because when you imported it into the library flash broke it down. You won't have the same .swf file in the library that you've built, it will be a replica of it, but it will look totally differently and you won't have any actions in it ( think of it as importing an animated gif... flash will only see an animation, and import it frame by frame ). You could open the library, double click the file you've imported and place a stop(); on the last frame ( again ) but that's not the best solution.

    Don't import .swf files into .fla ; if you really want to have something you've done in a separate .fla then try building your movie so it's a single and large movie clip holding all the elements, and copy-paste that into your new .fla ; if that's not the case then load it dynamically into a container .... what does that mean ? well, it means that you'll need to use code ( actionscript ) to load an external file dynamically into your project ( you can do this by loading it into a container - a container is an empty movie clip that is used to store externally loaded data - or you could simply load it onto the main scene, but try avoiding that... always try to load your external content into a container ).

    Since you are new to flash, it would be a really long road to explain the basics of flash. Try surfing the forum for tutorials, try buying some video tutorials, books and so. You need to understand the basics in order to advance, and this is achieved by studying, reading books ( or hit F1 inside flash and start reading the help file from the start, it will take you trough the basics ) and practice.

    Good luck.



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


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