Skip to main content
Participating Frequently
January 14, 2014
Answered

Problens with AS1 to AS3

  • January 14, 2014
  • 1 reply
  • 2343 views

Hi dear friends

I'm too rusty with flash but today appearl a problem

I have this code is in AS1 and needs to be in AS3...

Is an RSS code with title and description only...

if some one can insert a picture, please tell...

titulo2 and texto2 are drop shadows

System.useCodepage = true;

loadNum = new Loadvars();

loadNum.onLoad = function (ok)

{

    var __reg1 = _root;

    if (ok)

    {

        __reg1.titulo.text = __reg1.loadNum.titulo;

        __reg1.titulo2.text = __reg1.loadNum.titulo;

        __reg1.texto.text = __reg1.loadNum.texto;

        __reg1.texto2.text = __reg1.texto.text;

    }

}

;

loadNum.load("rssnews.dat");

trace(numPics);

This topic has been closed for replies.
Correct answer kglad

titulo2 and texto2 are textfields or your as1 code is incorrect.  (however, they may appear to be dropshadows because of offset and alpha manipulations.)

var urlLoader:URLLoader = new URLLoader();

urlLoader.addEventListener(Event.COMPLETE,completeF);

urlLoader.load(new URLRequest("rssnews.dat"));

function completeF(e:Event):void{

var __reg1:MovieClip=MovieClip(root);

__reg1.titulo.text=XML(urlLoader.data).titulo;

etc

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 14, 2014

titulo2 and texto2 are textfields or your as1 code is incorrect.  (however, they may appear to be dropshadows because of offset and alpha manipulations.)

var urlLoader:URLLoader = new URLLoader();

urlLoader.addEventListener(Event.COMPLETE,completeF);

urlLoader.load(new URLRequest("rssnews.dat"));

function completeF(e:Event):void{

var __reg1:MovieClip=MovieClip(root);

__reg1.titulo.text=XML(urlLoader.data).titulo;

etc

}

Participating Frequently
January 15, 2014

ok I tried but still not working

now I deleted that text that appears like dropshadows

var urlLoader:URLLoader = new URLLoader();

urlLoader.addEventListener(Event.COMPLETE,completeF);

urlLoader.load(new URLRequest("rssnews.dat"));

function completeF(e:Event):void{

var __reg1:MovieClip=MovieClip(root);

          __reg1.titulo.text=XML(urlLoader.data).titulo;

          __reg1.texto.text=XML(urlLoader.data).titulo;

}

but the text doesn't appear...

kglad
Community Expert
Community Expert
January 15, 2014

use the trace function to debug:

var urlLoader:URLLoader = new URLLoader();

urlLoader.addEventListener(Event.COMPLETE,completeF);

urlLoader.load(new URLRequest("rssnews.dat"));

function completeF(e:Event):void{

var __reg1:MovieClip=MovieClip(root);

trace(XML(urlLoader.data));

}

paste the (first 50 or so lines of) trace output in this forum.