+ Reply to Thread
Results 1 to 3 of 3

Caricamento testo

This is a discussion on Caricamento testo within the Flash Italiano forums, part of the Flash CS3 - CS4 - CS5 category; Salve a tutti, ho un problema. ho un pulsante che al click del mouse dovrebbe aprire una finestra popup e ...

  1. #1
    Senior Member Flash Obsessed dla86 is on a distinguished road
    Join Date
    Apr 2008
    Posts
    285
    Rep Power
    6

    Caricamento testo

    Salve a tutti, ho un problema.
    ho un pulsante che al click del mouse dovrebbe aprire una finestra popup e al suo interno dovrebbe essere caricato dinamicamente del testo preso da un file .txt
    il tutto funziona perfettamente, tranne quando imposto questa funzionalità su un progetto che ha una document class esterna. non so se le due cose sono collegate ma non vedo alternativa... mi aiutate?
    la cosa strana è che quando apro la finestra pop up è come se il mouse percepisse che il testo c'è perchè la freccina cambia in quel segnetto particolare....
    ma non vedo nulla però,..... boh..sto impazzendo..

  2. #2
    Senior Member Flash Obsessed dla86 is on a distinguished road
    Join Date
    Apr 2008
    Posts
    285
    Rep Power
    6

    Re: Caricamento testo

    questo è il codice.... vi prego aiutatemi.


    ---------------------------------------------------------------------------------------
    import flash.text.TextField;
    import flash.events.TextEvent;
    import flash.text.TextFormat;
    var finestra:MovieClip;
    var pulsanti:Array = new Array(menu_mc.btn1,menu_mc.btn2,menu_mc.btn3,menu_ mc.btn4);
    /////////////////////////////loader//////////////////////////////////////////
    var loader1:URLLoader = new URLLoader();
    var papermedia:URLRequest = new URLRequest("testo/text_PaperMedia.txt");
    loader1.load(papermedia);
    var loader4:URLLoader = new URLLoader();
    var fairmedia:URLRequest = new URLRequest("testo/text_FairMedia.txt");
    loader4.load(fairmedia);
    var loader2:URLLoader = new URLLoader();
    var archimedia:URLRequest = new URLRequest("testo/text_ArchiMedia.txt");
    loader2.load(archimedia);
    var loader3:URLLoader = new URLLoader();
    var firmedia:URLRequest = new URLRequest("testo/text_FirMedia.txt");
    loader3.load(firmedia);
    //////////////////////////////////////////////////////////////////////////////
    for(var i:uint=0;i<4;i++){
    pulsanti[i].idpagina = "p" + (i+1);
    pulsanti[i].addEventListener(MouseEvent.CLICK,info);
    pulsanti[i].buttonMode = true;
    pulsanti[i].mouseChildren = false;


    }
    ///////////////////////////gestisco eventi////////////////////////////////////
    function info(evt:MouseEvent):void
    {

    finestra = new PopUp();
    finestra.x = -100;
    finestra.y = -100;
    addChild(finestra);


    finestra.pop_area.close_mc.buttonMode = true;
    finestra.pop_area.buttonMode = true;
    finestra.pop_area.close_mc.addEventListener(MouseE vent.CLICK,close_popUp);
    finestra.pop_area.addEventListener(MouseEvent.MOUS E_DOWN,dragFinestra);


    mostrotesto(evt.currentTarget.idpagina);
    }
    function mostrotesto(link:String):void
    {

    var testo:TextField = new TextField();
    testo.x = -100;
    testo.y = -100;

    var formattazione:TextFormat = new TextFormat();
    formattazione.align = TextFormatAlign.JUSTIFY;

    formattazione.color= 0xFFFFFF
    formattazione.size = 13;
    testo.autoSize = TextFieldAutoSize.LEFT;
    testo.multiline = true;
    testo.wordWrap = true;
    testo.width = 200;
    testo.height = 200;

    if(link == "p1"){
    testo.htmlText = loader1.data;
    testo.setTextFormat(formattazione);
    finestra.addChild(testo)}

    if(link == "p2"){
    testo.htmlText = loader2.data;
    testo.setTextFormat(formattazione);
    finestra.addChild(testo)}

    if(link == "p3"){
    testo.htmlText = loader3.data;
    testo.setTextFormat(formattazione);
    finestra.addChild(testo)}

    if(link == "p4"){
    testo.htmlText = loader4.data;
    testo.setTextFormat(formattazione);
    finestra.addChild(testo)}


    }

    function close_popUp(evt:MouseEvent):void
    {
    removeChild(finestra);
    }
    function dragFinestra(evt:MouseEvent):void
    {
    finestra.startDrag();
    finestra.addEventListener(MouseEvent.MOUSE_UP,stop DragFinestra);
    }
    function stopDragFinestra(evt:MouseEvent):void
    {
    finestra.stopDrag();
    }

    ------------------------------------------------------------------------------------------------------------------------

  3. #3
    Senior Member Flash Obsessed dla86 is on a distinguished road
    Join Date
    Apr 2008
    Posts
    285
    Rep Power
    6

    Re: Caricamento testo

    Grazie a tutti per l'aiuto.... sono senza parole, come può funzionare un forum dove uno scrive solo quando ha bisogno e non anche quando qualche altro utente ha bisogno???-----------------------------------------------------------------------------------------------------------------------------------------------------------------no comment

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 22-06-10, 20:07
  2. Caricamento Flv
    By Kerotan in forum Actionscript 3.0 avanzato
    Replies: 0
    Last Post: 31-03-10, 21:26
  3. errore caricamento testo Undefined
    By ggraphic in forum Flash Italiano
    Replies: 0
    Last Post: 09-07-09, 17:57
  4. problema caricamento testo file txt
    By etr102108 in forum Actionscript 3.0 base
    Replies: 1
    Last Post: 21-04-08, 08:09
  5. Caricamento swf
    By Marco756 in forum Actionscript 3.0 base
    Replies: 4
    Last Post: 08-01-08, 17:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts