SCROLL HTML c/ IMG
Estou usando o componente Scroll Bar do Flash.
O mesmo funciona corretamente para textos, porém quando insiro uma imagem, através de comandos HTML, a imagem é carregada porém o scroll não identifica a altura da imagem e consequentemente o scroll funciona pela metade.
Abaixo o código para análise
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
function DisplayInfo(){
infobox_mc.titulo_txt.text = this.titulo_txt;
infobox_mc.data_not_txt.text = this.data_not_txt;
infobox_mc.content_txt.htmlText = this.corpo_text;
/// Criando componentes da barra de rolagem
var scrollTxt = new MDScroll(infobox_mc.rTxt,infobox_mc.content_txt);
scrollMc.init();
scrollTxt.init(true);
}
// define basic variables for setting up the menu
var item_spacing = 20; // how far menu items are spaced veritcally
var item_count = 0; // counts menu items as they are added from the XML
var item_total = 99999; // Determina a quantidade de links que devem ser exibidos
// CreateMenu creates a menu based on the XML object passed.
// It loops through all the items with a for loop adding clips to the menu_mc
// movieclip on the timeline, defining the appropriate text where needed
function CreateMenu(menu_xml){
// start with the first item in the XML
var items = menu_xml.firstChild.firstChild.childNodes; // menu -> menuitems -> child nodes array
for (var i=0; i<items.length; i++) {
// Nao exibi links se a quantidade de exibidos for igual a quantidade permetida
if (item_count <> item_total) {
// only continue if the type of this item is a noticia
if (items*.attributes.type == "noticia") { *
// create variables for our elements
* var titulo = items**.firstChild; // same as items**.childNodes[0]*
* var data_not = items**.childNodes[1]; // second child node*
* var corpo = items**.childNodes[2]; // third child node*
// Create a menu item movie clip in the menu_mc instance on the main timeline
// for each item element offsetting each additional further down the screen
var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
item_mc._y = item_count item_spacing;*
item_count++;
// assign text using nodeValue to get the text
// Exibindo menu
item_mc.titulo_txt.text = titulo.firstChild.nodeValue;
item_mc.data_not_txt.text = data_not.firstChild.nodeValue;
// Guardando os dados para exibir apos o clique
item_mc.main_btn.titulo_txt = titulo.firstChild.nodeValue;
item_mc.main_btn.data_not_txt = data_not.firstChild.nodeValue;
item_mc.main_btn.corpo_text = corpo.firstChild.nodeValue;
// set the onRelease of the item button to the DisplayInfo function
item_mc.main_btn.onRelease = DisplayInfo;
}
}
}
}
// manage XML
// create new XML object instance, remembering to ignore white space
var noticia_xml = new XML();
noticia_xml.ignoreWhite = true;
// define an onLoad to create our corpo menu when the XML has successfully loaded.
noticia_xml.onLoad = function(success){
if (success) CreateMenu(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load the xml file!
noticia_xml.load("noticias.xml");
Discussão (2)
Carregando comentários...