×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Registered User
    Join Date
    Nov 2008
    Posts
    22

    Re: Read Dymanic Swf from Container - Problem

    Thanks a lot.. It working fine.

    Now I tried this code too

    myData = new LoadVars();
    myData.onLoad = function() {
    i = 0
    while (true)
    {
    if (myData["mymovie" + i] == undefined)
    break;
    loadMovie(myData["mymovie" + i], _root);
    i++;
    }
    };
    myData.load("myChild.txt");


    In that "myChild" text file, we have like this

    mymovie0=File:///e:/demon.swf&
    mymovie1=File:///e:/eyeclosed.swf


    But I tried this to execute swf files one by one, i got only the first swf file. i wont get other swf files.

    could any one tell me the solution..

  2. #17
    Registered User
    Join Date
    Oct 2005
    Posts
    107

    Re: Read Dymanic Swf from Container - Problem

    A related question. If a master swf loads multiple child swf, does each child swf is allocated its own memory space or shares the parent swf's memory space?

    Regards
    Ramesh

  3. #18
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: Read Dymanic Swf from Container - Problem

    Hi,

    Your code does not seem right, it's loading SWFs specified in txt file in one loop without waiting for one to finish loading and playback. It won't give the results you want.

    You first need to load the variables from the txt file. When variables are loaded, then use my que playback code to load and play one SWF at a time.

    Your question regarding any other way for child SWFs, yes, there is

    Code:
    loadListener.onLoadInit = function(target_mc:MovieClip):Void 
    {
        trace(">> loadListener.onLoadInit()");
        trace(">> =============================");
        trace(">> SWF loaded: " + target_mc._url);
        // 
        target_mc.onEnterFrame = function()
        {
            if(target_mc._currentframe == target_mc._totalframes)
                _parent.loadNextSWF();
        }
    }
    In above code I added onEnterFrame function for the child, so when it reaches last frame, it call the loadNextSWF function to load the next SWF in que.

    I hope this helps,

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

  4. #19
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: Read Dymanic Swf from Container - Problem

    @Ramesh,

    It depends how you want to load the child SWFs. Main SWF will allocate memory it requires. And additional child SWF will allocate more memory as required by this SWF.

    If you have requirement to load multiple SWFs at the same time, each SWF will allocate is share of memory. If you have requirement to load one SWF at a time, then replace it with next SWF. You can unload previous SWF and load next one.

    My best practice for loading SWFs since Flash 4 days, is to replace the existing MC instance with the new one. Surprisingly it works pretty well in FL, this way memory is instantly relocated to new SWF, while if you use unloadMovie, and then create new MC instance and load next SWF, it will not immediately reallocate memory, and sometimes gives "out of memory" errors if you load / unload many SWFs.

    You can use Oxygen Toolkit to see memory usage in your FL applications. http://wiki.forum.nokia.com/index.ph...Developers_Kit

    Best,

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

Similar Threads

  1. 编译Qt样例出错,请看如下
    By TD3 in forum [Archived] Qt General ( Qt技术)
    Replies: 14
    Last Post: 2009-12-24, 03:23
  2. Container with scroll problem??
    By sunil304047 in forum Symbian
    Replies: 5
    Last Post: 2009-06-23, 13:07
  3. Problem with Skin enabling - disabling and Setting List in S60
    By sauvikds in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-08-22, 13:45
  4. File read problem
    By kannabiran.krish in forum Symbian
    Replies: 1
    Last Post: 2007-09-14, 14:38
  5. Replies: 2
    Last Post: 2007-08-04, 13:17

Posting Permissions

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