dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Loading and unloading external swfs in AS3. A lost cause?

  1. #1
    one way ticket (yeah)
    Join Date
    Oct 2006
    Posts
    7

    Loading and unloading external swfs in AS3. A lost cause?

    Hi all.

    After years of putting it off, I've finally begun the move to AS3. The frustration I've encountered is evidently shared by a lot of other designer/developers. Knowing that the future is inevitable, I have bitten the bullet and forged ahead. There has been one thing, however, that has just been a real quandry and has cost me hours of banging my head against the wall.

    That would be getting an externally loaded swf to (really) unload in an AS3 file.

    Before I even begin to post code, let me just say that I've tried a lot of things read in books, posts from this and other forums, and trial and error to no real avail. In my research I've come across many others who are experiencing the same problem and even one reference that suggests you not use AS3.

    I'm fairly close to a work around I think, but before I completely retrofit my file to maybe get it to work, I thought I'd put to to the community...

    For a project that uses multiple loads and unloads that's due in a month, should I just go with AS2?

    Any thoughts would be appreciated.

    Note: I'm using CS4 on a PC publishing to Flash player 10. And yes I have tried "unloadAndStop()" and "removeChild()".

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    So what's wrong with unloadAndStop and removeChild?

  3. #3
    one way ticket (yeah)
    Join Date
    Oct 2006
    Posts
    7
    My issue with unloadAndStop is that it's only supported by flash player 10. I'm usually a little hesitant about doing stuff that will run only on the latest player. Especially across platforms. Is this an unwarranted concern?

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    According to Adobe's penetration numbers, 99.5% of computers have flash player 10 installed. So, if you trust them, then I wouldn't worry about that.

  5. #5
    one way ticket (yeah)
    Join Date
    Oct 2006
    Posts
    7
    Cool, good to know 5TonsofFlax. Thanks. I'll try it out then. A bigger issue I have is that my file is set up to move around a timeline a good deal before it loads another movie. I know that leaving a frame with the code you need doesn't work so well in AS3.0. I might need to rethink my whole approach.

  6. #6
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Consider moving your logic out of the timeline and into a document class. The timeline should really only be used for animation-type tasks. I know that's a big change for most people who cut their teeth on AS2.

    Programming goes in classes. Scripting goes in the timeline.

  7. #7
    one way ticket (yeah)
    Join Date
    Oct 2006
    Posts
    7
    Thanks for you reply 5Tons.

    Ok, its clear to me that a complete retrofit of my project is going to be necessary. Even then I have no current idea of how to really make all the cool transistions I've got in the file to work. That's going to take time and with a deadline looming I'm under a lot of pressure. Before I start doing the heavy lifting, I might pose another question...

    If I bag AS3 for this project and just do it in AS2 is that going to cause problems in the near future?

    Just trying to cover my bases. Thanks

  8. #8
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    AS2 will continue to be supported by the player for the foreseeable future.

    The only problems that will cause are that it'll delay your transition to AS3, and you won't get help in this forum. But there's an AS2 forum right next door.

  9. #9
    one way ticket (yeah)
    Join Date
    Oct 2006
    Posts
    7
    I totally understand. I should have established a better ground work for AS3 before I started the project. Thought I could jump in the middle and make it work. Wrong! I'll definitely make the transition by the time my next project comes around. Thanks so much for you comments 5Tons.

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