Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou criando umas espécie de site com várias apostilas http://www.airtongomes.com.br/acervoeletronico que antes era http://acervoeletronico.googlepages.com mas o meu problema é o seguinte, eu quero colocar uma área onde as pessoas possam colocar suas apostilas ou pelomenos o link então por exemplo na parte de apostilas de eletronica estou usando o seguinte código para pegar os dados do xml:
import mx.controls.*;
import mx.containers.*;
import mx.controls.gridclasses.DataGridColumn;
this.createClassObject(Tree, "tree", 0, {_x:2, _y:42});
this.tree.setSize(830, 638);
var apostilas:XML = new XML();
apostilas.ignoreWhite = true;
apostilas.onLoad = function(success:Boolean) {
if (success) {
tree.dataProvider = this.firstChild;
} else {
trace("unable to load/parse library.xml");
}
};
apostilas.load("../apostilas/eletronica.xml");
var treeListener:Object = new Object();
treeListener.change = function(evt:Object) {
var selectedIt:XMLNode = evt.target.selectedNode;
if (evt.target.getIsBranch(selectedIt)) {
evt.target.setIsOpen(selectedIt, !evt.target.getIsOpen(selectedIt), true);
} else {
playlist.playlist_dg.addItem({title:selectedIt.attributes['label'], artist:selectedIt.attributes['artist'], length:selectedIt.attributes['length'], track:selectedIt.attributes['track'], album:selectedIt.attributes['album'], cover:selectedIt.attributes['cover'], src:selectedIt.attributes['src']});
updatePlaylistStats();
}
};
tree.addEventListener("change", treeListener);
this.tree.setStyle("fontFamily", this.test_text.getTextFormat().font);
this.tree.setStyle("fontSize", this.test_text.getTextFormat().size)
this.tree.setStyle("embedFonts", this.test_text.embedFonts)
this.tree.setStyle("fontWeight", this.test_text.getTextFormat().bold ? "bold" : "normal")
this.tree.setStyle("depthColors", [0xF6F6F6,0xF6F6F6,0xF6F6F6,0xF6F6F6,0xF6F6F6,0xF6F6F6]);
this.tree.setStyle("backgroundColor",0xF4F4F4F4);
this.tree.setStyle("borderStyle", "none");
this.tree.setStyle("color",0x000000);
this.tree.setStyle("textIndent",0);
this.tree.setStyle("textMultiline", "true");
this.tree.setStyle("textHTML", "true");
this.tree.setStyle("indentation",2);
this.tree.setStyle("rollOverColor",0xF6F6F6);
this.tree.setStyle("selectionColor", 0xC5C5C5);
this.tree.setStyle("selectionDuration",0);
this.tree.setStyle("textRollOverColor", 0x000000);
this.tree.setStyle("textSelectedColor",0x000000);
this.tree.setStyle("defaultLeafIcon", "nullicon");
this.tree.setStyle("folderOpenIcon", "nullicon");
this.tree.setStyle("folderClosedIcon", "nullicon");
this.tree.hScrollPolicy = "off";
this.tree.vScrollPolicy = "on";
this.tree.setStyle("lineColor", 0x000000);
this.tree.setStyle("lineAlpha", 20);
var treeListener:Object = new Object();
treeListener.change = function(evt:Object) {
var treeNode:XMLNode = evt.target.selectedItem;
//se algum item for clicado no componente tree
if (treeNode.attributes.src != undefined) {
//carregue pra dentro do componente loader
getURL(treeNode.attributes.src,"_blank");
}
};
tree.addEventListener("change", treeListener);
e o xml:
<node label=" Menu">
<node label=" Geral">
<node label=" Apostila de Eletrônica Básica 2000." src="home.html" />
<node label=" Apostila Básica sobre Osciloscópio." src="home.html" />
<node label=" Eletrônica Básica 1." src="home.html" />
<node label=" Eletrônica Básica 2." src="home.html" />
<node label=" Como corroer placas." src="home.html" />
<node label=" Eletrônica cap2." src="home.html" />
<node label=" Eletrônica cap4." src="home.html" />
<node label=" Eletrônica cap5." src="home.html" />
<node label=" Manual do Proteus Fotolite." src="home.html" />
<node label=" Manual do Proteus 1." src="home.html" />
<node label=" Manual do Proteus 2." src="home.html" />
<node label=" Proteus VSM 4." src="home.html" />
<node label=" Tunning de carros e caixas acústicas." src="home.html" />
</node>
</node>
Eu até achei no help do flash mas não entendi como eu vou usar isso no meu caso (lembrando que eu preciso adicionar o label e o src)
createTextNode(value: String) : XMLNode
Creates a new XML text node with the specified text.
E como eu faria para fazer upload de algum arquivo? Dá para usar o dundasupload com o flash?
Agradeço desde já!
Carregando comentários...