Avatar billede rafix Nybegynder
12. august 2005 - 10:55 Der er 22 kommentarer og
1 løsning

Load movie

Er det muligt at bruge loadMovie på en måde så den film der loades stadig kan bevare links til lokale filer (uden at skulle ændres deres sti).

Eksempel: i min hovedfilm loader jeg nedenstående swf fra biblioteket fashion. I den fashion/index.swf kalder den en række filer i samme bibliotek men de virker ikke når filmen trækkes ind i min hovedfilm.

Kan det klares med nogle parametre eller lign i nedenstående kode:


on (release) {
    loadMovie("fashion/index.swf", 1);
}
Avatar billede _k Nybegynder
12. august 2005 - 15:09 #1
Hvis du laver scriptet på din knap om til at ligge må main timeline (altså _root), kan du gøre noget i retning af:

knappens_navn.onPress = function() {
  if(this == _root) {
    loadMovie("fashion/index.swf", 1);
  }
  else {
    loadMovie("enEllerAndenSti/fashion/index.swf", 1);
  }
Avatar billede rafix Nybegynder
15. august 2005 - 07:55 #2
tak k . jeg kigger på det her til formiddag :)
Avatar billede rafix Nybegynder
15. august 2005 - 08:00 #3
nedenstående kode giver slet ikke noget. min knap har instance name: BTNpeople.


BTNpeople.onPress = function() {
  if(this == _root) {
    loadMovie("fashion/index.swf", 1);
    trace(ifstatement);
  }
  else {
    loadMovie("fashion/index.swf", 1);
    trace(elsestatement);
  }
}
Avatar billede rafix Nybegynder
15. august 2005 - 08:03 #4
my bad - sorry!. jeg kaldte den forkerte swf. men når jeg tester i flash kommer følgende output:

undefined
loaded SWF
gXmlDataPath: imageData.xml
Loaded XML: false
Load XML failed
Error opening URL "file:///D|/Websites/Because%2DTest/httpdocs/kamilla/imageData.xml"

og det er super vigtigt at XML filen kan få lov til at blive liggende i samme bibliotek som den swf jeg loader. Kan det lade sig gøre ?
Avatar billede _k Nybegynder
15. august 2005 - 10:06 #5
Hov, hvor kom xml-filen fra? Den har jeg da ikke hørt om før? Men jeg kan da godt fortælle dig at den ikke bliver hentet ind ;o)

Hvad siger den hvis du prøver med:

BTNpeople.onPress = function() {
  trace(this + " == " + _root);
  if(this == _root) {
    ....
Avatar billede rafix Nybegynder
15. august 2005 - 11:16 #6
den siger:
_level0.BTNpeople == _level0
elsestatement
loaded SWF
gXmlDataPath: imageData.xml
Loaded XML: false
Load XML failed
Error opening URL "file:///D|/Websites/Because%2DTest/httpdocs/kamilla/imageData.xml"
Avatar billede rafix Nybegynder
15. august 2005 - 11:59 #7
hehe - nej xml filen havde jeg vist glemt at sige noget om. Sorry.

der ligger en xml fil i samme bibliotek som den swf jeg loader og det er vigtigt at den kan få lov til at blive der :)
Avatar billede _k Nybegynder
15. august 2005 - 13:53 #8
Smider du scriptet på selve knappen eller i en keyframe? Det skal ligge i en keyframe.

Du skal nok lave samme trick samme sted som du loader din XML-fil. Når swf'en bliver hentet ind, er stien jo relativ til den swf den bliver hentet ind i. Du bør kunne bruge samme if-sætning.
Avatar billede rafix Nybegynder
15. august 2005 - 14:17 #9
okay æv. jeg kan nemlig ikke finde det sted i den anden fil hvor jeg skal ændre stien til xml filen.
Avatar billede _k Nybegynder
15. august 2005 - 14:27 #10
Jeg vil gætte på at det er noget i retning af "xml-objektets-navn.load("en-eller-anden-sti.xml")";
....medmindre det er et af de forfærdelige datakomponenter du bruger - og dér står jeg så af....
Avatar billede rafix Nybegynder
15. august 2005 - 14:47 #11
scriptet ser sådan ud, men jeg kan ikke se hvor den loades:


//SIMPLE VIEWER v1.7

#include "modLoaderClass.as"
#include "tween.as"

Color.prototype.setTint = function (color_num, amount) {
   
    var r = (color_num & 0xFF0000) >> 16;
    var g = (color_num & 0x00FF00) >> 8 ;
    var b = (color_num & 0x0000FF);
   
    var trans = new Object();
    trans.ra = trans.ga = trans.ba = 100 - amount;
    var ratio = amount / 100;
    trans.rb = r * ratio;
    trans.gb = g * ratio;
    trans.bb = b * ratio;
    this.setTransform(trans);
}

function init(){

    trace("init");

    _global.gmcMain = this;
   
    //Consts
    gNextLevel = 1;   
    THUMB_WIDTH = 44;
    IMG_NAV_LEVEL = 9999;   
    THUMBMAXDIM = 44;
    TEXTLINEHEIGHT = 20;
   
    //process XML
    gXMLRoot = gImageData_xml.firstChild;
    trace(gXMLRoot);
    gImageCount = Number(gXMLRoot.childNodes.length);
   
    trace("gImageCount: " + gImageCount);
   
    //get data from XML   
    _global.gImageMaxDim = int(gXMLRoot.attributes.maxImageDimension);   
    frameColor = gXMLRoot.attributes.frameColor;   
    imageBorderWidth = gXMLRoot.attributes.frameWidth;   
    captionColor = gXMLRoot.attributes.textColor;   
    bgColor = gXMLRoot.attributes.bgColor;   
    stageGutter = Number(gXMLRoot.attributes.stagePadding);
    navPosition = gXMLRoot.attributes.navPosition;   
    thumbRowCount = gXMLRoot.attributes.thumbnailRows;   
    thumbColumnCount =     gXMLRoot.attributes.thumbnailColumns;       
    gNavDir = gXMLRoot.attributes.navDirection;       
   
    thumbnailDisplayCount = thumbRowCount * thumbColumnCount;   
    gThumbPageCount = Math.ceil(gImageCount/thumbnailDisplayCount) - 1;

    gImagePath = gXMLRoot.attributes.imagePath;   
    gThumbPath = gXMLRoot.attributes.thumbPath;   
               
    //use defaults if XMl missing
    if (gImagePath == undefined || gImagePath == ""){
        gImagePath = "images/";
    }
    if (gThumbPath == undefined || gThumbPath == ""){
        gThumbPath = "thumbs/";
    }
   
    trace ("gImagePath: " +gImagePath);
       
    if (isNaN(stageGutter)){
        stageGutter = 40;
    }
    if (isNaN(imageBorderWidth)){
        imageBorderWidth = 10;
    }
   
    //init loaders   
    thumbLoader = new com.qlod.LoaderClass();
    imageLoader = new com.qlod.LoaderClass();
       
    gaImages = new Array();
    gaThumbs = new Array();
   
    ///////////////////////////////////
    //ATTACH CLIPS
   
    gmcThumbArea = gmcMain.createEmptyMovieClip("mcThumbArea",gNextLevel++);       
    gmcThumbSlider = gmcThumbArea.createEmptyMovieClip("mcThumbSlider",gNextLevel++);
    gmcThumbSliderMask = gmcThumbArea.createEmptyMovieClip("mcThumbSliderMask",gNextLevel++);
    gmcThumbSliderMask.attachMovie("sDummy","mcMask",gNextLevel++);
    gmcThumbSlider.setMask(gmcThumbSliderMask);   
    //gmcThumbSliderMask._alpha = 50;
   
    gmcSelected = gmcThumbSlider.attachMovie("sSelected","mcSelected",gNextLevel++);

    /////////////////////////////
    //thumb navigation
    /////////////////////////////
    if (gNavDir == "LTR"){
        gmcNextThumbsBtn = gmcThumbArea.attachMovie("sBackThumbsBtn","mcNextThumbsBtn",gNextLevel++);
        gmcBackThumbsBtn = gmcThumbArea.attachMovie("sNextThumbsBtn","mcBackThumbsBtn",gNextLevel++);
    }else{
        gmcNextThumbsBtn = gmcThumbArea.attachMovie("sNextThumbsBtn","mcNextThumbsBtn",gNextLevel++);
        gmcBackThumbsBtn = gmcThumbArea.attachMovie("sBackThumbsBtn","mcBackThumbsBtn",gNextLevel++);       
    }
    gThumbPageId =0;
   
    gmcNextThumbsBtn.onRelease = function(){       
        gThumbPageId--;
        updateThumbs();
    }
   
    gmcBackThumbsBtn.onRelease = function(){       
        gThumbPageId++;
        updateThumbs();
    }
   
    updateThumbs();   
    gCurrentImageId = 0;
   
    /////////////////////////
   
    gmcDisplayArea = gmcMain.attachMovie("sDummy","mcDisplayArea",gNextLevel++);
    gmcDisplayArea._alpha = 0;
   
    //////////////////////////////////
    // Image navigation
   
    gmcImageButtons = gmcDisplayArea.attachMovie("sImageButtons","mcImageButtons",1);
   
    //flip img nav icons for LTR
    if (gNavDir == "LTR"){
        gmcImageButtons.mcBack._x = 60;
        gmcImageButtons.mcNext._x = 0;
        gmcImgNextIcon = gmcMain.attachMovie("sImgBack","mcImgNext",IMG_NAV_LEVEL);   
        gmcImgBackIcon = gmcMain.attachMovie("sImgNext","mcImgBack",IMG_NAV_LEVEL + 1);                       
    }else{
        gmcImgNextIcon = gmcMain.attachMovie("sImgNext","mcImgNext",IMG_NAV_LEVEL);   
        gmcImgBackIcon = gmcMain.attachMovie("sImgBack","mcImgBack",IMG_NAV_LEVEL + 1);           
    }
   
    gmcImgNextIcon._visible = false;
    gmcImgBackIcon._visible = false;
   
    gmcImageButtons.mcBack.useHandCursor = false;
    gmcImageButtons.mcNext.useHandCursor = false;
   
    gShownFirstImage = false;   
    gmcImageButtons.mcBack.onRollOver = function(){   
        if (gShownFirstImage){
            if (gCurrentImageId < gImageCount -1){           
                gmcImgBackIcon._visible = true;
                gmcImgBackIcon.mcArrow.gotoAndPlay(1);
            }
        }
    }
   
    gmcImageButtons.mcNext.onRollOver = function(){
        if (gShownFirstImage){
            if (gCurrentImageId > 0){
                gmcImageButtons.mcNext.useHandCursor = true;           
                gmcImgNextIcon._visible = true;
                gmcImgNextIcon.mcArrow.gotoAndPlay(1);
            }else{
                gmcImageButtons.mcNext.useHandCursor = false;           
            }
        }
    }
   
    gmcImageButtons.mcBack.onRollOut = function(){
        gmcImgBackIcon._visible = false;
    }
   
    gmcImageButtons.mcNext.onRollOut = function(){
        gmcImgNextIcon._visible = false;
    }
   
    gmcImageButtons.mcNext.onRelease = function(){
        nextId = gCurrentImageId - 1;
        if (nextId >= 0){           
            gaThumbs[nextId].onRelease();       
        }
    }
   
    gmcImageButtons.mcBack.onRelease = function(){
        nextId = gCurrentImageId + 1;
        if (nextId <= gImageCount ){
            gaThumbs[nextId].onRelease();
        }
    }
   
    /////////////////////////////////   
   
    gmcTitle = gmcMain.attachMovie("sCaption","mcTitle",gNextLevel++);
    gmcCaption = gmcMain.attachMovie("sCaption","mcCaption",gNextLevel++);   
   
    if (gShowDownloadLink){
        gmcLogo = gmcMain.attachMovie("sLogo","mcLogo",gNextLevel++);
    }
   
    gmcTitle.txtCap.htmlText = gXMLRoot.attributes.title;
    gmcTitle.txtCap.textColor = captionColor;
    gmcCaption.txtCap.textColor = captionColor;
   
    colLogo = new Color(gmcLogo);
    colLogo.setRGB(captionColor);       
   
    gmcImageLoadBar = gmcMain.attachMovie("sImageLoadBar","mcImageLoadBar",999999);
    gmcImageLoadBar._visible = false;
   
    //set colors
    barCol = new Color(gmcImageLoadBar);
    barCol.setRGB(frameColor);           
    selCol = new Color(gmcSelected);
    selCol.setRGB(frameColor);           
    nCol = new Color(gmcNextThumbsBtn);
    nCol.setRGB(frameColor);           
    bCol = new Color(gmcBackThumbsBtn);
    bCol.setRGB(frameColor);       
    inCol = new Color(gmcImgNextIcon);
    inCol.setRGB(frameColor);   
    ibCol = new Color(gmcImgBackIcon);
    ibCol.setRGB(frameColor);   
       
    /////////////////////////////////////////////
    //do one off resize calcs
    //calculate thumb area    dims   
    //-------------------
    gThumbAreaWidth = THUMBMAXDIM*thumbColumnCount+7;
    gThumbAreaHeight = THUMBMAXDIM*thumbRowCount+8;
    //add height for thumb nav
    if (gThumbPageCount >0){   
        gThumbAreaHeight +=THUMBMAXDIM;
    }
   
    //170 min width on caption for small no. of thumbs   
    var capWidth = Math.max(gThumbAreaWidth, 170);
    gmcTitle.txtCap._width = capWidth;
    gmcCaption.txtCap._width = capWidth ;
       
    gTitleHeight = gmcTitle.txtCap.textHeight;           
   
    //make mask on thumbnailDisplayCount
    gmcThumbSliderMask.mcMask._width = gThumbAreaWidth;
    gmcThumbSliderMask.mcMask._height = gThumbAreaHeight;
    gmcThumbSliderMask._y = 0;
    gmcThumbSliderMask._x = -gThumbAreaWidth;
       
    if (gNavDir == "LTR"){
        gmcBackThumbsBtn._x =  - THUMBMAXDIM;
        gmcNextThumbsBtn._x = -gThumbAreaWidth;   
       
        //dont overlap nav for 1 column
        if (thumbColumnCount == 1){
            gmcBackThumbsBtn._x +=  THUMBMAXDIM/2;
            gmcNextThumbsBtn._x -=  THUMBMAXDIM/2;
        }
       
    }else{
        gmcNextThumbsBtn._x =  - THUMBMAXDIM;
        gmcBackThumbsBtn._x = -gThumbAreaWidth ;
        //dont overlap nav for 1 column
        if (thumbColumnCount == 1){
            gmcBackThumbsBtn._x -=  THUMBMAXDIM/2;
            gmcNextThumbsBtn._x +=  THUMBMAXDIM/2;
        }
       
    }

    gmcNextThumbsBtn._y = gmcBackThumbsBtn._y = gThumbAreaHeight  - THUMBMAXDIM;       
   
    /////////////////////////////////////////////
   
    //init resize   
    doLayout();
   
    /////////////////////////////
    //thumb show/hide
    gmcThumbSlider._x = - gThumbAreaWidth;   

    //start loading thumbs
    initThumbs();   
   
   
    gmcSelected._visible = false;
    intStart = setInterval(autoShow,300);
   
   
    ///////////////
    //init Keyboard nav
   
    keyListener = new Object();
    keyListener.onKeyDown = function () {   
        if (okPress) {
            if(Key.isDown(Key.LEFT)) {
                if (gNavDir == "LTR"){
                    gmcImageButtons.mcNext.onRelease();
                }else{
                    gmcImageButtons.mcBack.onRelease();               
                }
            }else if(Key.isDown(Key.RIGHT)) {
                if (gNavDir == "LTR"){
                    gmcImageButtons.mcBack.onRelease();
                }else{
                    gmcImageButtons.mcNext.onRelease();               
                }
            }       
        }
        okPress = false;
    }
    okPress = true;
    keyListener.onKeyUp = function () {   
        okPress = true;
    }
    Key.addListener(keyListener);
       
}

function autoShow(){
   
    doLayout();
    clearInterval(intStart);
    //auto show 1st image
    gPendingImageId = 0;
    gaThumbs[0].makeCurrent();   
    gaThumbs[0].doRelease();
   
}

//////////////

function xableImghandCursors(){
    if (gCurrentImageId  < gImageCount -1){
        gmcImageButtons.mcBack.useHandCursor = true;                   
    }else{
        gmcImageButtons.mcBack.useHandCursor = false;
    }
   
    if (gCurrentImageId > 0){
        gmcImageButtons.mcNext.useHandCursor = true;           
       
    }else{
        gmcImageButtons.mcNext.useHandCursor = false;
    }   
}


////////////////
// RESIZE
///////////////
function doLayout(){

    trace("doLayout");
       
    if (gStageWidth == undefined){   
        stageWidth = Stage.width;
        stageHeight = Stage.height;   
    }else{
        stageWidth = gStageWidth;
        stageHeight = gStageHeight;   
    }
   
    trace("stage width: " + stageWidth);
   
    //calculate display area   
    //-------------------
    if (navPosition == "left" || navPosition == "right"){        
        displayWidth = stageWidth - (stageGutter*3) - gThumbAreaWidth;
        displayHeight = stageHeight- (stageGutter*2);
    }else{
        displayWidth = stageWidth - (stageGutter*2) ;
        displayHeight = stageHeight- (stageGutter*3) - gThumbAreaHeight;       
    }
    //get min of width/height
    if (displayWidth < displayHeight){
        displayDim = displayWidth;
    }else{
        displayDim = displayHeight;
    }   
    // get min of disp dim and XML max dim   
    MaxDisplayDim = gImageMaxDim + imageBorderWidth*2;
   
    if (MaxDisplayDim < displayDim){
        displayDim = MaxDisplayDim;
    }
   
    displayDim = Math.floor(displayDim);
   
    UIWidth = displayDim+gThumbAreaWidth + stageGutter;   
    UIHeight =  displayDim+gThumbAreaHeight + stageGutter;   
   
    //set coords
    switch (navPosition) {
      case "top":
        thumbAreaY = Math.floor((stageHeight - UIHeight)/2);   
        displayAreaY = Math.floor(thumbAreaY + stageGutter + gThumbAreaHeight);
        displayAreaX = Math.floor((stageWidth - displayDim)/2);
        thumbAreaX =  Math.floor((stageWidth - gThumbAreaWidth)/2) + gThumbAreaWidth;
        break;
      case "bottom":
        displayAreaY = Math.floor((stageHeight - UIHeight)/2);   
        displayAreaX = Math.floor((stageWidth - displayDim)/2);
        thumbAreaY = Math.floor(displayAreaY + displayDim + stageGutter);
        thumbAreaX =  Math.floor((stageWidth - gThumbAreaWidth)/2) + gThumbAreaWidth;
        break;
      case "left":       
        displayAreaY = Math.floor((stageHeight - displayDim)/2);
        thumbAreaX = Math.floor((stageWidth - UIWidth)/2 + gThumbAreaWidth);   
        thumbAreaY =  Math.floor((stageHeight - gThumbAreaHeight)/2);
        displayAreaX = Math.floor(thumbAreaX + stageGutter);
        break;
      default:
        displayAreaY = Math.floor((stageHeight - displayDim)/2);
        thumbAreaX = stageWidth - Math.floor((stageWidth - UIWidth)/2);   
        thumbAreaY =  Math.floor((stageHeight - gThumbAreaHeight)/2);
        displayAreaX = Math.floor(thumbAreaX -( stageGutter+displayDim+ gThumbAreaWidth));
    }
       
    gmcThumbArea._x = thumbAreaX;
    gmcThumbArea._y = thumbAreaY;

    gmcDisplayArea._x = displayAreaX;
    gmcDisplayArea._y = displayAreaY;
    gmcDisplayArea._width = displayDim;
    gmcDisplayArea._height = displayDim;

    //set gmcImageLoadBar posn
    gmcImageLoadBar._x =  Math.floor(displayAreaX + gmcDisplayArea._width/2);
    gmcImageLoadBar._y =  Math.floor(displayAreaY + gmcDisplayArea._height/2);               
                       
    //Caption pos - captions go under thumbs
    gmcCaption._x = thumbAreaX + 4 - gThumbAreaWidth;
    gmcCaption._y = thumbAreaY + gThumbAreaHeight;
       
    gmcTitle._x = thumbAreaX + 4 - gThumbAreaWidth;
    gmcTitle._y = thumbAreaY - gTitleHeight;
       
    gaImages[gCurrentImageId].centerImage();
       
    //move logo
    gmcLogo._x = Math.floor (stageWidth  - gmcLogo._width - 10);
    gmcLogo._y = Math.floor (stageHeight  - gmcLogo._height - 10);
   
}

//////////////////////////////

function updateThumbs(){
   
    if (gNavDir == "LTR"){
        gThumbGotoX = - gThumbAreaWidth*gThumbPageId - gThumbAreaWidth;   
    }else{
        gThumbGotoX = gThumbAreaWidth*gThumbPageId - gThumbAreaWidth;
    }
   
    if (gThumbGotoX != gmcThumbSlider._x){
        doTween(gmcThumbSlider,20, "_x", gThumbGotoX)
    }

    if(gThumbPageId == 0){
        gmcNextThumbsBtn._visible = false;
    }else{
        gmcNextThumbsBtn._visible = true;
    }
   
    if (gThumbPageId == gThumbPageCount){
        gmcBackThumbsBtn._visible = false;
    }else{
        gmcBackThumbsBtn._visible = true;
    }
   
}

/////////////////////////////////////////////
// THUMB
/////////////////////////////////////////////


function initThumbs(){

    //load garbage
    gmcMain.createEmptyMovieClip("mcBodge", -1);   
    gmcMain.mcBodge._visible = false;       
    gmcMain.mcBodge._alpha = 0;       
    bodgeId = thumbLoader.load(gmcMain.mcBodge,  gThumbPath + gXMLRoot.firstChild.firstChild.firstChild.nodeValue);       
           
    gNextLevel++;
    // create a thumb for each image   
    for (var i = 0;i<gImageCount;i++){
        gaThumbs[i] = gmcThumbSlider.attachMovie("sThumb","thumb"+i,gNextLevel++,{id:i});
        gaThumbs[i]._y = THUMBMAXDIM* (i%thumbRowCount);
       
        if (gNavDir == "LTR"){
            gaThumbs[i]._x = THUMBMAXDIM * Math.floor(i/thumbRowCount);                       
        }else{
            gaThumbs[i]._x = gThumbAreaWidth - THUMBMAXDIM * (Math.floor(i/thumbRowCount)+1);       
        }
    }   
}

function Thumb(){
    trace("creating Thumb:" + this.id);
    this.XMLData = gXMLRoot.childNodes[this.id];
               
    this.createEmptyMovieClip("mcThumbListener", 1);       
    this.mcThumbListener.onEnterFrame = function(){
       
        var loadclip = this._parent.mcThumb.mcThumb.mcThumb;   
        var total = loadclip.getBytesTotal();
        var kLoaded = loadclip.getBytesLoaded();   
        var p = Math.floor((kLoaded/total)*100);
       
        //display load progress bar   
        if (kLoaded > 16 && kLoaded >= total && loadclip._width > 1){
            this.onEnterFrame = undefined;
            //do on loaded
            this._parent.onThumbLoaded();
        }
    }
    this.thumbLoaded = false;   
    this.imageLoaded = false;
    this.mcThumb._visible = false;
    this.mcViewed._visible = false;
   
    //start loading in thumb
    this.thumbLoadId = thumbLoader.load(this.mcThumb.mcThumb.mcThumb, gThumbPath+this.XMLData.firstChild.firstChild.nodeValue);       

    colFrame = new Color(this.mcThumb.mcFrame);
    colFrame.setRGB(frameColor);
    colBar = new Color(this.mcThumb.mcBar);
    colBar.setRGB(frameColor);
    colViewedBar = new Color(this.mcViewed);
    colViewedBar.setRGB(frameColor);
    colSquare = new Color(this.mcSquare);
    colSquare.setRGB(frameColor);
}

Thumb.prototype = new MovieClip();

Object.registerClass("sThumb", Thumb);

Thumb.prototype.onThumbLoaded = function(){
    trace("thumb loaded: " + this.id);
    //resize thumbImage to fit thumb
    this.mcThumb._visible = true;
    this.centerThumb();       
    this.gotoAndPlay("thumbLoaded");   
    this.loadImage();   
    this.thumbLoaded = true;
   
    this.onRollOver = this.doRollOver;
    this.onRollOut = this.doRollOut;
    this.onRelease = this.doRelease;       
}

Thumb.prototype.doRollOver = function(){
    if (this.thumbLoaded){
        this.gotoAndPlay("_over");   
        //show this caption
        gmcCaption.txtCap.htmlText = this.XMLData.childNodes[1].firstChild.nodeValue;       
        gmcCaption.txtCap.textColor = captionColor;
    }
}

Thumb.prototype.doRollOut = function(){
    if (this.thumbLoaded){
        //show this caption
        gmcCaption.txtCap.htmlText = gaThumbs[gCurrentImageId].XMLData.childNodes[1].firstChild.nodeValue;
        gmcCaption.txtCap.textColor = captionColor;
    }
}

Thumb.prototype.doRelease = function(){
           
    this.enabled = false;
    gaThumbs[gCurrentImageId].enabled = true;
   
    if (this.thumbLoaded){
        if (!this.imageLoaded){   
            this.makeCurrent();
        }else{
            //do transition to new image
            gaImages[this.id].showImage();               
        }
    }
    gmcSelected._x = this._x;
    gmcSelected._y = this._y;
   
    //slide thumbs?   
    gThumbPageId = Math.floor(this.id / thumbnailDisplayCount);
    updateThumbs();

}

Thumb.prototype.makeCurrent = function(){       
   
    imageLoader.makeCurrent(this.imageLoadId);   
    //show image loader over current image       
    gmcImageLoadBar.mcBar._width = 0;
    gmcImageLoadBar._visible = true;
    gPendingImageId = this.id;
    ////////////
    gmcImageLoadBar.onEnterFrame = function(){       
        //display load progress bar           
        this.mcBar._width =  gaThumbs[gPendingImageId].mcImageListener.p * 106/100;
           
        if (this.p == 100){
            this.onEnterFrame = undefined;
        }
    }
    ////////////
   
}

Thumb.prototype.loadImage = function(){
    //create image mc
    //gaImages[this.id] = gmcDisplayArea.mcImage.attachMovie("sImage","image"+this.id,gNextLevel++);
    gaImages[this.id] = gmcMain.attachMovie("sImage","image"+this.id,gNextLevel++,{id:this.id});

    gaImages[this.id]._visible = false;
   
    //create image load listener
    this.createEmptyMovieClip("mcImageListener", 2);
    gaImages[this.id].mcImage.createEmptyMovieClip("mcLoader", 1);
    //gaImages[this.id].mcImage.attachMovie("sImageHolder","mcLoader", 1);
               
    this._parent.mcThumb.mcDark._width =  this._parent.mcBkgnd._width;
   
    this.mcImageListener.onEnterFrame = function(){
       
        var loadclip = gaImages[this._parent.id].mcImage.mcImage;                   
        var total = loadclip.getBytesTotal();
        var kLoaded = loadclip.getBytesLoaded();   
        this.p = Math.floor((kLoaded/total)*100);
                       
        if (total < 16){
            this.p =0;
        }
       
        //display load progress bar           
        this._parent.mcThumb.mcShadow._width =  THUMB_WIDTH * (100 - this.p)/100;
        this._parent.mcThumb.mcBar._width =  THUMB_WIDTH * this.p/100;

        this._parent.txtLoad.text = this.p;
       
        if (loadclip.getBytesLoaded() == loadclip.getBytesTotal() && loadclip.getBytesLoaded() > 16){
           
        //if (kLoaded > 16 && kLoaded >= total  && loadclip._width > 1){       
            this.onEnterFrame = undefined;
            //do on loaded
            this._parent.imageLoaded = true;
            gaImages[this._parent.id].onImageLoaded();
            this._parent.mcThumb.mcBar._visible = false;
        }
       
       
    }
   
    //start loading in image   
    this.imageLoadId = imageLoader.load(gaImages[this.id].mcImage.mcImage, gImagePath+this.XMLData.firstChild.firstChild.nodeValue);
   
}


Thumb.prototype.centerThumb = function(){

    mcOuter = this;
    mcInner = this.mcThumb.mcThumb.mcThumb;
    mcBorder = this.mcThumb.mcBkgnd;
    mcDark = this.mcThumb.mcDark;
    borderWidth = thumbBorderWidth;
   
    //no resizing
    mcInner._x = mcOuter._width - mcInner._width;
    mcInner._y = mcOuter._height - mcInner._height;
   
}

/////////////////////////////////////////////
// IMAGE
/////////////////////////////////////////////

function Image(){
   
    colFrame = new Color(this.mcImage.mcBkgnd);
    colFrame.setRGB(frameColor);   
   
}

Image.prototype = new MovieClip();

Object.registerClass("sImage", Image);

Image.prototype.fadeOut = function(){
    //trace("FADE OUT");
    this.gotoAndPlay("fadeOut");
   
}

Image.prototype.onFadeOutDone = function(){
    //trace("FADE OUT DONE");
    this._visible = false;
   
}

Image.prototype.fadeIn = function(){
    //trace("FADE In");
    this._visible = true;
    this.gotoAndPlay("fadeIn");
   
}

Image.prototype.onImageLoaded = function(){
       
    //if this is current image than show it
    if (gPendingImageId == this.id){
        this.showImage();       
    }       
}

Image.prototype.showImage = function(){
   
    TRACE("SHOWIMAGE");
    gaImages[gCurrentImageId].fadeOut();
    this.fadeIn();   
    gCurrentImageId = this.id;
    gmcImageLoadBar._visible = false;
    gaThumbs[this.id].mcViewed._visible = true;
    gPendingImageId = -1;
    //show this caption
    gmcCaption.txtCap.htmlText = gaThumbs[gCurrentImageId].XMLData.childNodes[1].firstChild.nodeValue;
    gmcCaption.txtCap.textColor = captionColor;
    this.centerImage();
       
    xableImghandCursors();   
    //if mouse already over img on first show image - show next icon
    if (!gShownFirstImage){       
    gShownFirstImage = true;
        if (gmcImageButtons.mcBack.hitTest(gmcMain._xmouse,gmcMain._ymouse)){
              gmcImageButtons.mcBack.onRollOver();
        }
        if (gmcImageButtons.mcNext.hitTest(gmcMain._xmouse,gmcMain._ymouse)){
              gmcImageButtons.mcNext.onRollOver();
        }
        //only show 1st selected after thumb is loaded
        gmcSelected._visible = true;
       
    }
    else{
        //hide img nav icons
        gmcImgBackIcon._visible = false;
        gmcImgNextIcon._visible = false;
    }
   
}

Image.prototype.centerImage = function(){
   
    mcOuter = gmcDisplayArea;
    mcInner = this.mcImage.mcImage;
    mcBorder = this.mcImage.mcBkgnd;
    mcShadow = this.mcImage.mcShadow;
    borderWidth = imageBorderWidth;
           
    //centers an MC relative to parent
    //and proporpionally scales it to fit parent
   
    mcInner._xscale = 100;
    mcInner._yscale = 100;
    if (mcInner._width > mcInner._height){

        //fat
       
        //only scale down
        if (mcInner._width >= mcOuter._width){
            var oldWidth = mcInner._width;
            mcInner._width = mcOuter._width - borderWidth*2;
            mcInner._height = mcInner._height*mcInner._width/oldWidth;
        }
           
    }else{
        //skinny   
        if (mcInner._height >= mcOuter._height){
            var oldHeight = mcInner._height;
            mcInner._height = mcOuter._height - borderWidth*2;
            mcInner._width = mcInner._width*mcInner._height/oldHeight;       
        }           
                       
    }
    //center
    mcInner._y = Math.floor((mcOuter._height - mcInner._height)/2);
    mcInner._x = Math.floor((mcOuter._width - mcInner._width)/2);
   
    trace("centerImage WIDTH: " + mcInner._width);   
    mcBorder._x = mcInner._x - borderWidth;
    mcBorder._width = mcInner._width + borderWidth*2;
    mcBorder._y = mcInner._y - borderWidth;
    mcBorder._height = mcInner._height+ borderWidth*2;

    this._x =displayAreaX;
    this._y =displayAreaY;
   
    //place img nav icons
    if (gNavDir == "LTR"){
        gmcImgBackIcon._x = this._x  + mcInner._x + mcInner._width - THUMB_WIDTH;
        gmcImgNextIcon._x = this._x  + mcInner._x;                   
    }else{
        gmcImgNextIcon._x =this._x  + mcInner._x + mcInner._width - THUMB_WIDTH;
        gmcImgBackIcon._x = this._x  + mcInner._x;   
    }
    gmcImgNextIcon._y = gmcImgBackIcon._y = this._y  + mcInner._y + mcInner._height - THUMB_WIDTH;       
}

init();
Avatar billede _k Nybegynder
15. august 2005 - 15:06 #12
xml'en bliver heller ikke loadet i dette script. Hvor har du det fra, og har du ikke en redigerbar fla?
Avatar billede rafix Nybegynder
15. august 2005 - 15:22 #13
jeg har en redigerbar flash men jeg kan ikke finde noget med xml i den.
www.because-test.dk/kamilla/fashion/viewer.fla

jeg har købt denne fla til at kunne lave et billedegalleri på:
http://www.airtightinteractive.com/simpleviewer/
Avatar billede _k Nybegynder
15. august 2005 - 15:38 #14
Ja, det ser lidt tricky ud, og jeg kan heller ikke lige se hvor xml'en bliver loadet ind. Der bliver refereret til 2 filer "modLoaderClass.as" og "tween.as" i det ovenstående (som vel selv hedder "viewer.as"?). Står der ikke noget med XML i dem?
Avatar billede rafix Nybegynder
15. august 2005 - 15:57 #15
tween.as:
//SIMPLE TWEEN

easeOutQuint = function (t, b, c, d) {
    return c*((t=t/d-1)*t*t*t*t + 1) + b;
};

// allows tween of 2 properties at once
// global duration
// global ease type

function doTween(mcId, frames, property, target, propertyB, targetB){
   
    mcId.t=0;
    mcId.b=mcId[property];
    mcId.c= target - mcId.b;
    mcId.d=frames;
   
    mcId.bB=mcId[propertyB];
    mcId.cB= targetB - mcId.bB;   
       
    mcId.onEnterFrame = function(){
        if (mcId.t<mcId.d){
            mcId[property] = easeOutQuint(mcId.t,mcId.b,mcId.c,mcId.d);
            mcId[propertyB] = easeOutQuint(mcId.t,mcId.bB,mcId.cB,mcId.d);
            mcId.t++
        }else{
            mcId.onEnterFrame = undefined;   
        }
    }
}

//example usage
//doTween(mcTest, 20, "_height", 200, "_width", 200){
   
   





modLoaderClass.as:
trace("com.qlod.LoaderClass.as loaded");

/**
*  @class LoaderClass
*  Implements Colin Moock's Preloading Api as proposed
*  at http://www.moock.org/blog/archives/000010.html
*
*  This code is supplied as is, use it at your own risk
*  and please don't remove this header.
*
*  If you plan to use the code on a commercial site,
*     we would happily receive a donation to
*  paypal@helpqlodhelp.com. See the docs for the details
*
*  Version 1.01
*    Date 2003/06/16
*  Author Ralf Bokelberg

*/

// FT MOD
//ADDED makeCurrent method

if( typeof(_global.com) != 'object'){
    _global.com = new Object();
}
if( typeof(com.qlod) != 'object'){
    com.qlod = new Object();
}

o = com.qlod.LoaderClass = function( piTimeoutMs, piIntervalMs, piMinSteps){
    //trace("LoaderClass " + arguments);
    if( arguments[0] == 'NO_INIT') return;
   
    this.iIntervalId = -1;
    this.iTimeoutIntervalId = -1;
    this.iBytesLoaded = 0;
    this.iBytesTotal = 1;
    this.iTimeoutMs = 0;
    this.bTimeoutEnabled = true;
    this.iIntervalMs = 0;
    this.iStartTimeMs = 0;
    this.iMinSteps = 1;
    this.iCurrentStep = 1;

    this.aQueue = [];
   
    this.setTimeoutMs( piTimeoutMs);
    this.setIntervalMs( piIntervalMs);
    this.setMinSteps( piMinSteps);
   
    if( DefaultBroadcaster != undefined){
        DefaultBroadcaster.initialize( this);
    } else {
        if(ASBroadcaster == undefined){
            trace("ERROR in LoaderClass: ASBroadcaster undefined");
        } else {
            ASBroadcaster.initialize(this);
        }
    }
};
//
// Statics
o.DEFAULT_TIMEOUT_MS = 2 * 1000;
o.DEFAULT_INTERVAL_MS = 100;
o.DEFAULT_MIN_STEPS = 1;


// Prototypes
o = o.prototype;

o.load = function( pLoc, psUrl, poListener ) {
    //trace("LoaderClass.load " + arguments);
    var id = this.observe.apply( this, arguments);
    if( ! id ){
        trace( "Error in com.qlod.LoaderClass.load: Invalid location parameter: " + pLoc);
        return false;
    }
    return id;   
};

o.observe = function( pLoc, psUrl, poListener ) {
    this.sUrl = (typeof(psUrl) == 'string') ? psUrl : (typeof(pLoc._url) == 'string') ? pLoc._url : "";
    this.target = this.locToTarget( pLoc);
    this.oListener = poListener;
    if( this.target == null){
        if( arguments.caller != this.load){
            trace( "Error in com.qlod.LoaderClass.observe: Invalid location parameter: " + pLoc);
        }
        return false;
    }
    return this.enqueue( arguments.caller == this.load, arguments.slice(3));
};

o.clear = function(){
    this.aQueue.length = 0;
    this.removeCurrent();
}

o.go = function(){
    ASBroadcaster.initialize( this);
}

o.removeCurrent = function(){
    if( this.isLoading()){
        var currentLoc = this.targetToLoc();
        if( this.checkLocation( currentLoc)){
            currentLoc.unloadMovie();   
        }
        this.endTimeout();
        this.endLoading();
    }   
}

o.remove = function( pId){
    if( this.oCurrentItem.iId == pId){
        this.removeCurrent();
        return true;   
    }
    for( var i=0; i<this.aQueue.length; i++){
        if(this.aQueue[i].iId == pId){
            this.aQueue.splice( i, 1);
            return true;   
        }   
    }
    return false;   
}

/////
//Added - FT mod
o.makeCurrent = function(pId){

    if( this.oCurrentItem.iId == pId){
        return true;   
    }
    for( var i=0; i<this.aQueue.length; i++){
        if(this.aQueue[i].iId == pId){
            tempItem = this.aQueue[i];           
            this.aQueue.splice( i, 1);           
            this.aQueue.unshift(this.oCurrentItem);           
            this.oCurrentItem = tempItem;   
            this._observe();   
            return true;   
        }   
    }
    return false;
}
/////

o.getTimeoutMs = function(){
    return this.iTimeoutMs;   
}

o.setTimeoutMs = function( piMilliseconds){
    this.iTimeoutMs = this.checkIntGreaterZero( piMilliseconds, this.constructor.DEFAULT_TIMEOUT_MS);
    if(this.iTimeoutIntervalId != -1){
        this.startTimeout();
    }
    return this.iTimeoutMs;   
}

o.disableTimeout = function(){
    this.endTimeout();
    this.bTimeoutEnabled = 0;   
}

o.enableTimeout = function(){
    this.bTimeoutEnabled = 1;
    this.startTimeout();   
}

o.getIntervalMs = function(){
    return this.iIntervalMs;   
}

o.setIntervalMs = function( piMilliseconds){
    this.iIntervalMs = this.checkIntGreaterZero( piMilliseconds, this.constructor.DEFAULT_INTERVAL_MS);
    if( this.isLoading()){
        clearInterval( this.iIntervalId);
        this.iIntervalId = -1;
        this.startInterval();
    }
    return this.iIntervalMs;   
}

o.getMinSteps = function(){
    return this.iMinSteps;   
}

o.setMinSteps = function( piMinSteps){
    return this.iMinSteps = this.checkIntGreaterZero( piMinSteps, this.constructor.DEFAULT_MIN_STEPS);   
}

o.isLoading = function(){
    return this.iIntervalId != -1;
}

o.getBytesLoaded = function(){
    var bytesToShow = Math.min( this.iBytesLoaded, Math.floor( this.iBytesTotal * this.iCurrentStep / this.iMinSteps ));
    // i wonder why NaN ever showed up, but it did,
    // so it is more robust to check for NaN explicitely
    return (isNaN(bytesToShow)) ? 0 : bytesToShow;
}

o.getBytesTotal = function(){
    return this.iBytesTotal;
}

o.getKBLoaded = function(){
    return this.getBytesLoaded() >> 10;
}

o.getKBTotal = function(){
    return this.getBytesTotal() >> 10;
}

o.getPercent = function(){
    return this.getBytesLoaded() * 100 / this.iBytesTotal;
}

o.getDuration = function(){
    return getTimer() - this.iStartTimeMs;
}

o.getSpeed = function(){
    return Math.floor(this.getBytesLoaded() * 1000 / this.getDuration());
}

o.getEstimatedTotalTime = function(){
    return Math.floor(this.getBytesTotal() / this.getSpeed());
}

o.getTarget = function(){
    return this.oCurrentItem.target;
}

o.getTargetObj = function(){
    return (typeof(this.oCurrentItem.target) == 'object') ? this.oCurrentItem.target : eval(this.oCurrentItem.target);
}

o.getUrl = function(){
    return this.oCurrentItem.sUrl;
}


/*********************************************************************************
*                                 private methods
*********************************************************************************/


o.broadcastOnQueueStart = function(){
    this.broadcastMessage( "onQueueStart", this);   
}

o.broadcastOnQueueStop = function(){
    this.broadcastMessage( "onQueueStop", this);   
}

o.broadcastOnLoadStart = function(){
    this.broadcastMessage( "onLoadStart", this);   
}

o.broadcastOnLoadComplete = function( pbResult){
    this.broadcastMessage( "onLoadComplete", pbResult, this);
}

o.broadcastOnLoadTimeout = function(){
    this.broadcastMessage( "onLoadTimeout", this);       
}

o.broadcastOnLoadProgress = function(){
    this.broadcastMessage( "onLoadProgress", this);
}

o._load = function(){
    var loc = this.oCurrentItem.target;
    this.startTimeout();
    //
    if( typeof( loc.load) == 'function'){
        loc.load.apply( loc, [this.oCurrentItem.sUrl].concat( this.oCurrentItem.aArgs));
    } else if( typeof( loc.loadSound) == 'function'){
        loc.loadSound.apply( loc, [this.oCurrentItem.sUrl].concat( this.oCurrentItem.aArgs));
    } else {
        this.funcWaitUntil = this.waitUntilPropertiesAreInitialized;
        if( this.oCurrentItem.aArgs[0].toUpperCase() == 'POST'){
            loadMovie( this.oCurrentItem.sUrl, loc, 'POST');
        } else if( this.oCurrentItem.aArgs[0].toUpperCase() == 'GET'){
            loadMovie( this.oCurrentItem.sUrl, loc, 'GET');
        } else {
            loadMovie( this.oCurrentItem.sUrl, loc);
        }
    }
}   

o._observe = function(){
    this.iBytesTotal = 1;
    this.iBytesLoaded = 0;   
    this.iCurrentStep = 1;
    this.iStartTimeMs = getTimer();
    this.funcWaitUntil = null;
    //
    if( typeof(this.oCurrentItem.oListener) == 'object'){
        this.addListener(this.oCurrentItem.oListener);
    }
    //
    this.broadcastOnLoadStart();
    this.broadcastOnLoadProgress();
    if( this.oCurrentItem.bDoLoad){
        this._load();   
    }
}   

o.enqueue = function( pbDoLoad, paArgs){
    var id = ++this.iId;
    this.aQueue.push( { target: this.target, sUrl: this.sUrl, bDoLoad: pbDoLoad, aArgs: paArgs, iId: id, oListener: this.oListener });   
    if( ! this.isLoading()){
        this.startLoading();
    }
    return id;
}

o.isQueueEmpty = function(){
    return this.aQueue.length == 0;
}

o.loadNext = function(){
    this.oCurrentItem = this.aQueue.shift();   
    this._observe();   
}

o.startLoading = function(){
    this.broadcastOnQueueStart();
    this.startInterval();       
    this.loadNext();
}

o.stopLoading = function(){
    this.endInterval();
    this.endTimeout();
}

o.startTimeout = function(){
    if(this.iTimeoutIntervalId != -1){
        clearInterval(this.iTimeoutIntervalId);
    }
    if(this.bTimeoutEnabled){
        this.iTimeoutIntervalId = setInterval( this, "onTimeout", this.iTimeoutMs);
    }
}

o.endTimeout = function(){
    if(this.iTimeoutIntervalId != -1){
        clearInterval(this.iTimeoutIntervalId);
        this.iTimeoutIntervalId = -1;
    }
}

o.onTimeout = function(){
    this.endTimeout();
    this.broadcastOnLoadTimeout();       
    this.endLoading( false);
}

o.locToTarget = function( loc){
    if( this.locIsNumber( loc)) return "_level" + loc;
    if( this.locIsPath( loc)) return loc;
    if( this.locIsLevel( loc)) return loc;
    if( this.locIsMovieClip( loc)) return TargetPath(loc);
    if( this.locIsLoadableObject( loc)) return loc;
    return null;
}

o.targetToLoc = function(){
    return ( typeof( this.oCurrentItem.target) == 'string') ? eval( this.oCurrentItem.target) : this.oCurrentItem.target;   
}

o.locIsNumber = function( loc){
    return typeof( loc) == 'number';   
}

o.locIsPath = function( loc){
    return typeof(loc) == 'string' && typeof( eval( loc)) == 'movieclip' && ( eval( loc) != _level0 || loc == "_level0");
}

o.locIsLevel = function( loc){
    return loc.indexOf( "_level") == 0 && ! isNaN( loc.substring( 6));   
}

o.locIsMovieClip = function( loc){
    return typeof( loc) == 'movieclip';
}

o.locIsLoadableObject = function( loc){
    //eg. movieclip, sound, xml, loadvars
    return typeof( loc.getBytesTotal) == 'function' && typeof( loc.getBytesLoaded) == 'function';   
}

o.startInterval = function(){
    if ( this.iIntervalId != -1) {
        this.endInterval();
    }
    this.iIntervalId = setInterval( this, "onInterval", this.iIntervalMs);
}

o.endInterval = function(){
    if ( this.iIntervalId != -1) {
        clearInterval(this.iIntervalId);
        this.iIntervalId = -1;
    }
}

o.onInterval = function(){
    var currentLoc = this.targetToLoc();
    if( ! this.checkLocation( currentLoc)) return;
    if( ! this.checkBytesTotal( currentLoc)) return;
    if( ! this.checkBytesLoaded( currentLoc)) return;
    this.endTimeout();
    //
    this.broadcastOnLoadProgress();
    this.checkComplete( currentLoc);   
    this.iCurrentStep++;
};

o.checkLocation = function( poCurrentLoc){
    if( poCurrentLoc == undefined){
        this.broadcastOnLoadProgress();
        return false;
    }
    return true;
}

o.checkBytesTotal = function( poCurrentLoc){
    var iBytesTotal = poCurrentLoc.getBytesTotal();
    if( iBytesTotal < 4){
        this.broadcastOnLoadProgress();
        return false;
    }
    this.iBytesTotal = iBytesTotal;
    return true;
}

o.checkBytesLoaded = function( poCurrentLoc){
    var iBytesLoaded = poCurrentLoc.getBytesLoaded();
    if( iBytesLoaded < 1){
        this.broadcastOnLoadProgress();
        return false;
    }   
    this.iBytesLoaded = iBytesLoaded;   
    return true;
}

o.checkComplete = function( poCurrentLoc){
    if( this.iBytesTotal > 10
    && this.iBytesTotal - this.iBytesLoaded < 10
    && this.iCurrentStep >= this.iMinSteps
    && ( this.funcWaitUntil == null || this.funcWaitUntil( poCurrentLoc))){
        this.endLoading( true);
        return true;
    }
    return false;
}

o.waitUntilPropertiesAreInitialized = function( pMc){
    return pMc._width != undefined && pMc._height != undefined && pMc._visible != undefined && pMc._url != undefined;
}

o.endCurrentLoading = function( pbResult){
    this.broadcastOnLoadComplete( pbResult);
    if( typeof(this.oCurrentItem.oListener) == 'object'){
        this.removeListener(this.oCurrentItem.oListener);
    }
}

o.endLoading = function( pbResult){
    this.endCurrentLoading( pbResult);
    //
    if( this.isQueueEmpty()){
        this.endInterval();   
        this.broadcastOnQueueStop();
    } else {
        this.loadNext();   
    }
}

o.checkIntGreaterZero = function( piValue, piDefaultValue){
    if( piValue == undefined || isNaN( piValue) || piValue <= 0) return piDefaultValue;
    return piValue;
}

delete o;
Avatar billede rafix Nybegynder
15. august 2005 - 15:58 #16
jeg kan heller ikke finde noget der loader xml i de 2 filer.
Avatar billede rafix Nybegynder
16. august 2005 - 08:07 #17
jeg har fundet dette på hjemmesiden for det billedegalleri jeg bruger, men det kan jeg heller ikke bruge vel ? (for det er ift hmtl filen at man kan ændre xml stien)

To Customize XML Data Source
To load XML image data from a different source than the default, modify the xmlDataPath parameter in the HTML document's object and embed tags. The XML data source can be an XML document, or a PHP/ASP script that produces an XML document.

xmlDataPath is an absolute or relative path to an XML data source. Note that relative paths are relative to the HTML document that contains SimpleViewer.
Example:
To load XML data from a PHP script called get_data.php in the sub-folder my_data use this syntax in the object tag:

<param name=FlashVars value="xmlDataPath=my_data/get_data.php">And this syntax in the embed tag:

FlashVars="xmlDataPath=my_data/get_data.php"
Avatar billede _k Nybegynder
16. august 2005 - 09:50 #18
Jo, det løser vel dit problem ok, gør det ikke? Så skal du bare sætte xml-dokumentets sti der. For det hele skal vel i sidste ende køre på samme måde?

Har du fået smidt if-sætningen ind, så din swf bliver loadet korrekt?
Avatar billede _k Nybegynder
16. august 2005 - 13:40 #19
Søg og du skal finde :o) Jeg kiggede lige i fla'en igen, og det viser sig at på sidste lag, ligger der et movieclip i frame 3 kaldet "loaderHolder". Inde i det movieclip findes en frame kaldet "loadXML", og her ligger mindsanten koden for at loade xml'en ind. Det er her du også kan bruge if-sætningen, hvor du så nok skal kalde "_parent.this".
Avatar billede rafix Nybegynder
16. august 2005 - 17:12 #20
nej hvor er du vild! - der var den sku. hehe - fedt fedt fedt!!!

http://www.because-test.dk/kamilla/
prøv og klik på Fashion
kan man styre hvor en loadMovie bliver vist (x,y koordinat) i stedet for som nu hvor den ligger sig oven på det andet der er lavet ?

jeg har hævet point til 200 fordi ... ja den har været ret vildt den hjælp du har givet.
Avatar billede rafix Nybegynder
16. august 2005 - 17:38 #21
done- det er klaret.
tusinde tak for hjælpen!

du skal have point.
Avatar billede _k Nybegynder
16. august 2005 - 20:51 #22
Det ser da total vellykket ud :o)

Og hvis det ikke var det du selv fandt ud af, kan du loade ind i et movieclip i stedet for til en level. Så kan man helt selv styre hvor tingene placeres.

Smider et svar.
Avatar billede rafix Nybegynder
17. august 2005 - 13:20 #23
thanks man :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester