Prijava na forum:
Ime:
Lozinka:
Prijavi me trajno:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:

ConQUIZtador
Trenutno vreme je: 23. Apr 2024, 10:09:16
nazadnapred
Korisnici koji su trenutno na forumu 0 članova i 1 gost pregledaju ovu temu.


Tema za pitanja
o SMF forumu, phpBB2 i phpBB3 forumu, Wordpress i Joomla CMS sistemima!

Za vecinu drugih pitanja nacicete odgovor citajuci Top teme!

Idi dole
Stranice:
Počni novu temu Nova anketa Odgovor Štampaj Dodaj temu u favorite Pogledajte svoje poruke u temi
Tema: Hitno! PHP code  (Pročitano 3898 puta)
03. Okt 2010, 21:28:11
Svakodnevni prolaznik


Zodijak Capricorn
Pol Muškarac
Poruke 243
OS
Windows XP
Browser
Mozilla Firefox 3.6.10
mob
HTC Tatoo
Pozdrav svima. Treba mi pomoc oko jedne skripte koju sam importovao u flash kroz xml i buildGalleries.php file. Radi se o jednom albumu koji prikazuje slike, sve radi savrseno, medjutim prikazuje mi sve slike koje se nalaze u folderu a meni je potrebno da prikazuje i foldere i slike. U fazonu, kad covek klikne glavnu grupu, otvaraju se novi folderi/nove grupe, a zatim klikom na te foldere tek tada se izlistavaju slike. Naravno thumb-ovi su prethodno generisani, ali da ne otezavam. Evo i koda pa ako neko ima ideju kako bi mogao da to uradim bio bih Vam zahvalan. Molio bih da mi odgovore samo oni koji znaju o cemu pricam a znam da je na ovom forumu takvih ljudi dovoljno! Hvala unapred!  Smile

Kod:
<?php
header
("Cache-Control: no-cache");
header("Expires: -1");
$sortorder =  $_REQUEST["sortorder"];
$indir "../galleries";
$files opendir($indir);
$outxml "<?xml version=\"1.0\" encoding=\"utf-8\"?>
\n\n";
$outxml .= "<galleries>\n\n";
while ($file = readdir($files)) {
  if(is_dir($indir.'/'.$file))
  if ($file != '.' && $file != '..') {
    {
    $tmp_outxml[] = $file;
    }
}
  }
if ($sortorder == "date")
{
foreach ($tmp_outxml as $k => $v)
{
$modified = filemtime ($indir.'/'.$v);
$moddate[$k] = $modified;
}
array_multisort ($moddate, $tmp_outxml);
}
else if ($sortorder == "random")
{
shuffle ($tmp_outxml);
}
else
{
sort ($tmp_outxml);
}
foreach ($tmp_outxml as $v)
{
$outxml .= get_folder_xml($indir.'/'.$v,$v);
}
$outxml .= "</galleries>";

closedir($files);
$fp = fopen("../xml/gallery/gallery.xml", "w");
fwrite($fp, $outxml);
fclose($fp);


function get_folder_xml($imageDir,$title)
  {

  $extensions = array(".jpg", ".jpeg", ".JPG",".JPEG",".gif",".GIF",".swf",".SWF");
  $output = "";

  if($folder = opendir($imageDir))
    {
    $filenames=array();
       
    while (false !== ($file = readdir($folder)))
      {
      $dot = strrchr($file, '.');
      if(in_array($dot, $extensions))
        {
        array_push($filenames, $file);
        }         
      }
     $spaceTitle = str_replace("_"," ",$title);
     $newPath = str_replace("../","",$imageDir);

    $output .= "<gallery>\n";
     $output .= "<title>$spaceTitle</title>\n";
$output .= " <images>\n";
    foreach ($filenames as $source)
      {
  $imageName = str_replace("mainThumb_","",$source);
      $finalName = str_replace("_"," ",$imageName);

      $imageName = str_replace($extensions,"",$finalName);
      $output .= "\t <image src=\"$newPath/$source\" thumb=\"$newPath/thumbs/$source\">$imageName</image>\n";
      }
   $output .= " </images>\n";
   $output .= "</gallery>\n\n";
return $output;
     
    closedir($folder);   
    }
  }
?>
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Hronicar svakodnevice


Zodijak Aries
Pol Muškarac
Poruke 864
OS
Windows XP
Browser
Chrome 6.0.472.63
mob
Apple IPhone 3GS,
Dakle prije gledanja koda bih ti reko da ti treba samo jedna petlja sa uslovom koja provjerava da li je folder ili je file ... e sad kad sam ovo pogledo i radi preko xml... trebo si i da okacis validni xml da bi znao kao treba da se kreira .... ali ako za to nemas tip podatka npr folder ili kako vec mislim da problez iz php-a nemozes rijesiti ...
IP sačuvana
social share
Pogledaj profil GTalk
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Svakodnevni prolaznik


Zodijak Capricorn
Pol Muškarac
Poruke 243
OS
Windows 7
Browser
Chrome 5.0.342.3
mob
HTC Tatoo
Pozdrav Borise, hvala na odgovoru druze. Mada nisam bas shvatio iz kog razloga ti treba xml fajl? Postoje 2 fajla vezana za ovu skriptu. Prvi je config ili konfiguracioni u kome je sadrzano sve ono kako bi izgledala galerija, tj. kako da cita thumbove slika, koliko da ih bude, kojom brzinom se ucitavaju slike itd...hocu reci nista znacajno za kod koji meni treba. A drugi je jednostavno putanja do slika i tekstovi vezani za njih... ako je potrebno ja cu ih postaviti, ali toliko znam i vidim da nema razloga... Jos jedna stvar... ja imam foldere iz kojih se ucitavaju slike i u njima thumb folderi ali oni se ne prikazuju u galeriji a ja to hocu... nadam se da sam sada bio malo konkretniji... Hvala u svakom slucaju!  Smile
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Hronicar svakodnevice


Zodijak Aries
Pol Muškarac
Poruke 864
OS
Windows XP
Browser
Chrome 6.0.472.63
mob
Apple IPhone 3GS,
Ovako posto sam sad malo tuturutu Smiley .... dakle ideja
sortiraj fajlove u xml po npr, kategoriji koja ti u stvari znaci folder ... kategorija ima svoje atribute tj slike ... odnosno linkove do slika ... i to je to ... Smiley sad ne znam o kakvom se flashu radi odnosno kako funkcionise i da li uposte ima tu mogucno ... ovo je samo ideja
e sad kolko vidim ti jedini problem imas u tome sto ti dobija flash ili on sam ... tako da ne znam ....
zato ako imas dtd za xml koji je potreban za flash okaci pa da vidimo ...
IP sačuvana
social share
Pogledaj profil GTalk
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Svakodnevni prolaznik


Zodijak Capricorn
Pol Muškarac
Poruke 243
OS
Windows 7
Browser
Chrome 5.0.342.3
mob
HTC Tatoo
...hvala Borise na odgovorima...btw evo u nastavku i action scipt-a iz flash fajla, mozda to bude od pomoci...

// lets start by calling our config file
// create new xml object and load config.xml
var config:XML = new XML();
config.ignoreWhite = true;
// once the xml is loaded fire the loadConfig function
config.onLoad = loadConfig;
config.load("xml/gallery/config.xml");
// on load of xml
function loadConfig(success:Boolean):Void {
   if (success) {
      // get our xml start point
      var all:XMLNode = config.firstChild;
      // retrieve all xml options
      titleCol = Number(all.childNodes[0].firstChild.nodeValue);
      titleTime = Number(all.childNodes[1].firstChild.nodeValue);
      thumbsY = Number(all.childNodes[2].firstChild.nodeValue);
      thumbsX = Number(all.childNodes[3].firstChild.nodeValue);
      numCols = Number(all.childNodes[4].firstChild.nodeValue);
      numRows = Number(all.childNodes[5].firstChild.nodeValue);
      thumbPaddingX = Number(all.childNodes[6].firstChild.nodeValue);
      thumbPaddingY = Number(all.childNodes[7].firstChild.nodeValue);
      useOwnThumbs = all.childNodes[8].firstChild.nodeValue;
      thumbHeight = Number(all.childNodes[9].firstChild.nodeValue);
      thumbWidth = Number(all.childNodes[10].firstChild.nodeValue);
      thumbOverHeight = Number(all.childNodes[11].firstChild.nodeValue);
      thumbOverWidth = Number(all.childNodes[12].firstChild.nodeValue);
      thumbXScale = Number(all.childNodes[13].firstChild.nodeValue);
      thumbYScale = Number(all.childNodes[14].firstChild.nodeValue);
      thumbType = all.childNodes[15].firstChild.nodeValue;
      thumbSlicePoint = all.childNodes[16].firstChild.nodeValue;
      thumbOverSpeed = Number(all.childNodes[17].firstChild.nodeValue);
      borderSize = Number(all.childNodes[18].firstChild.nodeValue);
      thumbBorder = Number(all.childNodes[19].firstChild.nodeValue);
      thumbBorderOver = Number(all.childNodes[20].firstChild.nodeValue);
      thumbIntroSpeed = Number(all.childNodes[21].firstChild.nodeValue);
      thumbIntroDelay = Number(all.childNodes[22].firstChild.nodeValue);
      preloaderCircleColor = Number(all.childNodes[23].firstChild.nodeValue);
      preloaderTextColor = Number(all.childNodes[24].firstChild.nodeValue);
      preloaderGlowColor = Number(all.childNodes[25].firstChild.nodeValue);
      preloaderGlowAmount = Number(all.childNodes[26].firstChild.nodeValue);
      lightboxOverlayAlpha = Number(all.childNodes[27].firstChild.nodeValue);
      lightboxOverlayInSpeed = Number(all.childNodes[28].firstChild.nodeValue);
      lightboxOverlayOutSpeed = Number(all.childNodes[29].firstChild.nodeValue);
      largeImgBorderColor = Number(all.childNodes[30].firstChild.nodeValue);
      largeImgBorderSize = Number(all.childNodes[31].firstChild.nodeValue);
      largeImgSpeed = Number(all.childNodes[32].firstChild.nodeValue);
      largeImgRevealSpeed = Number(all.childNodes[33].firstChild.nodeValue);
      useInfoPanel = all.childNodes[34].firstChild.nodeValue;
      alwaysShowInfo = all.childNodes[35].firstChild.nodeValue;
      infoSlideSpeed = Number(all.childNodes[36].firstChild.nodeValue);
      infoBgColor = Number(all.childNodes[37].firstChild.nodeValue);
      infoBgAlpha = Number(all.childNodes[38].firstChild.nodeValue);
      infoShineAlpha = Number(all.childNodes[39].firstChild.nodeValue);
      infoTitleColor = Number(all.childNodes[40].firstChild.nodeValue);
      showCounter = all.childNodes[41].firstChild.nodeValue;
      infoCounterColor = Number(all.childNodes[42].firstChild.nodeValue);
      gridSlideSpeed = Number(all.childNodes[43].firstChild.nodeValue);
      navPadding = Number(all.childNodes[44].firstChild.nodeValue);
      arrowColor = Number(all.childNodes[45].firstChild.nodeValue);
      arrowGlowColor = Number(all.childNodes[46].firstChild.nodeValue);
      arrowGlowAmount = Number(all.childNodes[47].firstChild.nodeValue);
      arrowGlowAmountOver = Number(all.childNodes[48].firstChild.nodeValue);
      arrowGlowSpeed = Number(all.childNodes[49].firstChild.nodeValue);
      counterPrefix = all.childNodes[50].firstChild.nodeValue;
      counterSuffix = all.childNodes[51].firstChild.nodeValue;
      counterDiv = all.childNodes[52].firstChild.nodeValue;
      counterTextCol = Number(all.childNodes[53].firstChild.nodeValue);
      // now we can build the gallery
      buildGallery();
   } else {
      trace("XML NOT LOADED");
   }
}
// import classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
import caurina.transitions.Tweener;
// This initates the color tween
import caurina.transitions.properties.ColorShortcuts;
ColorShortcuts.init();
import flash.filters.GlowFilter;
import caurina.transitions.properties.FilterShortcuts;
FilterShortcuts.init();
buildGallery = function ():Void {
   // remove previous galllery
   scope.removeMovieClip();
   Tweener.removeAllTweens();
   // get title from main movie
   galTitle.t.autoSize = "LEFT";
   galTitle.t.text = _parent._parent.galTitle;
   // fade in and set color
   galTitle._alpha = 0;
   Tweener.addTween(galTitle, {_alpha:100, time:titleTime, transition:"easeInOutCirc"});
   Tweener.addTween(galTitle, {_color:titleCol, time:0});
   // get xml from main moive (via gallery menu)
   galString = _parent._parent.galImages;
   galleryXML = new XML(galString);
   // create a container for everything
   scope = this.createEmptyMovieClip("scope", 1);
   // create new movieclip to put all of thumbs into;
   thumbs = scope.createEmptyMovieClip("thumbs", 5);
   // position all thumbs
   thumbs._y = thumbsY;
   thumbs._x = thumbsX;
   // this is our xml start point;
   folder = galleryXML.firstChild.childNodes;
   // numDisplay is used in our calculations to determine where we are in the grid;
   numDisplay = numCols*numRows;
   /* create an array to store our images in. The array is filled in our for loop and used in
   the loadImages function */
   images = new Array();
   thumbnails = new Array();
   // run a loop to run through each instance of <image> in our xml file;
   var i:Number;
   for (i=0; i<folder.length; i++) {
      // fill our image array with the path to the image in our xml;
      images[i] = folder[i].attributes.src;
      // if use our own thumbs we need to store the thumb paths as well
      thumbnails[i] = folder[i].attributes.thumb;
      // attach a thumb for each image;
      thumb = thumbs.attachMovie("thumb", "thumb"+i, i+100);
      thumbBitmap = thumb.createEmptyMovieClip("thumbBitmap", i+11000);
      // contaner to put our selection from thumbBitmap;
      thumbnail = thumb.createEmptyMovieClip("thumbnail", i+3000);
      // give each thumb a unique id
      thumb.id = i;
      // postion thumb to take into account of the border
      thumbnail._x = borderSize;
      thumbnail._y = borderSize;
      thumb.bg._x = (thumbWidth/2)+borderSize;
      thumb.bg._y = (thumbHeight/2)+borderSize;
      // set bg to defualt state
      thumb.bg._alpha = 20;
      thumb.bg._width = 0;
      thumb.bg._height = 0;
      // get name of image
      thumb.thumbInfo = folder[i].firstChild.nodeValue;
      // tween (scale) the first set of thumbs as defined by the rows and cols
      if (i<numDisplay) {
         Tweener.addTween(thumb.bg, {_width:thumbWidth+(borderSize*2), time:thumbIntroSpeed, delay:thumbIntroDelay*i, transition:"easeInOutBack"});
         // notice the onComplete function call, once this tween is done we start to load our first thumb
         Tweener.addTween(thumb.bg, {_height:thumbHeight+(borderSize*2), time:thumbIntroSpeed, delay:thumbIntroDelay*i, transition:"easeInOutBack", onComplete:waitLoad});
      } else {
         // no point in tweening the hidden ones so let hide to save some cpu
         thumb._visible = false;
         thumb.bg._width = thumbWidth+(borderSize*2);
         thumb.bg._height = thumbHeight+(borderSize*2);
      }
      // the thumb mask it used to give the mouse over and and intro effectS
      thumb.thumbMask = thumb.attachMovie("thumbMask", "thumbMask"+i, i+9000);
      thumb.thumbMask._width = thumbWidth;
      thumb.thumbMask._height = thumbHeight;
      thumb.thumbMask._x = (thumbWidth/2)+borderSize;
      thumb.thumbMask._y = (thumbHeight/2)+(borderSize);
      thumb.thumbnail.setMask(thumb.thumbMask);
      thumb.thumbMask._visible = false;
      // attach, style and postion our thumbnail preloader
      thumb.preloader = thumb.attachMovie("preloader", "preloader", i+1000);
      thumb.preloader._y = (thumb._height/2)-(thumb.preloader._height/2);
      thumb.preloader._x = (thumb._width/2)-(thumb.preloader._width/2);
      Tweener.addTween(thumb.preloader.animation, {_color:preloaderCircleColor, time:0});
      thumb.preloader.counter.t.textColor = preloaderTextColor;
      preloaderGlow = new GlowFilter(preloaderGlowColor, preloaderGlowAmount, 4, 4, 4, 10, false, false);
      Tweener.addTween(preloader.animation, {_filter:preloaderGlow, time:0});
      // hide until needed
      thumb.preloader._visible = false;
      // set the background/border color of the thumbs;
      btnColor = new Color(thumb.bg);
      btnColor.setRGB(thumbBorder);
      // assign a unique id for each thumb;
      thumb.num = i;
      // get current column and row;
      var col = i%numCols;
      var row = Math.floor(i/numCols);
      // position thumbs in grid;
      thumb._x = col*(thumbWidth+(borderSize*2)+thumbPaddingX);
      thumb._y = row*(thumbHeight+(borderSize*2)+thumbPaddingY);
      // lets disabled the thumb until the images has loaded
      thumb.enabled = false;
      // THUMBNAIL MOUSE EVENTS
      thumb.onRelease = function() {
         // show overlay and largImg MC`s in main movie
         _parent._parent.overlay._visible = true;
         _parent._parent.largeImg._visible = true;
         // set text of info panel
         _parent._parent.info.txt.autoSize = "LEFT";
         _parent._parent.info.txt.text = this.thumbInfo;
         // tween in lightbox overlay
         Tweener.addTween(_parent._parent.overlay, {_alpha:lightboxOverlayAlpha, time:lightboxOverlayInSpeed, transition:"linear"});
         // hide hand cursor
         _parent._parent.overlay.useHandCursor = false;
         // create a container for our large image
         img = _parent._parent.largeImg.img;
         // get image to use
         currImg = images[this.id];
         // load large image
         imgBgResizer.loadClip(images[this.id], img);
         // set currThumb
         currThumb = this;
         // disable largeImg rollover until ready
         _parent._parent.largeImg.enabled = false;
         // curr thumb id for use in counter text
         currThumbID = this.id+1;
      };
      thumb.onRollOver = function() {
         // scale thumb mask and tween border color
         Tweener.addTween(this.thumbMask, {_height:thumbOverHeight, time:thumbOverSpeed, transition:"linear"});
         Tweener.addTween(this.thumbMask, {_width:thumbOverWidth, time:thumbOverSpeed, transition:"linear"});
         Tweener.addTween(this.bg, {_color:thumbBorderOver, time:thumbOverSpeed, transition:"linear"});
      };
      thumb.onRollOut = thumb.onReleaseOutside=function () {
         // reset thumb mask and border
         Tweener.addTween(this.thumbMask, {_height:thumbHeight, time:thumbOverSpeed, transition:"linear"});
         Tweener.addTween(this.thumbMask, {_width:thumbWidth, time:thumbOverSpeed, transition:"linear"});
         Tweener.addTween(this.bg, {_color:thumbBorder, time:thumbOverSpeed, transition:"linear"});
      };
   }
   // THUMB PRELOADER;
   var mcl:MovieClipLoader = new MovieClipLoader();
   var thumbLoader:Object = new Object();
   mcl.addListener(thumbLoader);
   var cont:Number = 0;
   loadImages = function () {
      var targetName1:String = "thumb"+(cont-1);
      scope.thumbs[targetName1].enabled = true;
      var targetName:String = "thumb"+cont;
      if (useOwnThumbs == "true") {
         mcl.loadClip(thumbnails[cont], scope.thumbs[targetName].thumbnail);
      } else {
         mcl.loadClip(images[cont], scope.thumbs[targetName].thumbBitmap);
      }
   };
   thumbLoader.onLoadInit = function(targetMC:MovieClip) {
      if (useOwnThumbs != "true") {
         if (thumbType == "slice") {
            targetMC._xscale = thumbXScale;
            targetMC._yscale = thumbYScale;
            // lets create a  new bitmap object from our image we defined in the xml;
            var newBitmap:BitmapData = new BitmapData(targetMC._width, targetMC._height, true, 0x000000);
            // next put the newly created bitmap into our container;
            newBitmap.draw(targetMC._parent.thumbBitmap);
            // create new selection;
            var select:BitmapData = new BitmapData(targetMC._parent.thumbBitmap._width, targetMC._parent.thumbBitmap._height, true, 0x00000000);
            // define which area of our bitmap we are going to copy;
            if (thumbSlicePoint == "center") {
               select.copyPixels(newBitmap, new Rectangle(targetMC._width/2, targetMC._height/2, thumbWidth, thumbHeight), new Point(0, 0));
            } else {
               select.copyPixels(newBitmap, new Rectangle(targetMC._width-thumbWidth, targetMC._height-thumbHeight, thumbWidth, thumbHeight), new Point(0, 0));
            }
            // attach our copied area into our thumbnail container;
            targetMC._parent.thumbnail.attachBitmap(select, 0);
            targetMC._parent.thumbnail.bitmapSmoothing;
            // hide the original bitmap ;
            targetMC._parent.thumbBitmap._visible = false;
            targetMC._parent.thumbBitmap._x = -99999;
         } else {
            // lets just scale down the image with some smoothing
            bitmap = new BitmapData(targetMC._width, targetMC._height, true);
            targetMC.attachBitmap(bitmap, targetMC.getNextHighestDepth(), "auto", true);
            bitmap.draw(targetMC);
            targetMC._width = thumbWidth;
            targetMC._height = thumbHeight;
            targetMC._x = borderSize;
            targetMC._y = borderSize;
         }
         // if we are using our own thumbs
      } else {
         targetMC.setMask(targetMC._parent.thumbMask);
         targetMC._x = borderSize;
         targetMC._y = borderSize;
      }
      // update cont so we can load our next image in the array
      cont++;
   };
   thumbLoader.onLoadProgress = function(targetMC:MovieClip, loaded:Number, total:Number) {
      // fade in bg/border
      Tweener.addTween(targetMC._parent.bg, {_alpha:100, time:1, transition:"easeOutCirc"});
      targetMC._parent.preloader._visible = true;
      // update preloader text
      var amount:Number = Math.floor(loaded/total*100);
      targetMC._parent.preloader.counter.t.text = amount;
      // position mask to the left of the thumb
      targetMC._parent.thumbMask._x = -thumbWidth;
   };
   thumbLoader.onLoadComplete = function(targetMC:MovieClip, loaded:Number, total:Number) {
      // slide in masks
      Tweener.addTween(targetMC._parent.thumbMask, {_x:(thumbWidth/2)+borderSize, time:1, transition:"easeOutCirc", onComplete:loadImages});
      // remove preloader - saves on cpu
      targetMC._parent.preloader.removeMovieClip();
   };
   // if we don`t have more thumbs than the total we want to display at any one time
   if (folder.length<numDisplay) {
      introCount = folder.length;
   } else {
      introCount = numDisplay;
   }
   isFirst = true;
   var counter:Number = 1;
   // this is our function
   function waitLoad():Void {
      counter++;
      if (counter == introCount+1) {
         loadImages();
         thumbNav._visible = true;
         thumbNav._alpha = 0;
         Tweener.addTween(thumbNav, {_alpha:100, time:1});
      }
   }
   // on overlay and large image mouse click
   _parent._parent.overlay.onRelease = _parent._parent.overlay.onReleaseOutside=_parent._parent.largeImg.onRelease=function () {
      // hide large mask and large image
      _parent._parent.largeMask._visible = false;
      _parent._parent.largeImg._visible = false;
      // fade out lightbox overlay - on complete remove everything we do not need
      Tweener.addTween(_parent._parent.overlay, {_alpha:0, time:lightboxOverlayOutSpeed, transition:"linear", onComplete:removeOverlay});
      // reset thumb to defualt state
      Tweener.addTween(currThumb.thumbMask, {_height:thumbHeight, time:thumbOverSpeed, transition:"linear"});
      Tweener.addTween(currThumb.thumbMask, {_width:thumbWidth, time:thumbOverSpeed, transition:"linear"});
      Tweener.addTween(currThumb.bg, {_color:thumbBorder, time:thumbOverSpeed, transition:"linear"});
   };
   // get rid of all the large image mc`s
   function removeOverlay() {
      _parent._parent.largeMask._visible = false;
      _parent._parent.overlay._visible = false;
      _parent._parent.info._visible = false;
      _parent._parent.largeImg.bg._width = 0;
      _parent._parent.largeImg.bg._height = 0;
   }
   // set the background/border color of the large image
   Tweener.addTween(_parent._parent.largeImg.bg, {_color:largeImgBorderColor, time:0});
   // preloader used to tween large image bg
   imgBgResizer = new MovieClipLoader();
   imgBgResizer.addListener(scope);
   imgBgResizer.onLoadInit = function(targetMC:MovieClip) {
      // set mask
      _parent._parent.largeImg.img.setMask(_parent._parent.largeMask);
      // hide everything for now
      _parent._parent.largeMask._visible = false;
      _parent._parent.largeMask._width = 0;
      _parent._parent.largeImg.img._alpha = 0;
      // get image dimensions
      _parent._parent.currImgWidth = targetMC._width;
      _parent._parent.currImgHeight = targetMC._height;
      // get border width and height
      borderWidth = targetMC._width+(largeImgBorderSize*2);
      borderHeight = targetMC._height+(largeImgBorderSize*2)+1;
      // set new image dimensions
      _parent._parent.currImgWidth = borderWidth;
      _parent._parent.currImgHeight = borderHeight;
      // scale mask to image height
      _parent._parent.largeMask._height = targetMC._height;
      _parent._parent.largeMask._y += largeImgBorderSize;
      // get width for large mask
      largeMaskWidth = Number(targetMC._width);
      // scale info panel to fit the width of image
      _parent._parent.info.bg._width = targetMC._width;
      _parent._parent.info.shine._width = targetMC._width;
      _parent._parent.info.shine._alpha = infoShineAlpha;
      // set alpha of info panel
      _parent._parent.info.bg._alpha = infoBgAlpha;
      // set info background color
      Tweener.addTween(_parent._parent.info.bg, {_color:infoBgColor, time:0});
      // set info colors
      _parent._parent.info.txt.textColor = infoTitleColor;
      _parent._parent.info.counter.textColor = infoCounterColor;
      // position counter text
      _parent._parent.info.counter.autoSize = "RIGHT";
      _parent._parent.info.counter._x = targetMC._width-_parent._parent.info.counter.textWidth-10;
      // fill in coutner text
      _parent._parent.info.counter.text = currThumbID+"/"+folder.length;
      // hide counter if we don`t want to use it
      if (showCounter == "false") {
         _parent._parent.info.counter.text = "";
      }
      // positon info panel             
      _parent._parent.info._x = -(targetMC._width/2)-1;
      if (alwaysShowInfo == "false") {
         _parent._parent.info._y = (targetMC._height/2)+_parent._parent.info.bg._height;
      } else {
         _parent._parent.info._y = (targetMC._height/2)-_parent._parent.info.bg._height;
      }
      // scale info mask to match info panel
      _parent._parent.infoMask._width = targetMC._width;
      _parent._parent.infoMask._height = _parent._parent.info.bg._height;
      _parent._parent.infoMask._x = _parent._parent.info._x;
      // capture _y position for rollover events
      yPos = Number((targetMC._height/2)-_parent._parent.info.bg._height);
      // position and set info mask
      _parent._parent.infoMask._y = yPos;
      _parent._parent.info.setMask(_parent._parent.infoMask);
      // lets remove the info panel if we are not going to use it
      if (useInfoPanel == "false") {
         _parent._parent.info._visible = false;
         _parent._parent.info._y = 90000;
      }
      // tween background to new image size - on complete load image                 
      Tweener.addTween(_parent._parent.largeImg.bg, {_height:borderHeight, time:largeImgSpeed, transition:"easeOutCirc"});
      Tweener.addTween(_parent._parent.largeImg.bg, {_width:borderWidth, time:largeImgSpeed, transition:"easeOutCirc", onComplete:loadImage});
      // call our setPostions function in the main movie to take into account the new movieclips
      _parent._parent.setPostions();
   };
   // function called on complete of large image background tween
   function loadImage() {
      loadLargeImg.loadClip(currImg, img);
   }
   // preloader for large image
   loadLargeImg = new MovieClipLoader();
   loadLargeImg.addListener(scope);
   loadLargeImg.onLoadInit = function(targetMC:MovieClip) {
      // set mask
      _parent._parent.largeImg.img.setMask(_parent._parent.largeMask);
      // position image to take account of the border
      _parent._parent.largeImg.img._x = -((targetMC._width/2)+(largeImgBorderSize))-1;
      _parent._parent.largeImg.img._x += largeImgBorderSize;
      _parent._parent.largeImg.img._y = -((targetMC._height/2)+(largeImgBorderSize))-1;
      _parent._parent.largeImg.img._y += largeImgBorderSize;
      // position mask
      _parent._parent.largeImg.largeMask._x = _parent._parent.largeImg.img._x;
      _parent._parent.largeImg.largeMask._y = _parent._parent.largeImg.img._y;
      //
   };
   loadLargeImg.onLoadComplete = function(targetMC:MovieClip) {
      // tween mask in to revel image
      _parent._parent.largeMask._visible = true;
      _parent._parent.largeImg.img._alpha = 100;
      Tweener.addTween(_parent._parent.largeMask, {_width:largeMaskWidth, time:largeImgRevealSpeed, transition:"easeOutCirc"});
      _parent._parent.largeImg.enabled = true;
      _parent._parent.info._visible = true;
   };
   // large image mouse events
   if (useInfoPanel == "true") {
      if (alwaysShowInfo == "false") {
         _parent._parent.largeImg.onRollOver = function() {
            Tweener.addTween(this.info, {_y:yPos, time:infoSlideSpeed, transition:"linear"});
         };
         _parent._parent.largeImg.onRollOut = function() {
            rollOutYpos = yPos+_parent._parent.info._height;
            Tweener.addTween(_parent._parent.info, {_y:rollOutYpos, time:infoSlideSpeed, transition:"linear"});
         };
      }
   }
   // thumb mask                 
   thumbMask = scope.attachMovie("mask", "thumbMask", 10);
   thumbMask._y = thumbs._y;
   thumbMask._x = thumbs._x;
   thumbMask._width = (thumbWidth+borderSize*2)*numCols+(thumbPaddingX*numCols);
   thumbMask._height = (thumbHeight+(borderSize*2))*numRows+(thumbPaddingY*numRows);
   thumbs.setMask(thumbMask);
   // only show the nav if needed
   if (folder.length>numDisplay) {
      // get amount of thumbs per grid
      thumbCount = numRows*numCols;
      //; attach and positon nav
      var thumbNav:MovieClip = scope.attachMovie("thumbNav", "thumbNav", 7);
      thumbNav._x = thumbs._x;
      thumbNav._y = thumbMask._height+thumbsY+navPadding;
      thumbNav._visible = false;
      // style buttons
      glowIn = new GlowFilter(arrowGlowColor, arrowGlowAmountOver, 5, 5, 5, 5, false, false);
      glowOut = new GlowFilter(arrowGlowColor, arrowGlowAmount, 5, 5, 5, 5, false, false);
      Tweener.addTween(thumbNav.nextBtn, {_filter:glowOut, time:0});
      Tweener.addTween(thumbNav.prevBtn, {_filter:glowOut, time:0});
      Tweener.addTween(thumbNav.nextBtn.downBtn, {_color:arrowColor, time:0});
      Tweener.addTween(thumbNav.prevBtn.upBtn, {_color:arrowColor, time:0});
      // disable prev button as its not needed yet
      thumbNav.prevBtn.enabled = false;
      thumbNav.prevBtn._alpha = 30;
      // set and style counter text
      thumbNav.counter.t.textColor = counterTextCol;
      thumbNav.counter.t.autoSize = "left";
      thumbNav.counter.t.text = counterPrefix+" 1"+counterDiv+thumbCount+" of "+folder.length+" "+counterSuffix;
      // var used to work out where we are in the grid
      var id:Number = 0;
      endPos = thumbsY;
      thumbNav.nextBtn.onRelease = function() {
         if (thumbCount<folder.length-(numRows*numCols)) {
            // enable prev button
            thumbNav.prevBtn.enabled = true;
            Tweener.addTween(thumbNav.prevBtn, {_alpha:100, time:1});
            id++;
            // set new endPos
            endPos += -thumbMask._height;
            // slide grid to new to endPos
            slide(thumbs, thumbs._y, endPos, gridSlideSpeed, "_y", Strong.easeInOut);
            // get old thumbCount
            prevThumbCount = thumbCount;
            // set new thumbCount
            thumbCount += numRows*numCols;
            // show next thumbs (cpu saver)
            if (prevThumbCount<thumbCount) {
               for (i=prevThumbCount; i<thumbCount; i++) {
                  var targetName1:String = "thumb"+(i);
                  scope.thumbs[targetName1]._visible = true;
               }
            }
            // update counter text                                         
            thumbNav.counter.t.text = counterPrefix+" "+(prevThumbCount+1)+counterDiv+thumbCount+" of "+folder.length+" "+counterSuffix;
            
         } else {
            // enable prev button
            thumbNav.prevBtn.enabled = true;
            Tweener.addTween(thumbNav.prevBtn, {_alpha:100, time:1});
            //
            prevThumbCount = thumbCount;
            thumbCount += numRows*numCols;
            if (prevThumbCount<thumbCount) {
               for (i=prevThumbCount; i<thumbCount; i++) {
                  var targetName1:String = "thumb"+(i);
                  scope.thumbs[targetName1]._visible = true;
               }
            }
            id++;
            endPos += -thumbMask._height;
            slide(thumbs, thumbs._y, endPos, gridSlideSpeed, "_y", Strong.easeInOut);
            // disable this button
            Tweener.addTween(this, {_alpha:30, time:1});
            Tweener.addTween(this, {_filter:glowOut, time:arrowGlowSpeed});
            this.enabled = false;
            // update counter text
            thumbNav.counter.t.text = counterPrefix+" "+(prevThumbCount+1)+counterDiv+folder.length+" of "+folder.length+" "+counterSuffix;
         }
         prevCount = (prevThumbCount+1);
      };
   }
   thumbNav.prevBtn.onRelease = function() {
      if (id != 0) {
         // enable next button
         thumbNav.nextBtn.enabled = true;
         Tweener.addTween(thumbNav.nextBtn, {_alpha:100, time:arrowGlowSpeed});
         id--;
         // set vars
         prevThumbCount = thumbCount;
         thumbCount -= numRows*numCols;
         // slide to new endpost
         endPos -= -thumbMask._height;
         slide(thumbs, thumbs._y, endPos, gridSlideSpeed, "_y", Strong.easeInOut);
         // show previous thumbs (cpu saver)
         for (i=prevThumbCount; i<thumbCount; i++) {
            var targetName1:String = "thumb"+(i);
            scope.thumbs[targetName1]._visible = false;
         }
         if (id == 0) {
            // disable this button
            Tweener.addTween(this, {_alpha:30, time:1});
            Tweener.addTween(this, {_filter:glowOut, time:arrowGlowSpeed});
            this.enabled = false;
            thumbNav.counter.t.text = counterPrefix+" "+(thumbCount-thumbCount+1)+counterDiv+thumbCount+" of "+folder.length+" "+counterSuffix;
         } else {
            thumbNav.counter.t.text = counterPrefix+" "+(prevCount-numRows*numCols)+counterDiv+thumbCount+" of "+folder.length+" "+counterSuffix;
            prevCount = prevCount-numRows*numCols;
         }
      }
   };
   // mouse over events for nav buttons
   thumbNav.prevBtn.onRollOver = thumbNav.nextBtn.onRollOver=function () {
      Tweener.addTween(this, {_filter:glowIn, time:arrowGlowSpeed});
   };
   thumbNav.prevBtn.onRollOut = thumbNav.nextBtn.onRollOut=function () {
      Tweener.addTween(this, {_filter:glowOut, time:arrowGlowSpeed});
   };
};
// slide tween function
function slide(who:MovieClip, startvalue:Number, endvalue:Number, speed:Number, prop:String, ease) {
   var slider:Tween = new Tween(who, prop, ease, startvalue, endvalue, speed, true);
}


IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Idi gore
Stranice:
Počni novu temu Nova anketa Odgovor Štampaj Dodaj temu u favorite Pogledajte svoje poruke u temi
Trenutno vreme je: 23. Apr 2024, 10:09:16
nazadnapred
Prebaci se na:  

Poslednji odgovor u temi napisan je pre više od 6 meseci.  

Temu ne bi trebalo "iskopavati" osim u slučaju da imate nešto važno da dodate. Ako ipak želite napisati komentar, kliknite na dugme "Odgovori" u meniju iznad ove poruke. Postoje teme kod kojih su odgovori dobrodošli bez obzira na to koliko je vremena od prošlog prošlo. Npr. teme o određenom piscu, knjizi, muzičaru, glumcu i sl. Nemojte da vas ovaj spisak ograničava, ali nemojte ni pisati na teme koje su završena priča.

web design

Forum Info: Banneri Foruma :: Burek Toolbar :: Burek Prodavnica :: Burek Quiz :: Najcesca pitanja :: Tim Foruma :: Prijava zloupotrebe

Izvori vesti: Blic :: Wikipedia :: Mondo :: Press :: Naša mreža :: Sportska Centrala :: Glas Javnosti :: Kurir :: Mikro :: B92 Sport :: RTS :: Danas

Prijatelji foruma: Triviador :: Domaci :: Morazzia :: TotalCar :: FTW.rs :: MojaPijaca :: Pojacalo :: 011info :: Burgos :: Alfaprevod

Pravne Informacije: Pravilnik Foruma :: Politika privatnosti :: Uslovi koriscenja :: O nama :: Marketing :: Kontakt :: Sitemap

All content on this website is property of "Burek.com" and, as such, they may not be used on other websites without written permission.

Copyright © 2002- "Burek.com", all rights reserved. Performance: 0.115 sec za 17 q. Powered by: SMF. © 2005, Simple Machines LLC.