Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User vijai54's Avatar
    Join Date
    Nov 2008
    Posts
    22
    Hi

    I written a code in order to execute Child Swf files which I took the SWF Names in Xml file, on Main SWF File. But I am getting only Last Swf File. How Can I execute all the child SWF Files one by one.

    How Can i put Timer to execute the swfs one by one. once 1st SWF File completed then it start to execute 2nd SWF file. after that 3rd like that

    Here is my code...

    var myXML:XML = new XML();
    myXML.ignoreWhite=true;
    myXML.load("xml3.xml");
    myXML.onLoad = function(success)
    {
    if (success)
    {
    var myImage = myXML.firstChild.childNodes;
    for (i=0; i<myImage.length; i++)
    {
    var imageNumber = i+1;
    var imageURL = myImage[i].attributes.url;
    holder_mc.loadMovie(imageURL, imageURL1, this.getNextHighestDepth());
    }
    }
    };


    in XML3 I written this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <videos>
    <video url="1.swf" />
    <video url="2.swf" />
    <video url="3.swf" />
    <video url="4.swf" />
    <video url="5.swf" />
    </videos>



    Plz Any one help me for this...

  2. #2
    Registered User ramesh130's Avatar
    Join Date
    Oct 2005
    Posts
    107
    Instead of using a timer, you can use events (dispatchEvent) in you child swf, where it fires and event once the playback is completed. The parent movie can then load the new swf..so on and so forth.

    Ramesh

  3. #3
    Registered User Qman's Avatar
    Join Date
    Jan 2008
    Location
    Spain
    Posts
    54
    Maybe this could solve the problem:

    Code:
    var myXML:XML = new XML();
    myXML.ignoreWhite=true;
    myXML.load("xml3.xml");
    myXML.onLoad = function(success)
    {
    if (success)
    {
    var myImage:Array = myXML.firstChild.childNodes;
    var clipTemp:MovieClip;
    
    for (i=0; i<myImage.length; i++)
    {
    var imageNumber:Number = i+1;
    var imageURL:String = myImage[i].attributes.url;
    clipTemp = holder_mc.createEmptyMovieClip("image_"+imageNumber+"_mc", imageNumber);
    clipTemp.loadMovie(imageURL);
    }
    }
    };
    You need to change the X and y of each image, because the last one will be on the top of all of the others, in the same position, so if all the images have the same dimensions, you'll see only the last one.

    If you would like to show them in a row, you could do something like this (supposing your images are 50px width)

    Code:
    var myXML:XML = new XML();
    myXML.ignoreWhite=true;
    myXML.load("xml3.xml");
    myXML.onLoad = function(success)
    {
    if (success)
    {
    var myImage:Array = myXML.firstChild.childNodes;
    var clipTemp:MovieClip;
    
    for (i=0; i<myImage.length; i++)
    {
    var imageNumber:Number = i+1;
    var imageURL:String = myImage[i].attributes.url;
    clipTemp = holder_mc.createEmptyMovieClip("image_"+imageNumber+"_mc", imageNumber);
    clipTemp.x = i*50; 
    clipTemp.loadMovie(imageURL);
    }
    }
    };
    Also you need to know that in Flash Lite you cannot load more than 5 images at the same time, (you need at least 1 second between 5 loading calls).

    Hope it helps,
    Marcos.
    --------------------------------------------
    http://www.q-interactiva.com
    http://www.infocket.com
    Spanish Mobile & Devices Adobe User Group Manager
    http://www.blocketpc.com

Similar Threads

  1. [moved] Theme Studio Error
    By TalJ in forum Themes/Carbide.ui
    Replies: 2
    Last Post: 2009-09-06, 03:39
  2. Replies: 12
    Last Post: 2009-07-13, 09:04
  3. Setting menu item from xml file
    By reuvenb in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-11-04, 21:07
  4. Problem with GCCE build in Carbide.vs
    By raffaelbechara in forum Symbian C++
    Replies: 6
    Last Post: 2008-10-20, 16:06
  5. Sending XML file from server to mobile
    By bvsbh in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-30, 14:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved