Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Acme

[Resolvido] Alterar diretorio onde flash busca imagens

Recommended Posts

Olá pessoal, comprei um template em flash profissional pronto, e estou tendo umas dúvidas em relação em como mudar o diretório onde as imagens da galeria estao.

 

tipo, a galeria está funfando de boa, porem o flash busca essas imagens na raiz principal, onde estao os arquivos .php, .swf, .html etc

e eu gostaria de organizar melhor, criar uma pasta de imagens, e minha galeria ir buscar essas imagens dentro desta pagina, tentei fazer algumas alteçoes no XML onde o flash busca o nome da imagem, mas nao deu certo.

 

Entao vamos la, para enteder melhor, encontrei no AC do meu flash q as imagens e qualquer arquivo q o flash buscar, tem q começar com "tfile", como podem ver no codigo abaixo;

 

Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "tfile";
import gs.dataTransfer.XMLParser;
stop();
var parsed_obj = {};
//We'll use this to hold the parsed xml object (once the XML loads and gets parsed successfully).
XMLParser.load(url+"_main.xml", onFinish, parsed_obj);
function onFinish(success_boolean, results_obj, xml) {
    //This fhunction gets called as soon as the XML loads and gets parsed.
    if (success_boolean) {
        play();
    }
}
stop();
no caso, é a linha "url= "tfile"; e logo abaixo, pode se ver q busca o arquivo xml como "url+"_main.xml"", entao no meu diretocio raiz, o meu arquivo xml tem o nome de "tfile_main.xml". até ai beleza, ta funfando de boa e talz

ja no meu xml para buscar a imagem tem esse comando aqui

 

<image imageUrl="_gallery_big_pic14.png" />

entao o arquivo de imagem na raiz do meu site está com o nome de "tfile_gallery_big_pic14.png", porém como eu disse as imagens estao na raiz do site, gostaria de colocar em uma pasta separada, como exemplo uma pasta chamada IMG

tentei mudar o codigo no xml para <image imageUrl="img/_gallery_big_pic14.png" /> e nao deu certo...

=\

 

ai pesquisando no .fla onde se encontra a imagem, achei este codigo

 

onClipEvent (load) {
    num = 1;
    num2 = num+71;
    imageProperties = _root.getCurrentImageName_splash(num2);
    loadMovie(_root.url+imageProperties['name'], this.cont.pic);
    url = imageProperties['linkToOpen'];
    targetWindow = imageProperties['target'];
}
pelo q eu entendi, está buscando no "_root" q seria a raiz do site, até tentei colocar a pasta IMG, mas deu erro e nao abriu nada

 

ficou meio complicado?

tentei explicar td certinho, mas enfim, alguem poderia me falar como eu faço para as imagens buscarem em uma pasta diferente??

 

desde ja agradeço a todos

Compartilhar este post


Link para o post
Compartilhar em outros sites

entao berseck, como eu disse, eu ate tentei fazer isso ai q você falou, colocar exatamente como você fez, mas nao deu certo, por isso coloquei o codigo do AC onde parece q ele busca somente na pasta "_root", q seria a raiz do site.

 

mt tenso isso, da pra ficar assim, porem eu queria algo mais organizado, pq é uma galeria de fotos, ai a raiz fica mt "poluida", pois todos os arquivos estao misturados, os arquivos de flash, php e as dezenas de imagens.

 

msm assim obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom o que você entendeu ta errado

 

_root para o flash é o STAGE em AS 2.0

 

 

E as fotos que ele ta procurando é na pasta root porque o XML não indica um caminho para foto

Se você colocar uma pasta images

 

E fazer no XML

<image imageUrl="./images/_gallery_big_pic14.png" />

 

Ele vai encontrar a pasta images e depois vai buscar a foto que você procura.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

hmmm, entao do root deve ser isso msm, nao sou mt bom em flash e AC

=\

 

mas eu tb penssei isso si do xml, e nao deu msm, na teoria era pra dar certo, informar o diretorio para buscar, e nao vai nem com reza, tanto é, q tentei colocar um link tb no xml, exemplo

www.meusite.com.br/imagem.jpg

e nao deu certo tb

ta tenso isso viu

 

mt obrigado até agora

;]

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom se ele não ta abrindo nem com a URL absoluta no XML

Pode significar 2 coisas

 

1 - Ele não ta encontrando o XML

2 - A declaração da variavel que ta recendo a informação do XML está errada

 

 

Verifique se o indice e ele coloca na array para pegar a imagem do XML ta correta e corresponde a uma imagem

Utilize trace()

 

Pelo seu script para descobrir onde que está o problema.

 

Se o script funcionava antes de você alterar... verifique o que você alterou... pois você deve ter feito bobagem :)

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

nao, tipo, o xml está funfando de boa, esta carregando ele certinho.

porem, ele so busca as imagens se estiver na pasta raiz do site, se eu tentar buscar a imagem fora da pasta raiz, ele nao busca, este é o problema, como eu disse, eu comprei este template, e ele veio pronto pra mim, eu so traduzi e mechi no que eu precisava, eu até tentei mudar o orignal em ingles mesmo, ele também nao busca imagem em outro lugar sem ser a raiz, por isso acho q deve ser algo relacionado ao AS do .fla, deve ter algo q está impedindo isso, uma linha sei la, igual citei acima sobre ele ler apenas arquivos que comece com "tfile_", isso eu achei onde fica no AS, mas essa das imagens, está sendo uma dor de cabeça.

Se eu deixar as imagens na raiz, funciona de boa, mas eu gostaria de algo mais organizado, pq é uma galeria de imagens, e tem temas, cada tema vai 48 arquivos de fotos, das thumbs a imagem padrao, se eu deixar na raiz vai ficar mt "poluido", até msm pra qnd precisar fazer alterações em um tema vai ser complicado achar as imagens certar para substituir.

 

agradeço sua ajuda até o momento

Compartilhar este post


Link para o post
Compartilhar em outros sites

Sem o código completo do AS

Vai ser impossivel detectar onde ta o problema

 

Verifique como já disse com trace() antes de todos loadMovie ou loadClip

Para saber qual é a url que ele ta tentando abrir com 1 dos 2...

 

Se ele troca a informação sei lá... sem o script não tenho como adivinhar o que os caras fazem nessas templates.

Tem muita porcaria na web que o povo ganha dinheiro... por parecer bunitinho.

 

É bunitinho para ver, mas uma M* para editar.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

tp, o q ta relacionado ao xml, é isso aki

 

Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "tfile";
import gs.dataTransfer.XMLParser;
stop();
var parsed_obj = {};
//We'll use this to hold the parsed xml object (once the XML loads and gets parsed successfully).
XMLParser.load(url+"_main.xml", onFinish, parsed_obj);
function onFinish(success_boolean, results_obj, xml) {
    //This fhunction gets called as soon as the XML loads and gets parsed.
    if (success_boolean) {
        play();
    }
}
stop();
//var gallery_obj = {}; //We'll use this to hold the parsed xml object (once the XML loads and gets parsed successfully).
//XMLParser.load(url+"_gallery.xml", onFinish, gallery_obj);
_root.emp.useHandCursor = 0;
///forplayer
_root.mus = 1;
_root.n = 1;
_root.num = 1;

tai todo o codigo onde ele busca o xml, e sobre ele

agora q fui ver, te isso ai do "_gallery.xml", porem nao tem esse arquivo ai, nao veio isso ae, poderia ser isso ai q contenha algumas configuração?

vi q ela está comentado, mas deve funfar algo nao?

ai ai, to vendo q vou ter q deixar isso td desorganizado, q triste

=p

 

EDIT:

pesquisando todos os arquivos, encontrei em uma das pastas q veio, tem um arquivo do AS separado, o "xmlFunctions.as", veja o tem nele por favor, talvez possa estar configurado aqui

 

var mainObj = _root.parsed_obj;
var galleryObj = _root.gallery_obj;
function textSelectable(selectedObject) {
    isTextSelected = getSettingsValue(mainObj, "textSelectable", "item");
    if (isTextSelected == "true") {
        selectedObject.selectable = true;
    }
}
function getXmlSection(obj, itemName, sectionName) {
    i = 0;
    while (obj[itemName][i]) {
        if (obj[itemName][i].name == sectionName) {
            returnedResult = true;
            return (i);
            break;
        }
        i++;
    }
}
function getSettingsValue(obj, itemName, itemType) {
    sectionNum = getXmlSection(obj, "section", "settings");
    k = 0;
    while (obj["section"][sectionNum][itemType][k]) {
        if (obj["section"][sectionNum][itemType][k].name == itemName) {
            return (obj.section[sectionNum][itemType][k].value);
            break;
        }
        k++;
    }
}
function getCopyright(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "copyright", "item");
    textSelectable(textObj);
}
function getCompanyName(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "companyName", "item");
    textSelectable(textObj);
}
function getSlogan(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "slogan", "item");
    textSelectable(textObj);
}
function getMenuGallery1(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "name1", "item");
    textSelectable(textObj);
}
function getMenuGallery2(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "name2", "item");
    textSelectable(textObj);
}
function getMenuGallery3(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "name3", "item");
    textSelectable(textObj);
}
function getBetweenText(textObj) {
    textObj.htmlText = getSettingsValue(mainObj, "betweenText", "item");
    textSelectable(textObj);
}
function getSystemValue(textObj, systemOptionName) {
    textObj.htmlText = getSettingsValue(mainObj, systemOptionName, "item");
    textSelectable(textObj);
}
function getMenuLink(textObj, linkNum) {
    sectionNum = getXmlSection(mainObj, "section", "menu");
    textObj.htmlText = mainObj["section"][sectionNum].link[linkNum].value;
    textSelectable(textObj);
}
function getMenuSystemOrder(linkNum) {
    sectionNum = getXmlSection(mainObj, "section", "menu");
    return (mainObj["section"][sectionNum].link[linkNum].systemOrder);
}
function getCurrentText(textObj, textNumber) {
    sectionNum = getXmlSection(mainObj, "section", "pages");
    currentPage = _root.link-_root.firstPageFrame;
    textObj.htmlText = mainObj["section"][sectionNum]["page"][currentPage]["texts"][0]["pageText"][textNumber].value;
    textSelectable(textObj);
}
function getMenuPreviousLink(linkNum) {
    k = 0;
    systemOrder = getMenuSystemOrder(k);
    while (systemOrder) {
        if (systemOrder == linkNum) {
            orderResult = k+1;
            break;
        }
        k++;
        systemOrder = getMenuSystemOrder(k);
    }
    return (orderResult);
}
function getCurrentImageName(imageNumber) {
    sectionNum = getXmlSection(mainObj, "section", "pages");
    currentPage = _root.link-_root.firstPageFrame;
    imageParams = new Array();
    imageParams['name'] = mainObj["section"][sectionNum]["page"][currentPage]["image"][imageNumber]["imageUrl"];
    imageParams['linkToOpen'] = mainObj["section"][sectionNum]["page"][currentPage]["image"][imageNumber]["link"];
    imageParams['target'] = mainObj["section"][sectionNum]["page"][currentPage]["image"][imageNumber]["target"];
    return (imageParams);
}
function getCurrentImageName_splash(imageNumber) {
    sectionNum = getXmlSection(mainObj, "section", "settings");
    imageParams = new Array();
    imageParams['name'] = mainObj["section"][sectionNum]["image"][imageNumber]["imageUrl"];
    imageParams['linkToOpen'] = mainObj["section"][sectionNum]["image"][imageNumber]["link"];
    return (imageParams);
}
function checkLinkType(linkTextType, linkNumber) {
    k = 0;
    typeCount = 0;
    finalLinkNumber = parseInt(linkNumber)+1;
    currentPage = _root.link-_root.firstPageFrame;
    sectionNum = getXmlSection(mainObj, "section", "pages");
    linkTypeCkeck = mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
    while (linkTypeCkeck) {
        if (linkTypeCkeck == linkTextType) {
            typeCount++;
        }
        if (typeCount == finalLinkNumber) {
            return (k);
            break;
        }
        k++;
        linkTypeCkeck = mainObj["section"][sectionNum]["page"][currentPage]["link"][k]["linkType"];
    }
}
_root.readMoreFrameType = 'readmore';
function more_click_func(number) {
    tempNumber = number.split(" ");
    number = tempNumber.join("");
    number = number.toLowerCase();
    itemNumber = _root.pagesReadMoreFrame;
    currentPage = _root.link-_root.firstPageFrame;
    if (isNaN(Number(number))) {
        readMoreType = number;
    } else {
        readMoreType = 'readmore';
    }
    if ((_root.link<>itemNumber || _root.readMoreFrameType != readMoreType) and _root.animation == 1) {
        _root.animation = 0;
        _root.link_prev = _root.link;
        if (_root.link<>5) {
            _root.menu["item"+getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
            _root.menu2["item"+getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
        }
        if (number == 'privacypolicy') {
            _root.readMoreFrameType = 'privacypolicy';
            sectionNum = getXmlSection(mainObj, "section", "privacyPolicy");
            titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
            textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
            _root.readMoreTitle = mainObj.section[sectionNum]["item"][titleNum].value;
            _root.readMoreText = mainObj.section[sectionNum]["item"][textNum].value;
        } else if (number == 'termsofuse') {
            _root.readMoreFrameType = 'termsofuse';
            sectionNum = getXmlSection(mainObj, "section", "termsOfUse");
            titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
            textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
            _root.readMoreTitle = mainObj.section[sectionNum]["item"][titleNum].value;
            _root.readMoreText = mainObj.section[sectionNum]["item"][textNum].value;
        } else {
            _root.readMoreFrameType = 'readmore';
            sectionNum = getXmlSection(mainObj, "section", "pages");
            linkCount = checkLinkType("readMoreLink", number);
            i = 0;
            linkTitleNum = getXmlSection(mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount], "item", "title");
            linkTextNum = getXmlSection(mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount], "item", "linkText");
            _root.readMoreTitle = mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount]["item"][linkTitleNum].value;
            _root.readMoreText = mainObj["section"][sectionNum]["page"][currentPage]["link"][linkCount]["item"][linkTextNum].value;
        }
        _root.link = itemNumber;
        _root.play();
    }
}
function getContactFormText(textObj, textNumber) {
    sectionNum = getXmlSection(mainObj, "section", "contactForm");
    textObj.htmlText = mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value;
    textSelectable(textObj);
}
function getContactFormText_only(textNumber) {
    sectionNum = getXmlSection(mainObj, "section", "contactForm");
    return htmlText=mainObj["section"][sectionNum]["texts"][0]["pageText"][textNumber].value;
}
function getContactFormParams() {
    sectionNum = getXmlSection(mainObj, "section", "contactForm");
    ContactFormParams = new Array();
    servNum = getXmlSection(mainObj["section"][sectionNum], "item", "serverOption");
    recNum = getXmlSection(mainObj["section"][sectionNum], "item", "recipient");
    ContactFormParams['rec'] = mainObj["section"][sectionNum]["item"][recNum].value;
    ContactFormParams['serv'] = mainObj["section"][sectionNum]["item"][servNum].value;
    return (ContactFormParams);
}
// gallery functions
function getGallerySystemProperty(propName) {
    sectionNum = getXmlSection(galleryObj, "section", "systemOptions");
    propNum = getXmlSection(galleryObj["section"][sectionNum], "option", propName);
    return (galleryObj["section"][sectionNum]["option"][propNum].value);
}
function getGallerySettings(propName) {
    sectionNum = getXmlSection(galleryObj, "section", "settings");
    propNum = getXmlSection(galleryObj["section"][sectionNum], "option", propName);
    return (galleryObj["section"][sectionNum]["option"][propNum].value);
}
function getGalleryImage(imageNum, categoryNum) {
    sectionNum = getXmlSection(galleryObj, "section", "imagesData");
    imageParams = new Array();
    image = galleryObj["section"][sectionNum]["category"][categoryNum]["image"][imageNum];
    nameNum = getXmlSection(image, "item", "imageUrl");
    commentNum = getXmlSection(image, "item", "imageComment");
    imageParams['name'] = image['item'][nameNum].value;
    imageParams['comment'] = image['item'][commentNum].value;
    return (imageParams);
}
function getCurrentGalleryName(categoryNum) {
    sectionNum = getXmlSection(galleryObj, "section", "imagesData");
    return (galleryObj["section"][sectionNum]["category"][categoryNum].name);
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cade esse AS aqui:gs.dataTransfer.XMLParser;

 

Ele ta na pasta gs/dataTransfer/XMLParser.as

Mas continuo dúvidando muito que o cara tenha feito algo só ler o root sempre.

 

Se ele se deu ao trabalho de construir classes etc...

Ele fez algo que basta trocar a url do XML aposntando para as fotos que deve vir tudo corretamente.

 

Mas vai saber né?

 

E você ainda n respondeu

Se você colocar a foto

 

http://www.meusite.com/gallery/foto.jpg

 

No XML ele vai encontrar a foto e abrir?

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Primeiramente, me desculpem a demora para resposta, tive problemas com minha internet...

Ola Thiago, mt obrigado por tentar ajudar.... vamos la

 

aqui está o codigo do arquivo XMLPaerser.as

 

/*
VERSION: 3.2
DATE: 3/23/2007
DESCRIPTION: 
     This class provides an easy way to load and/or send an XML file and parse the data into a format that's simple 
     to work with. Every node becomes an array with the same name. All attributes are also easily accessible because 
     they become properties with the same name. So for example, if this is your XML:
     
        <Resources>
            <Book name="Mary Poppins" ISDN="1122563" />
            <Book name="The Bible" ISDN="333777" />
            <Novel name="The Screwtape Letters" ISDN="257896">
                <Description>This is an interesting perspective</Description>
            </Novel>
        </Resources>
     
     Then you could access the first book's ISDN with:
     
         Book[0].ISDN
     
     The value of a node (like the text between the <Description> and </Description> tags above can
     be accessed using the "value" property, like so:
     
         Novel[0].Description[0].value
     
     Just remember that all nodes become arrays even if there's only one node, and attributes become properties. 
     You can obviously loop through the arrays too which is very useful. The root node is ignored for efficiency 
     (less code for you to write).

EXAMPLE: 
    To simply load a "myDocument.xml" document and parse the data into ActionScript-friendly values, do:
    
        import gs.dataTransfer.XMLParser;
        var parsed_obj = new Object(); //This will hold the parsed xml data (once the XML loads and gets parsed).
        XMLParser.load("myDocument.xml", onFinish, parsed_obj);
        function onFinish(success_boolean, results_obj, xml) { //This function gets called when the XML gets parsed.
            if (success_boolean) {
                trace("The first book is: "+results_obj.Book[0].name);
            }
        }
        
    Or to send an object to the server in XML format (remember, each element in an array becomes a node and all 
    object properties become node attributes) and load the results back into an ActionScript-friendly format, do:
    
        import gs.dataTransfer.XMLParser;
        //Create an object to send an populate it with values...
        var toSend_obj = new Object();
        toSend_obj.name = "Test Name";
        toSend_obj.Book = new Array();
        toSend_obj.Book.push({title:"Mary Poppins", ISDN:"125486523"});
        toSend_obj.Book.push({title:"The Bible", ISDN:"25478866998"});
        //Now send the data and load the results from the server into the response_obj...
        var response_obj = new Object(); //We'll use this to hold the parsed xml response.
        XMLParser.sendAndLoad(toSend_obj, "http://www.myDomain.com/myScript.php", onFinish, response_obj);
        function onFinish(success_boolean, results_obj, xml) {
            if (success_boolean) {
                trace("The server responded with this XML: "+xml);
                trace("The server's response was translated into this ActionScript object: "+results_obj);
            }
        }
        
        In the example above, the server would receive the following XML document:
        
        <XML name="Test Name">
            <Book ISDN="125486523" title="Mary Poppins" />
            <Book ISDN="25478866998" title="The Bible" />
        </XML>
    
NOTES:
    - It is case sensitive, so if you run into problems, check that.
    - The value of any text node can be accessed with the "value" property as mentioned above.
    - A valid XML document requires a single root element, so in order to consolidate things,
      That root will be ignored in the resulting arrays. So if your root element is <Library>
      and it has <Book> nodes, you don't have to access them with Library[0].Book[0]. You can 
      just do Book[0].
    - You can simply translate an object into XML (without sending it anywhere) using the 
      XMLParser.objectToXML(my_obj) function which returns an XML instance.
        
CODED BY: Jack Doyle, jack@greensock.com
*/
import mx.utils.Delegate;

class gs.dataTransfer.XMLParser {
    static var CLASS_REF = gs.dataTransfer.XMLParser;
    private static var _parsers_array:Array;
    private var _url_str:String;
    private var _onComplete_func:Function;
    private var _xml:XML;
    private var _results_obj:Object;
    var parse:Function; //Just for backward compatibility. It's essentially an alias pointing to the initLoad() function.
    
    function XMLParser() {
        parse = initLoad; //Just for backward compatibility. It's essentially an alias pointing to the initLoad() function.
        if (_parsers_array == undefined) {
            _parsers_array = [];
        }
        _parsers_array.push(this);
    }
    
    static function load(url_str:String, onComplete_func:Function, results_obj:Object):XMLParser {
        var parser_obj = new XMLParser();
        parser_obj.initLoad(url_str, onComplete_func, results_obj);
        return parser_obj;
    }
    
    static function sendAndLoad(toSend_obj:Object, url_str:String, onComplete_func:Function, results_obj:Object):XMLParser {
        var parser_obj = new XMLParser();
        parser_obj.initSendAndLoad(toSend_obj, url_str, onComplete_func, results_obj);
        return parser_obj;
    }
    
    
    function initLoad(url_str:String, onComplete_func:Function, results_obj:Object) {
        if (results_obj == undefined) {
            results_obj = {};
        }
        _results_obj = results_obj;
        _url_str = url_str;
        _onComplete_func = onComplete_func;
        _xml = new XML();
        _xml.ignoreWhite = true;
        _xml.onLoad = Delegate.create(this, this.parseLoadedXML);
        _xml.load(_url_str);
    }
    
    function initSendAndLoad(toSend_obj:Object, url_str:String, onComplete_func:Function, results_obj:Object) {
        if (results_obj == undefined) {
            results_obj = {};
        }
        _results_obj = results_obj;
        _url_str = url_str;
        _onComplete_func = onComplete_func;
        if (toSend_obj instanceof XML) {
            var xmlToSend_obj = toSend_obj;
        } else {
            var xmlToSend_obj = XMLParser.objectToXML(toSend_obj);
        }
        _xml = new XML();
        _xml.ignoreWhite = true;
        _xml.onLoad = Delegate.create(this, this.parseLoadedXML);
        xmlToSend_obj.sendAndLoad(_url_str, _xml);
    }
    
    
    function searchAndReplace(holder, searchfor, replacement) {
    var temparray = holder.split(searchfor);
    var holder = temparray.join(replacement);
    return (holder);
    }
    
    
    private function parseLoadedXML(success_boolean) {
        if (success_boolean == false) {
            trace("XML FAILED TO LOAD! ("+_url_str+")");
            _onComplete_func(false);
            return;
        }
        var x = this._xml;
        var c = x.firstChild.firstChild; //"c" is for current_node
        var last_node = x.firstChild.lastChild;
        x.firstChild.obj = _results_obj; //Allows us to tack on all the arrays and objects to this instance for easy retrieval by the user. If this causes a problem, we could create a public object variable that holds everything, but this simplifies things for the user.
        while(c != undefined) {
            //We ran into an issue where Flash was creating an extra subnode anytime we had content in a node like <NODE>My Content</NODE>. The tip off is when the nodeName is null and the nodeType is 3 (text).
            if (c.nodeName == null && c.nodeType == 3) {
                c.parentNode.obj.value = searchAndReplace(c.nodeValue, '\r\n', '');
            } else {
                var o = {};
                for (var att in c.attributes) {
                    o[att] = c.attributes[att];
                }
                var pn = c.parentNode.obj;
                if (pn[c.nodeName] == undefined) {
                    pn[c.nodeName] = [];
                }
                c.obj = o;
                pn[c.nodeName].push(o);
            }
            
            if (c.childNodes.length > 0) {
                c = c.childNodes[0];
            } else {
                var next_node = c;
                while(next_node.nextSibling == undefined && next_node.parentNode != undefined) {
                    next_node = next_node.parentNode;
                }
                c = next_node.nextSibling;
                if (next_node == last_node) {
                    c = undefined;
                }
            }
        }
        _onComplete_func(true, _results_obj, x);
    }
    
    //Allows us to translate an object (typically with arrays attached to it) back into an XML object. This is useful when we need to send it back to the server or save it somewhere.
    public static function objectToXML(o:Object, rootNodeName_str:String):XML {
        if (rootNodeName_str == undefined) {
            rootNodeName_str = "XML";
        }
        var xml:XML = new XML();
        var n:XMLNode = xml.createElement(rootNodeName_str);
        var props = [];
        var prop;
        for (var p in o) {
            props.push(p);
        }
        for (var p = props.length - 1; p >= 0; p--) { //By default, attributes are looped through in reverse, so we go the opposite way to accommodate for this.
            prop = props[p];
            if (typeof(o[prop]) == "object" && o[prop].length > 0) { //Means it's an array!
                arrayToNodes(o[prop], n, xml, prop);
            } else if (prop == "value") {
                var tn:XMLNode = xml.createTextNode(o.value);
                n.appendChild(tn);
            } else {
                n.attributes[prop] = o[prop];
            }
        }
        xml.appendChild(n);
        return xml;
    }
    
    //Recursive function that walks through any sub-arrays as well...
    private static function arrayToNodes(ar:Array, parentNode:XMLNode, xml:XML, nodeName_str:String):Void {
        var chldrn = [];
        var props:Array;
        var prop;
        var n:XMLNode;
        var o:Object;
        for (var i = ar.length - 1; i >= 0; i--) {
            n = xml.createElement(nodeName_str);
            o = ar[i];
            props = [];
            for (var p in o) {
                props.push(p);
            }
            for (var p = props.length - 1; p >= 0; p--) { //By default, attributes are looped through in reverse, so we go the opposite way to accommodate for this.
                prop = props[p];
                if (typeof(o[prop]) == "object" && o[prop].length > 0) { //Means it's an array!
                    arrayToNodes(o[prop], n, xml, prop);
                } else if (prop != "value") {
                    n.attributes[prop] = o[prop];
                } else {
                    var tn:XMLNode = xml.createTextNode(o.value);
                    n.appendChild(tn);
                }
            }
            chldrn.push(n);
            //parentNode.appendChild(n);
        }
        for (var i = chldrn.length - 1; i >= 0; i--) {
            parentNode.appendChild(chldrn[i]);
        }
    }
    
    public function destroy():Void {
        delete _xml;
        for (var i = 0; i < _parsers_array.length; i++) {
            if (this == _parsers_array[i]) {
                _parsers_array.splice(i, 1);
            }
        }
        destroyInstance(this);
    }
    
    static function destroyInstance(i:XMLParser):Void {
        delete i;
    }
    
//---- GETTERS / SETTERS --------------------------------------------------------------------
    static function get active_boolean():Boolean {
        if (_parsers_array.length > 0) {
            return true;
        } else {
            return false;
        }
    }
    
}

e referente a sua pergunta, eu expliquei acima q nem mesmo se eu usar o http://www.meusite.c...allery/foto.jpg no xml ele busca a imagem, isso que achei estranho mais ainda, foi por ai q vi q tinha algo errado, porque realmente era pra puchar a imagem até msm se eu informar um link q contenha a img, e isso nao acontece, da o msm erro, a imagem nao carrega

Compartilhar este post


Link para o post
Compartilhar em outros sites

OK

 

Em nenhum dos arquivos eu detectei erro algum...

 

Agora aqui:

function onfinish(success_boolean, results_obj, xml) {
 //This fhunction gets called as soon as the XML loads and gets parsed.
 if (success_boolean) {
 play();
 }
}

Você ta dando play.

 

E achei que aqui:

 

tem um erro de execução:

num = 1;
 num2 = num+71;
 imageProperties = _root.getCurrentImageName_splash(num2);
 loadMovie(_root.url+imageProperties['name'], this.cont.pic);
 url = imageProperties['linkToOpen'];
 targetWindow = imageProperties['target'];

Você ta chamando a variavel URL e alterando a informação dela depois de ter usaado ela já acima!!!

 

Então faça o seguinte troque esse loadMovie por esse:

num = 1;
num2 = num+71;
imageProperties = _root.getCurrentImageName_splash(num2);
loadMovie(imageProperties['name'], this.cont.pic);
url = imageProperties['linkToOpen'];
targetWindow = imageProperties['target'];

E verifique se ele ainda ta mantendo o erro ;)

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ae Thiago, tu é bom msm cara, realmente trocando o loadmovie para o q você informou deu certo, está buscando agora na pasta que eu informar e tb em algum link q informar, esta funcionando como deveria...

poreeeeeemmmmmm... este codigo q eu lhe enviei é do preview, uma imagem menor(thumbs), mas nem ela antigamente funcionava como eu queria, e mudando o q você falou funcionou..

agora é so achar o AS da imagem maior e mudar isso tb correto?

o problema q to procurando aqui e nao acho onde esta o AS da imagem maior(full)...

 

mas ja é praticamente 90% caminho andado, apartir do momento q eu encontrar onde fica e mudar, irá dar certo

 

Nao tenho como lhe agradecer meu amigo, serio mesmo, você foi o unico q me ajudou desde o começo, e notei desde entao q você realmente entende do que fala, mt obrigado mais uma vez...

 

 

agora a briga é achar o AS da imagem maior

=p

 

usei o Ctrl+F e mandei substituir tds

loadMovie(_root.url+imageProperties['name'], this.cont.pic);
por

loadMovie(imageProperties['name'], this.cont.pic);
e deu certo, TODAS as imagens do site agora esta buscando direto onde eu mando, do jeito que eu quiser, criei pastas dentro de pastas e coloquei o arquivo e mandei buscar no XML e deu certo, e tb com link em um site...

 

so notei q no XML tive q setar o nome inteiro, antes era "_imagem.jpg", ai tive q mudar para "tfile_imagem.jpg" q na verdade é o nome na pasta da imagem, mas é pq tirou no AS onde buscava a url root "tfile".

 

no fim das contas o root tava atrapalhando msm, como achei q era desde o começo, mas todo o mérito é seu Thiago, sem você eu nunca iria conseguir fazer isso, pq afinal eu nem sabia q podia remover akele comando, pra mim poderia parar toda a compilação.

;]

 

mas uma vez mt obrigado meu amigo, pode trancar o topico

 

 

RESOLVIDO

Compartilhar este post


Link para o post
Compartilhar em outros sites

Opa por nada ;)

 

Que bom que solucionou.

 

Eu precisava do código "completo" para ter certeza que não teria mais nada que fosse conflitar com essa alteração

Mas como não tinha ;) essa foi a solução

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.