0 Replies Latest reply on May 17, 2011 6:15 AM by Tony Heagren

    FlashVars with CS4 html ?

    Tony Heagren

      Hi all,

       

      just wondering how I can add Flashvars to the html created by CS4 ?

       

      The page will have to be renamed from 1.html to 1.php and I've tried a few methods to include

      flashvars in the <param name> tags but to no avail.

       

      Heres the php I'm using at the top: (with comments)

      <?php
      ///// LIST THE  PICTURES IN THE DIR
      $pics1 = glob('images/folio/*');
      natsort($pics1);
      $folio = ''.implode(', ', $pics1).'';
      //  COUNT THE COMMAS IN THE STRING TO GIVE A NUMBER TO FLASH.
      $temp_string = $folio;
      $folioNum = substr_count($temp_string,",");
      $folioNum = ++$folioNum;
      ?>

       

      And here's the Flashvars I would use in a "hand written" php page to give the list of pictures to Flash:

      <param name = FlashVars value="foliopics=<? echo "$folio";?> &folioNum=<? echo "$folioNum";?> "

       

      Flash then uses this code to diplay the first picture (with similar code on "next" and "previous" buttons).

       

      import mx.data.components.DataHolder;
      piclist = _root.foliopics;
      allpics = _root.folioNum;
      allpics = parseInt(allpics);
      photos = piclist.split(",");
      howmany = allpics;

       

      var loadListener:Object = new Object();
      loadListener.onLoadInit = function(mc:MovieClip) {
          mc._x = (Stage.width/2)-(mc._width/2);
          mc._y = (Stage.height/2)-(mc._height/2-41);
      };
      var mcLoader:MovieClipLoader = new MovieClipLoader();
      mcLoader.addListener(loadListener);
      var nextPhoto:String = photos[num];
      var photoHolder:MovieClip = _root.createEmptyMovieClip("photoHolder", 1);
      mcLoader.loadClip(nextPhoto, photoHolder);
      num = ++num;
      setProperty("LB", _alpha, "40");
      _root.LB.enabled = 0;
      setProperty("_root.backB", _visible, "0");
      caption = folio_captions[num];