7 Replies Latest reply on Nov 29, 2007 2:52 PM by ndippy

    diplaying flash movies

    ndippy Level 1
      hi,
      my question is to diplay random files , and i have given the code as
      mcMain.btn1.onRelease = function() { //btn1
      myContent.load("assets/fvg/FlashVideoGallery.xml");
      var movieArray:Array = new Array("holes.swf","slideShowFinal.swf","publish 1.swf",
      "publish.swf","animated_gradient 1.swf","mutplShpTwn.swf",
      "fadeUpNDownFinal 1.swf","invisibleFinal 1.swf","fish.swf",
      "mtnTwnTxtFinal.swf","instances_done 1.swf","seaweed 1.swf",
      "fadeUpNDownFinal.swf","mutplShpTwn 1.swf","snooze.swf",
      "snoozeFinal 1.swf","mtnTwnTxt2.swf","snoozeFinal.swf",
      "soundOnOffFinal.swf","inputText.swf","menuFinal.swf",
      "slideShow 1.swf","instances.swf","p4.swf","preloader 1.swf"
      "staticText.swf","siteComplete.swf","p2.swf","p3.swf",
      "slideShow.swf","slideShowFinal 1.swf","preloader.swf",
      "stopAndPlay 1.swf","stopAndPlay.swf","loadMovie.swf"
      "nav-bar1.swf","motion_tween.swf","inputText 1.swf",
      "projector.swf","dynamicText.swf","projector 1.swf",
      "instances_done.swf","getURL.swf","boom.swf",
      "sequenceFinal 1.swf","mtnTwnTxt21.swf",
      "invisibleFinal.swf","animated_gradient.swf",
      "castle 1.swf","bkgdSound.swf","seaweed.swf","untitled.swf",
      "v1.swf","motionGuides.swf","sequenceFinal.swf",
      "siteComplete 1.swf","castle.swf","loadMovie 1.swf",
      "gotoScene.swf","fish 1.swf");//these are the 60 flash movies
      var movieTotal:Number = movieArray.length;
      var randomMovieTotal:Number = 20;
      var randomNum:Number;
      for (var i:Number = 0; i < randomMovieTotal; i++) {
      randomNum = random(movieTotal);
      _root["movieHolder"+i].loadMovie(movieArray[randomNum]);
      }

      but its not working for me.
      and one more question is "where i need to store all these movie files. either in samefolder where the flash file is placed. or make it as a seperate folder and or in the flash file library".
      and one more thing is "how can i place these 20 files in a order like declaring the dimensions on the screen.
      do i need to put in a CSS.if yes how can i do this."
      i was new to the flash
      please can any one help me out.
      Thank You.
        • 1. diplaying flash movies
          crazyjoemilan Level 2
          whoops, nub doublepost.
          • 2. Re: diplaying flash movies
            crazyjoemilan Level 2
            //instead of what you have...
            var randomNum:Number;
            for (var i:Number = 0; i < randomMovieTotal; i++) {
            randomNum = random(movieTotal);
            _root["movieHolder"+i].loadMovie(movieArray[randomNum]);
            }

            //what I have
            for (var i=0; i<movieTotal; i++) {
            var randomNum = Math.floor(Math.random()*movieTotal)
            _root["movieHolder"+i].movieToLoad = movieArray[randomNum]
            trace( _root["movieHolder"+i].movieToLoad );
            // _root["movieHolder"+i].loadMovie(this.movieToLoad);
            }
            }
            • 3. Re: diplaying flash movies
              ndippy Level 1
              can you please give me the code to store my .swf clips in to an "array "by specifying the "URL" of the clips where the folder is located,it contains all my 60 swf clips.
              using load() or any other method.
              thank you.
              • 4. Re: diplaying flash movies
                crazyjoemilan Level 2
                well, you can load in an XML file where they're defined - or a php/asp file where it looks through your directory to define them.

                pick one and I'll help you with it.
                • 5. Re: diplaying flash movies
                  ndippy Level 1
                  thank you for your time and concern.
                  i can go with xml.
                  i was known that , we can declare the sorce fileas <src img"1.jpg/sth">
                  and we load it in to the flash using load function .
                  can you give me a complete idea of this
                  Thank You.
                  • 6. Re: diplaying flash movies
                    crazyjoemilan Level 2
                    <xmlParentNode>
                    <xmlNode>image123.jpg</xmlNode>
                    <xmlNode>image12image.jpg</xmlNode>
                    <xmlNode>image12asdfasdf3.jpg</xmlNode>
                    <xmlNode>image12aaa3.jpg</xmlNode>
                    </xmlParentNode>

                    use that format as your xml that you pull in. (dummy.xml);

                    function loadXML() {
                    ext_xml = new XML();
                    ext_xml.ignoreWhite = true;
                    ext_xml.load(dummy.xml);
                    ext_xml.onLoad = function() {
                    parseXML(this)
                    }
                    }

                    function parseXML(xm) {
                    for (var i=0; i<xm.firstChild.childNodes.length;i++) {
                    trace(xm.firstChild.childNodes .firstChild.nodeValue);
                    }
                    • 7. Re: diplaying flash movies
                      ndippy Level 1
                      thank you so much for this code.
                      i will try this.
                      i think it will work.
                      if i hav any trouble i wil giv u the msg.
                      thank you so much.