+ Reply to Thread
Results 1 to 3 of 3

Problema con un modulo news scroll su swf esterno

This is a discussion on Problema con un modulo news scroll su swf esterno within the Flash CS4 forums, part of the Flash Italiano category; Ciao a tutti, sono nuovo, anzi nuovissimo su questa fantastica community. Volevo farvi una domanda che mi sta facendo impazzire ...

  1. #1
    Junior Member Settled In Skop is on a distinguished road
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Problema con un modulo news scroll su swf esterno

    Ciao a tutti, sono nuovo, anzi nuovissimo su questa fantastica community.

    Volevo farvi una domanda che mi sta facendo impazzire oggi, è la seguente:

    sto realizzando un sito con Flash CS4 in AS3, non sono molto pratico, ma diciamo che qualcosa riesco a fare con l'AS. Il mio sito è così articolato: main.swf (filmato principale) che carica al suo interno home.swf (che a sua volta carica ---> un clip con immagini di sfondo che cambiano -cliphome.swf- ed un modulo news -news.swf- con scroll contentente testo ed immagini tramite XML + file AS esterno. Gli altri pulsanti caricano altri swf come ad esempio galleria.swf, prodotti.swf... ecc. ecc.

    Il problema però è relativo allo scroll presente nelle news, prima che lo inserissi e settassi, andava tutto ok ed il sito (on-line) non mi dava nessun errore, ora col modulo inserito flash mi da errore di output:

    TypeError: Error #1009: Impossibile accedere a una proprietà o a un metodo di un riferimento oggetto null.
    at news_fla::news_4/stopScroll()


    Quindi, ricapitolando, nel main.swf ho questo codice:

    PHP Code:
    this.stop();

    //caricamento swf esterni

    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.MouseEvent;

    var 
    addedDefinitions1:LoaderContext = new LoaderContext();
    addedDefinitions1.applicationDomain=ApplicationDomain.currentDomain;
    var 
    loader1:Loader content_mc.addChild(new Loader()) as Loader;
    loader1.load(new URLRequest("home.swf"), addedDefinitions1);
    pulsHome_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    pulsFrantoio_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    pulsProdotti_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    pulsTerritorio_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    pulsLavorazione_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    pulsContatti_btn.addEventListener(MouseEvent.MOUSE_UP,menuRelease);
    function 
    menuRelease(e:Event):void {
        var 
    swfFile;
        if (
    e.target.name=="pulsHome_btn") {
            
    swfFile="home.swf";
        } else if (
    e.target.name == "pulsFrantoio_btn") {
            
    swfFile="pages/frantoio.swf";
        } else if (
    e.target.name == "pulsProdotti_btn") {
            
    swfFile="pages/prodotti.swf";
        } else if (
    e.target.name == "pulsTerritorio_btn") {
            
    swfFile="pages/territorio.swf";
        } else if (
    e.target.name == "pulsLavorazione_btn") {
            
    swfFile="pages/lavorazione.swf";
        } else if (
    e.target.name == "pulsContatti_btn") {
            
    swfFile="contatti.swf";
        } else {
            
    trace("error");
        }
        
    loader1.load(new URLRequest(swfFile), addedDefinitions1);

    e non ho nessun problema.

    Nella home.swf ho questo:

    PHP Code:
    this.stop();

    var 
    swf1:MovieClip;
    var 
    loader1:Loader = new Loader();

    var 
    defaultSWF1:URLRequest = new URLRequest("cliphome.swf");
    loader1.load(defaultSWF1);
    addChild(loader1);
    loader1.x=0;
    loader1.y=0;

    var 
    swf2:MovieClip;
    var 
    loader2:Loader = new Loader();

    var 
    defaultSWF2:URLRequest = new URLRequest("news.swf");
    loader2.load(defaultSWF2);
    addChild(loader2);
    loader2.x=0;
    loader2.y=244
    Questo mi serve per caricare nel main i due clip video esterni dove uno ha la slide di immagini in loop e l'altro appunto... le benedette news che mi danno problemi

    Questo invece è il codice di news.swf

    PHP Code:
    import gs.TweenLite;
    import fl.motion.easing.*;
    import fl.transitions.*;
    import fl.transitions.easing.*;

    //masks
    scrlCnt.mask scrlMsk;


    //*************** XML ***************//

    //on news.xml load
    function onNewsXMLLoad(event:Event):void {
        var 
    newsXML:XML = new XML(event.target.data);
        
    newsXML.ignoreWhitespace true;

        for (var 
    i:int 0i<newsXML.item.length(); i++) {//videos

            
    var tileNews:Tile = new Tile();
            
    tileNews.tileNews.width*i+10*i;//10 = spacing between the news tiles

            //video date+name and description+link
            
    tileNews.nameTxt.htmlText newsXML.item[i].date.text()+" - "+newsXML.item[i].name.text();
            
    tileNews.infoTxt.htmlText newsXML.item[i].txt.text()+" <font color='#FFFFFF'><a href='"+newsXML.item[i].linkurl.text()+"'>"+newsXML.item[i].linkname.text()+"</a></font>";

            
    //thumbnail
            
    var imgLoader:Loader = new Loader();
            
    imgLoader.load(new URLRequest(newsXML.item[i].thumbnail.text()));
            
    imgLoader.17//horizontal position of the thumbnail
            
    imgLoader.11//vertical position of the thumbnail
            
    tileNews.addChild(imgLoader);

            
    scrlCnt.addChild(tileNews);
        }
    }

    var 
    newsXMLLoader:URLLoader = new URLLoader();
    newsXMLLoader.addEventListener(Event.COMPLETEonNewsXMLLoadfalse0true);
    newsXMLLoader.load(new URLRequest("news.xml"));//load news from news.xml


    //*************** Functions ***************//

    /*** Scrollbar ***/

    //on click, start scrolling
    function startScroll(event:MouseEvent):void {
        
    scrlDrg.startDrag(false, new Rectangle(scrlTrack.x+10scrlTrack.y-3.5scrlTrack.width-scrlDrg.width-200));
        
    TweenLite.to(scrlCnt0.5, {y:"0"ease:Regular.easeOut});
        
    stage.addEventListener(Event.ENTER_FRAMEscrollGofalse0true);
    }

    //on mouse up, stop scrolling
    function stopScroll(event:MouseEvent):void {
        
    stopDrag();
        
    stage.removeEventListener(Event.ENTER_FRAMEscrollGo);
    }

    //move the news
    function scrollGo(event:Event):void {
        
    TweenLite.to(scrlCnt0.5, {x:Math.round(scrlTrack.x+10-10-(scrlCnt.width-(scrlTrack.width+40-scrlDrg.width))*((scrlDrg.x-scrlTrack.x-10)/(scrlTrack.width-20-scrlDrg.width))), ease:Regular.easeOut});
    }

    //on mouse wheel, scroll
    function onScrollWheel(event:MouseEvent):void {
        var 
    newY:Number scrlDrg.x-event.delta*20;
        if (
    newY>=scrlTrack.x+10 && newY<=scrlTrack.x+10+(scrlTrack.width-scrlDrg.width-10)) {
            
    scrlDrg.-= event.delta*20;
        }
        
    TweenLite.to(scrlCnt0.5, {x:Math.round(scrlTrack.x+10-10-(scrlCnt.width-(scrlTrack.width+40-scrlDrg.width))*((scrlDrg.x-scrlTrack.x-10)/(scrlTrack.width-20-scrlDrg.width))), ease:Regular.easeOut});
    }


    //*************** Events ***************//

    stage.addEventListener(MouseEvent.MOUSE_WHEELonScrollWheelfalse0true);
    scrlDrg.addEventListener(MouseEvent.MOUSE_DOWNstartScrollfalse0true);
    stage.addEventListener(MouseEvent.MOUSE_UPstopScrollfalse0true); 
    Ragazzi io vi ringrazio anticipatamente per le risposte che mi darete!!!!

    Ciao


    Simone

  2. #2
    Junior Member Settled In Skop is on a distinguished road
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Re: Problema con un modulo news scroll su swf esterno

    Nessuno mi può dare qualche dritta???? Che sia un problema di debug??? Perchè ho provato su diversi pc e browser ed il problema non l'ho riscontrato! Ma, lavorando nel .fla si, sempre. Mi da errore!!!!

    :(

  3. #3
    Junior Member Settled In Skop is on a distinguished road
    Join Date
    May 2010
    Posts
    6
    Rep Power
    0

    Re: Problema con un modulo news scroll su swf esterno

    Ragazzi niente??? Nessuno sa dirmi come integrare questo codice???? NIENTE!!!!!

    FLEEEEEEEEEP!

    Help!!!!


+ Reply to Thread

Similar Threads

  1. Modulo per newsletter
    By Flep in forum Utilità di FlepStudio
    Replies: 64
    Last Post: 21-08-11, 23:39
  2. AS2 News caricate da XML problema link
    By Lupen in forum Flash Italiano
    Replies: 4
    Last Post: 22-11-10, 08:21
  3. problema su scroll image
    By ila74 in forum AIUTO utilità free
    Replies: 0
    Last Post: 13-05-09, 11:30
  4. Problema con CSS e Scroll orizzontale
    By Fra in forum CSS | HTML
    Replies: 2
    Last Post: 29-04-09, 06:54
  5. Sistema News, problema accavallamento news
    By dierre in forum Actionscript 3.0 base
    Replies: 9
    Last Post: 05-06-08, 16:36

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