×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    32

    Unload Symbol / Class in AS2

    I have a lot of external text files.
    I can use Loadvars to download each
    when required. However, I wanna to
    make a easy deployment and consolidate
    few hundred files to main swf. And, the limit
    of sis is 300 files ! So, I make it as class
    (symbol). However, the size is very large. I
    can't remove symbol after use and reload when
    required again. Once loaded, can't remove.

    My objective is load file one by one with
    less memory. However, I try many methods but
    still no success. Though using removeMovieClip
    but still keep in memory. (I have checked that
    the movieclip is removed but memory size in
    device central hasn't dropped !)

    Any good method to keep low memory while swapping
    amongst files (symbol) ? Can I use another swf to
    keep all those files and load it from main when
    neccesary ?

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Re: Unload Symbol / Class in AS2

    "(I have checked that
    the movieclip is removed but memory size in
    device central hasn't dropped !)"

    The garbage collector need 60 seconds at least to clean some memory !
    And you can never be 100% sure the memory will be cleaned. Most of the time, you'll get some free memory again after 60 seconds, but if you rely on this, your application's architecture is just bad.

    You should try to use a safer way of using external text files.

    "Can I use another swf to
    keep all those files and load it from main when
    neccesary ?"
    Just remember, every time you load a SWF file, there is about 50 ko of data just for the SWF packaging, this is a pure waste. However, it would be better to load just once a SWF than loading a thousand other files...

    In Flash Lite tips & trick, they say :
    You should only load data when you need to display or use it. Never in any other case. Don't load text if you're not using it right now. And after that, always set the variable holding your text to "null" to tell the garbage collector to do its job.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    32

    Re: Unload Symbol / Class in AS2

    Thank you. If I load one swf instead of
    hundred files. I try to make these files
    as symbol and also try to put it in frame.
    Anyhow, once the frame or symbol is loaded,
    it occupied the memory and can't release.

    Any idea on storing all text in one swf but
    load / unload them if required ?

    Many Many Thanks.

  4. #4
    Registered User
    Join Date
    Dec 2008
    Posts
    46

    Re: Unload Symbol / Class in AS2

    Build a SWF with all your text in variables (avoid using MANY variables).
    Then, load your swf in a movieclip. Use your variables.
    unloadMovieClip on the movieclip to allow releasing the memory when you don't need the text anymore.

    "I try to make these files as symbol"
    Do you mean you're storing your text in textField ???!!!

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    32

    Re: Unload Symbol / Class in AS2

    I have tried

    1) Put each text file as textfield and saved it different
    frame.
    2) Put each text file as textfield and change it as symbol
    3) Put each text file as variable and saved in different
    frame

    If each text file 10K, total of hundred is 1MB. When
    I load the swf. It loads 1MB. All textfield or variable
    are not in 1st frame. However, it still occupy 1MB.

    My target is to load each text file 10K only. I use
    loadvar and make it as external file. It is success.
    However, I wanna to put it in one swf file. Otherwise,
    it is hard for user to transmit their file to friend.

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. Undefined symbol - Compiling HelloWorld
    By synackSA in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 6
    Last Post: 2009-04-08, 11:02
  3. 求助:没有调用到包的问题
    By youpengli in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 1
    Last Post: 2004-05-10, 03:03
  4. 求助:N9200 Series SDK上的问题
    By youpengli in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 3
    Last Post: 2004-05-10, 02:56
  5. Unresolved external symbols problem
    By georgica1979 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-06, 13:26

Posting Permissions

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