×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Not enough memory to open file error

    Hi All,
    First of all I'm happy to be back here after a long time Wanted to thank all the people who have helped me to complete my project and reach up to testing stage of my app. I will need your support once again

    Since now after the testing i have tweaked my code a little bit and reduced the swf size to 7 MB and packaged the swf to sis and tried to install it in 5800. But its popping up this error... " Not enough memory to open file error " it's working fine in N97.

    Can anyone please help me with this issue.

    Regards,
    Elmi...

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Not enough memory to open file error

    Hi elminator,
    According to my observation, "not enough memory" simply means that your swf needs more optimization to run on this device. I have three suggestions :
    1- (Recommended) Try to decrease the size of your main swf file , by simply making a number of secondry swf files out of the main swf file and loading & unloading them using loadMovie and unloadMovie api.
    2- Restart your phone and try to run your flash app again. May be your app needs more RAM then the required .
    3- Try to increase the heap size of your flash lite stub , if u r packing ur swf into sis using Carbide C++.

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Not enough memory to open file error

    Hi Sajisoft,
    Thanks a lot for your reply I have tried your 2 and 3 suggestion but it din't work. Now i have started with your 1 suggestion and have split the swf and calling them randomly. Here i am having an small issue. As said by you i am using the following code
    unloadMovie(_root);
    loadMovie("Home.swf", _root);
    which is working fine on the Emulator but when i told my colleague to wrap all the swf file to sisx file its popping up error to open the next swf file "error : 8 "
    Can you please help me in the above issue which might be due to relative and absolute path. how to give it exactly to the installed path of the sisx file.

    Regards,
    Elmi...

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Not enough memory to open file error

    Hi Elminator,
    Error 8 simply refers to the issue that you unload the _root which is actually not possible. So, it is not a problem of absolute or relative path but of using unloadMovie . The easiest approach is to create an container on the root (it can be an empty movie clip ). Now, load and unload the container with external swf files like :
    Code:
    var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
    container.loadMovie("Home.swf");
    container.unloadMovie();
    Moreover, i advise u to go through the help of these APIs loadMovie, unloadMovie, loadClip & removeMovieClip

    Best Regards,
    SajiSoft

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Not enough memory to open file error

    Hi Sajisoft,
    Thanks a lot for helping me out i tried your method but it was working fine on the comp but not on the device. So I have used a empty movie clip on the stage and named it "Main" and I'm loading and unloading the swf's to this empty movie clip.

    _root.Main.loadMovie("Practice.swf");
    _root.Main.unloadMovie();

    All I need to know is if the above method is correct or not and I am getting an white screen when I do use this method how to avoid that ? and In one the swf I have used the following code to play the audio but the audio is not playing

    myMusic = new Sound(myMusicMc);
    myMusic.attachSound("myMusic37");
    myMusicVolume = 100;
    myMusic.setVolume(myMusicVolume);

    The audio is playing fine if you double click on the swf but not on the emulator can you please rectify this issue.
    Last but not the least after packaging the swf into sisx file can I protect it ? If so what are the means please help me in this so that I can do the same before I upload the app to the ovi store...

    Regards,
    Elmi...
    Last edited by elminator; 2010-08-14 at 12:46.

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Not enough memory to open file error

    Hi elminator,
    3 issues in 1 post .
    All I need to know is if the above method is correct or not and I am getting an white screen when I do use this method how to avoid that ?
    Yes! it seems correct. Do u mean a white screen appears in between loading & unloading swf files? If this is the case than it is common, what u can do is load new SWF file before unloading the old SWF file, but obvioulsy, it is only possible if the flash lite player have enough memory to have both SWF files running at a time. If this is not the issue, then please, more specific about the issue u r getting.
    The audio is playing fine if you double click on the swf but not on the emulator can you please rectify this issue.
    And what about the device? i think it will not work on the device either. The problem is not because of the APIs but it is due to the inappropriate audio format . Sometime, even an MP3 file doesnt work with the flash lite player beacuse of its settings. What u have to do is to encode your MP3 file under different settings like Bit Rate etc. One of the way to check whether it is a issue with ur MP3 file or not then just go on google , search flash loops and try the mp3 loop u find from sites. Moreover, search this dibo and u will find out a good detailed discussion to this question.
    Last but not the least after packaging the swf into sisx file can I protect it ?
    What you can do is put your swf into the private directory at the time of installation and i think the default packages use to through the swf into the private directory of Flash Lite stub . There is also a OMA DRM lock for your flash contents. Read here :
    Flash Lite DRM
    How_to_protect_Flash_Lite_content_with_OMA_DRM_1.0
    Hope it helps..

    Best Regards,
    SajiSoft

  7. #7
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Not enough memory to open file error

    Hi Sajisoft,
    Thanks a lot for helping me out and I'm really sorry to post 3 issues in 1 post since i din't want to disturb you again in a different forum for the same issue coming back to the application, I had one last issue...
    > The audio was playing fine when I had all the screens in a single swf but now I think since I am loading the child swf to the parent that why the audio is no playing. Is there any simple method to achieve this i.e., playing audio in the child swf and loading the same to the parent ...

    Thanks in advance.

    Regards,
    Elmi...

  8. #8
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Not enough memory to open file error

    Quote Originally Posted by elminator View Post
    'm really sorry to post 3 issues in 1 post
    No need to say sorry at all because we are here to solve the issues .
    The audio was playing fine when I had all the screens in a single swf but now I think since I am loading the child swf to the parent that why the audio is no playing. Is there any simple method to achieve this i.e., playing audio in the child swf and loading the same to the parent ...
    Hmm..The simplest alternative in my mind is to save your audio file locally as an mp3 file then just load this mp3 file into the flash by providing its path and then play it, using this actionscript :
    Code:
    this.createTextField("status_txt", this.getNextHighestDepth(), 0,0,100,22);
    var my_sound:Sound = new Sound();
    my_sound.onLoad = function(success:Boolean) {
    if (success) {
    my_sound.start();
    status_txt.text = "Sound loaded";
    } else {
    status_txt.text = "Sound failed";
    }
    };
    my_sound.loadSound("E:\\Sounds\\Digital\\Song.mp3", true);
    Hope it helps..

    Best Regards,
    SajiSoft

  9. #9
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Not enough memory to open file error

    Hi Sajisoft,
    Once again thanks a lot for your support. For security reasons my head has told me not the keep the music file outside the swf rather they have suggested to copy it to the library and call a function to play it from there itself. I wanted to know if there Is any method to achieve the same. Previously i had given an unique names to the sound files and using the below code which is not working now since i am calling the child swf to the parent swf. This method works fine if i double click the swf or load it to the device central and play the audio.

    myMusic = new Sound(myMusicMc);
    myMusic.attachSound("myMusic03");
    myMusicVolume = 100;
    myMusic.setVolume(myMusicVolume);

    on the play button i have given the following script

    on (press)
    {
    if (playing != true)
    {
    this.myMusic.start(myMusicPosition, 0);
    playing = true;
    } // end if
    }

    Please help me resolve this issue...

    Regards,
    Elmi...

  10. #10
    Registered User
    Join Date
    Apr 2010
    Posts
    44

    Re: Not enough memory to open file error

    Hi SajiSoft,
    Thanks for your support with out which I would have not completed my project I could rectify the issue my myself by doing some RND on the internet but din't thought that it would be so simple which i wanted to share so that it will help others who search in this forums for the same issue ...

    myMusic = new Sound(this);

    U need to add "this" inside the brackets thats all and the audio plays fine in the main swf... This is the only change you need to do

  11. #11
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: Not enough memory to open file error

    Oh..I was late in answering your last question because i was having some internet issues yesterday. Btw, your most welcome and great to know that u solve the issue by yourself. Wish u very best for your project.

    Best Regards,
    SajiSoft

Similar Threads

  1. loadSound() - not enough memory to open file error
    By stingmartin in forum [Archived] Flash Lite on Nokia Devices
    Replies: 4
    Last Post: 2010-03-26, 06:19
  2. Unable to open TXT file in memory
    By Musketyr in forum Mobile Java General
    Replies: 16
    Last Post: 2009-10-13, 07:19
  3. Replies: 11
    Last Post: 2008-09-16, 15:13
  4. Replies: 2
    Last Post: 2008-09-16, 14:22
  5. Replies: 0
    Last Post: 2008-09-16, 11:08

Posting Permissions

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