Ciao Filippo, ho bisogno di te 
Ho un problema con del testo da caricare, mi spiego subito, sto lavorando al mio sito con l'ottimo
tutorial delle sezioni e soprattutto di lavorare con poche document class, il mio sogno sarebbe quello di averne una sola
, ma andiamo al mio problema ho impostato per mie esigenze 4 sezioni anzicchè 5
sulla 1a tutto ok, mentre nella seconda, prendendo spunto da quest'altro meraviglioso tutorial:
qui che ho unificato in una sola DC .as quando vado a caricare il testo mi appare subito insieme al home page, ho provato anche a racchiuderlo in una cornice mc ma nulla, ho meglio la cornice sparisce
quando clicco le altre sezioni, mentre il testo resta sempre, 
ti allego il codice magari si puo' fare qualcosa, grazie Filippo 
Codice:
Code:
package
{
import flash.display.MovieClip;
import flash.display.Loader;
import flash.text.TextField;
// * import flash.controls.UIScrollBar;
import flash.text.StyleSheet;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.MouseEvent;
import flash.events.Event;
public class Home extends MovieClip
{
private var menu_array:Array;
private var section_array:Array;
private var loader:Loader;
private var currentSection:int=0;
private var nextSection:int;
private var _html:String;
private var _css:StyleSheet;
public function Home()
{
init();
}
private function init():void
{
menu_array=new Array(menu_mc.menu1_mc,menu_mc.menu2_mc,menu_mc.menu3_mc,menu_mc.menu4_mc);
section_array=new Array(section1_mc,section2_mc,section3_mc,section4_mc);
stage.frameRate=30;
stopAll();
addMenuEvents();
hideCurrentSection();
loadHTML();
}
private function stopAll():void
{
for(var i:int=0;i < menu_array.length;i++)
{
menu_array[i].stop();
section_array[i].stop();
}
}
private function addMenuEvents():void
{
for(var i:int=0;i < menu_array.length;i++)
{
menu_array[i].mouseChildren=false;
menu_array[i].buttonMode=true;
menu_array[i].id=i;
menu_array[i].isPressed=false;
menu_array[i].addEventListener(MouseEvent.MOUSE_OVER,setOver);
menu_array[i].addEventListener(MouseEvent.MOUSE_OUT,setOut);
menu_array[i].addEventListener(MouseEvent.MOUSE_DOWN,setDown);
menu_array[i].addEventListener(MouseEvent.MOUSE_UP,setUp);
}
}
private function setOver(evt:MouseEvent):void
{
if(evt.target.isPressed==false)
evt.target.gotoAndStop(2);
}
private function setOut(evt:MouseEvent):void
{
if(evt.target.isPressed==false)
evt.target.gotoAndStop(1);
}
private function setDown(evt:MouseEvent):void
{
nextSection=evt.target.id;
checkState(evt.target.id);
evt.target.gotoAndStop(3);
hideCurrentSection();
currentSection=evt.target.id;
}
private function setUp(evt:MouseEvent):void
{
if(evt.target.isPressed==false)
evt.target.gotoAndStop(1);
}
private function checkState(n:int):void
{
for(var i:int=0;i < menu_array.length;i++)
{
if(i==n)
menu_array[i].isPressed=true;
else
{
menu_array[i].isPressed=false;
menu_array[i].gotoAndStop(1);
}
}
}
private function hideCurrentSection():void
{
section_array[currentSection].gotoAndPlay(31);
showSection();
}
private function showSection():void
{
section_array[nextSection].gotoAndPlay(2);
}
private function loadHTML():void
{
var loader:URLLoader=new URLLoader();
var request:URLRequest=new URLRequest();
request.url='C:/Documents%20and%20Settings/Trophi/Desktop/provasito/info.html';
loader.addEventListener(Event.COMPLETE,onHTML);
loader.load(request);
}
private function onHTML(evt:Event):void
{
_html=evt.target.data;
loadCSS();
}
private function loadCSS():void
{
var loader:URLLoader=new URLLoader();
var request:URLRequest=new URLRequest();
request.url='C:/Documents%20and%20Settings/Trophi/Desktop/provasito/style.css';
loader.addEventListener(Event.COMPLETE,onCSS);
loader.load(request);
}
private function onCSS(evt:Event):void
{
_css=new StyleSheet();
_css.parseCSS(evt.target.data);
section2_mc.miotesto.field_txt.styleSheet=_css;
section2_mc.miotesto.field_txt.wordWrap=true;
section2_mc.miotesto.field_txt.htmlText=_html;
section2_mc.miotesto.field_txt.width = 400;
section2_mc.miotesto.field_txt.height = 200;
section2_mc.miotesto.field_txt.border = false;
section2_mc.miotesto.field_txt.x = 180;
section2_mc.miotesto.field_txt.y = 250;
addChild(section2_mc.miotesto.field_txt);
// * Sospeso
// var scroller:UIScrollBar=new UIScrollBar();
// scroller.move(section2_mc.miotesto.field_txt.x + section2_mc.miotesto.field_txt.width,section2_mc.miotesto.field_txt.y);
// scroller.setSize(scroller.width, section2_mc.miotesto.field_txt.height);
// scroller.scrollTarget=section2_mc.miotesto.field_txt;
// addChild(scroller);
}
}
}
Bookmarks