0 Replies Latest reply on Nov 30, 2006 7:40 AM by Liz33

    Help needed for photo gallery

    Liz33
      Hi,

      I downloaded a applet for a rotating flash photo gallery. However, I can't see any instructions for how to modify the actionscript...There are a few comments, but they dont seem to be sufficient.

      Here is the script a part of the gallery:

      // prototype function for fixing the scaling and position of images

      movieclip.prototype.do_me = function () {
      var w = 540;
      var h = 400;
      var k = this._width / this._height;

      if (k > 1.35) {
      this._width = 540;
      this._yscale = this._xscale;
      this._y=0-(this._height/2);
      this._x=0-(this._width/2);
      } else {
      this._height = 400;
      this._xscale = this._yscale;
      this._y=0-(this._height/2);
      this._x=0-(this._width/2);
      }
      }

      var ap="{parameterstorage}";
      var ts="{timestamp}";
      var panel=parseInt("{panel}",10);
      var radius=parseInt("{radius}",10);

      var ysens=parseInt("{ysens}",10);
      var xsens=parseInt("{xsens}",10);
      var mousespeed=parseInt("{mousespeed}",10);
      var minspeed=parseInt("{minspeed}",10);
      var breakfactor=parseInt("{breakfactor}",10);
      var zoomtime=parseInt("{zoomtime}",10);
      var zoomamount=parseInt("{zoomamount}",10);
      var sbg = parseInt("{sbg}",10);
      var square = parseInt("{square}",10);

      var urls="{urls}";
      var target="{target}";

      var cmode = parseInt("{cmode}",10);

      var backgroundcolor=parseInt("{backgroundcolor}");
      var bgi="{backgroundimage}";

      var width=parseInt("{width}",10);
      var height=parseInt("{height}",10);
      var maxitems=parseInt("{maxitems}",10);

      /*
      var ts=-1;

      var maxitems=5;
      var panel=22;
      var radius=250;

      var ysens=100;
      var xsens=10;
      var mousespeed=60;

      */
      if (minspeed<=0) {
      minspeed=5;
      }
      minspeed/=100;
      if (Math.abs(breakfactor)>10) {
      breakfactor=10;
      }
      breakfactor/=10;
      if (zoomtime<0) {
      zoomtime=2;
      }
      zoomtime*=50;
      /*
      var zoomamount=2;

      var urls=" http://www.mandomartis.com/|http://www.effectmaker.com|http://www.yahoo.com||";
      var target="_self";

      var backgroundcolor=0xffffff;
      var width=640;
      var height=480;
      */

      var lm = "{lm}"; var lmxy = "{lmxy}";
      var lm = lm.split("|");
      var lmxy = lmxy.split("|");
      for (i=0; i<lm.length; i++) if (lm .length>3) {
      attachMovie("lom", "lm" add i, i+6+maxitems);
      var xy = lmxy
      .split(",");
      setProperty("lm" add i, _x, xy[0]);
      setProperty("lm" add i, _y, xy[1]);
      eval("lm" add i).loadMovie(lm );
      }

      function initApplet() {
      moviearea._x=width/2;
      moviearea._y=height/2;
      activated=true;

      var today=new Date();

      activated=true;

      //url's initialisation
      urls=urls.split("|");

      // bgnd activation
      bgnd._x=-width/2
      bgnd._y=0;
      bgnd._width=width;
      bgnd._height=height;
      bgndColor=new Color(bgnd);
      bgndColor.setRGB(backgroundcolor);
      if (sbg>0) bgnd._visible = true; else bgnd._visible = false;
      if (bgi.length>0)
      {
      bgholder._x=-width/2;
      bgholder._y=0;
      bgholder.backgroundimage._width=width;
      bgholder.backgroundimage._height=height;
      bgnd._visible=false;
      }
      // duplicating main clip
      for (var a=0;a<maxitems;a++) {
      newarea = "area"+a;
      duplicateMovieClip ("moviearea", newarea, a+5);
      this[newarea].item_num=a;
      this[newarea].theta = a*360/maxitems;
      this[newarea].panel = panel;
      this[newarea].radius = radius;
      this[newarea].gotoAndPlay(2);
      if (square==0) this[newarea].control._alpha=0;
      }

      // moviearea._x = -1000;
      // moviearea._visible = false;
      moviearea.gotoAndPlay (2);
      this._x = (width/2);
      }

      initApplet();// prototype function for fixing the scaling and position of images

      movieclip.prototype.do_me = function () {
      var w = 540;
      var h = 400;
      var k = this._width / this._height;

      if (k > 1.35) {
      this._width = 540;
      this._yscale = this._xscale;
      this._y=0-(this._height/2);
      this._x=0-(this._width/2);
      } else {
      this._height = 400;
      this._xscale = this._yscale;
      this._y=0-(this._height/2);
      this._x=0-(this._width/2);
      }
      }

      var ap="{parameterstorage}";
      var ts="{timestamp}";
      var panel=parseInt("{panel}",10);
      var radius=parseInt("{radius}",10);

      var ysens=parseInt("{ysens}",10);
      var xsens=parseInt("{xsens}",10);
      var mousespeed=parseInt("{mousespeed}",10);
      var minspeed=parseInt("{minspeed}",10);
      var breakfactor=parseInt("{breakfactor}",10);
      var zoomtime=parseInt("{zoomtime}",10);
      var zoomamount=parseInt("{zoomamount}",10);
      var sbg = parseInt("{sbg}",10);
      var square = parseInt("{square}",10);

      var urls="{urls}";
      var target="{target}";

      var cmode = parseInt("{cmode}",10);

      var backgroundcolor=parseInt("{backgroundcolor}");
      var bgi="{backgroundimage}";

      var width=parseInt("{width}",10);
      var height=parseInt("{height}",10);
      var maxitems=parseInt("{maxitems}",10);

      /*
      var ts=-1;

      var maxitems=5;
      var panel=22;
      var radius=250;

      var ysens=100;
      var xsens=10;
      var mousespeed=60;

      */
      if (minspeed<=0) {
      minspeed=5;
      }
      minspeed/=100;
      if (Math.abs(breakfactor)>10) {
      breakfactor=10;
      }
      breakfactor/=10;
      if (zoomtime<0) {
      zoomtime=2;
      }
      zoomtime*=50;
      /*
      var zoomamount=2;

      var urls=" http://www.mandomartis.com/|http://www.effectmaker.com|http://www.yahoo.com||";
      var target="_self";

      var backgroundcolor=0xffffff;
      var width=640;
      var height=480;
      */

      var lm = "{lm}"; var lmxy = "{lmxy}";
      var lm = lm.split("|");
      var lmxy = lmxy.split("|");
      for (i=0; i<lm.length; i++) if (lm.length>3) {
      attachMovie("lom", "lm" add i, i+6+maxitems);
      var xy = lmxy.split(",");
      setProperty("lm" add i, _x, xy[0]);
      setProperty("lm" add i, _y, xy[1]);
      eval("lm" add i).loadMovie(lm);
      }

      function initApplet() {
      moviearea._x=width/2;
      moviearea._y=height/2;
      activated=true;

      var today=new Date();

      activated=true;

      //url's initialisation
      urls=urls.split("|");

      // bgnd activation
      bgnd._x=-width/2
      bgnd._y=0;
      bgnd._width=width;
      bgnd._height=height;
      bgndColor=new Color(bgnd);
      bgndColor.setRGB(backgroundcolor);
      if (sbg>0) bgnd._visible = true; else bgnd._visible = false;
      if (bgi.length>0)
      {
      bgholder._x=-width/2;
      bgholder._y=0;
      bgholder.backgroundimage._width=width;
      bgholder.backgroundimage._height=height;
      bgnd._visible=false;
      }
      // duplicating main clip
      for (var a=0;a<maxitems;a++) {
      newarea = "area"+a;
      duplicateMovieClip ("moviearea", newarea, a+5);
      this[newarea].item_num=a;
      this[newarea].theta = a*360/maxitems;
      this[newarea].panel = panel;
      this[newarea].radius = radius;
      this[newarea].gotoAndPlay(2);
      if (square==0) this[newarea].control._alpha=0;
      }

      // moviearea._x = -1000;
      // moviearea._visible = false;
      moviearea.gotoAndPlay (2);
      this._x = (width/2);
      }

      initApplet();

      sorry for the long post; basically I fairly new to flash and not familair with actionscript at all. I figure that most of what is need is number signifing the speeds. Which i added by removing the curly brackets and adding a number,
      i.e var maxitems=parseInt("10",10);
      but I dont know how to insert my images....I've tried various things but i only end up with empty spinning boxes.
      If someone could start me off with where i put the images i may be able to complete it myself , but the more help the better really as I dont really have a clue and I dont know where to look for basic knowledge on actionscript language.

      Thanks alot in advance,
      Liz