ciao a tutti,
ho trovato l'swf di un lettore di rss.
mi da però un problema. Io vorrei che la dimensione fosse di x 250 e y 60 pixel.
se lo apro come mc esterno con l'istruzione:
//creo mc
_root.createEmptyMovieClip("mcrss1",1);
//posiziono mc dove mi serve
mcrss1._x = 123.2;
mcrss1._y = 443.6;
//collego mc vuoto con file swf esterno
mcrss1.loadMovie("rss1.swf");
mi da delle proporzioni "sballate" e non le dimensioni reali del swf (che sono 250*60).
Mi date una mano...... oltre a non conoscere quasi nulla di as....... sono pure le 5 di mattina.
Grazie a tutti
ciao
zeus
P.S. Incollo anche il codice del lettore rss.
Stage.align = "TL";
Stage.scaleMode = "noScale";
System.useCodepage = true;
stop ();
curl = curl == undefined ? ("http://news.google.it/news?hl=it&ned=it&q=energie+alternative&ie=UTF-8&output=rss") : (curl);
ctime = ctime == undefined ? (8000) : (Number(ctime));
ctitle = ctitle == undefined ? ("0x666666") : ("0x" + ctitle);
ccontent = ccontent == undefined ? ("000000") : (ccontent);
cscontent = cscontent == undefined ? ("595984") : (cscontent);
cbackground = cbackground == undefined ? ("0xdbe7f2") : ("0x" + cbackground);
var write = function (who, what, tf)
{
who.htmlText = what;
who.setTextFormat(tf);
};
var fadePopolation = function (s)
{
write(__news__title__, s, bf);
fdr.fader(news, __news__content__);
};
var siteViewer = function ()
{
var _loc2 = curl.split("/");
var _loc3 = "";
for (var _loc1 = 0; _loc1 < _loc2.length - 1; ++_loc1)
{
_loc3 = _loc3 + (_loc2[_loc1] + "/");
} // end of for
getURL(_loc3, "_blank");
};
var content_top = 13;
var content_left = 2;
var menu = new ContextMenu();
var menuItem_cmi = new ContextMenuItem("Visit this news site", siteViewer);
var xml = new Object();
var fdr = new Object();
var news = new Array();
var bf = new TextFormat();
var nf = new TextFormat();
menu.hideBuiltInItems();
menu.customItems.push(menuItem_cmi);
this.menu = menu;
bf.size = nf.size=10;
bf.color = ctitle;
bf.font = "fb";
nf.font = "fn";
createEmptyMovieClip("__news__background__", getNextHighestDepth());
createTextField("__news__content__", getNextHighestDepth(), content_left, content_top, Stage.width - content_left, Stage.height - content_top);
createTextField("__news__title__", getNextHighestDepth(), content_left, 0, Stage.width - content_left, content_top);
__news__title__.selectable = __news__content__.selectable = false;
__news__title__.html = __news__content__.html = true;
__news__content__.multiline = __news__content__.wordWrap = true;
__news__title__.embedFonts = __news__content__.embedFonts = true;
with (__news__background__)
{
moveTo(0, 0);
beginFill(cbackground, 100);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
endFill();
} // End of with
write(__news__title__, "Loading 0%", bf);
fdr.__fade = function (ar)
{
if (this.__cnt >= ar.length)
{
this.__cnt = 0;
} // end if
if (this.__do == true)
{
if (__news__content__.text == "")
{
write(this.__tf, ar[this.__cnt++], nf);
} // end if
if (this.__tf._alpha < 100)
{
this.__tf._alpha = this.__tf._alpha + 2;
}
else if (this.__tf._alpha >= 100)
{
clearInterval(this.__interval);
this.__tf._alpha = 100;
this.__do = false;
this.__interval2 = setInterval(this, "__fade", ctime, ar);
} // end else if
}
else
{
if (this.__interval2 != 0)
{
clearInterval(this.__interval2);
this.__interval2 = 0;
this.__interval = setInterval(this, "__fade", 20, ar);
} // end if
if (this.__tf._alpha > 0)
{
this.__tf._alpha = this.__tf._alpha - 2;
}
else if (this.__tf._alpha <= 0)
{
clearInterval(this.__interval);
write(this.__tf, "", nf);
this.__tf._alpha = 0;
this.__do = true;
this.__interval = setInterval(this, "__fade", 20, ar);
} // end else if
} // end else if
};
fdr.fader = function (ar, tf)
{
this.__tf = tf;
this.__cnt = 0;
this.__tf._alpha = 0;
this.__do = true;
this.__interval = setInterval(this, "__fade", 20, ar);
};
xml.__onLoadProgress = function ()
{
var _loc4 = this.__xml.getBytesLoaded();
var _loc3 = this.__xml.getBytesTotal();
var _loc2 = Math.floor(_loc4 / _loc3 * 100);
if (__news__title__.text == "Loading 100%")
{
clearInterval(this.__interval);
}
else if (_loc3 > _loc2 && _loc2 != infinity && !isNaN(_loc2))
{
write(__news__title__, "Loading " + String(_loc2) + "%", bf);
} // end else if
};
xml.load = function (what)
{
this.__xml = new XML();
this.__xml.ignoreWhite = true;
this.__xml.__onRealLoad = function ()
{
clearInterval(this.__intervall);
var _loc3 = this.childNodes[0];
_loc3 = _loc3.childNodes[0];
var _loc9 = "";
var _loc7 = "";
var _loc8 = "";
var _loc6 = "";
for (var _loc2 = 0; _loc2 < _loc3.childNodes.length; ++_loc2)
{
if (_loc3.childNodes[_loc2].nodeName == "title")
{
_loc9 = _loc3.childNodes[_loc2].childNodes[0];
continue;
} // end if
if (_loc3.childNodes[_loc2].nodeName == "link")
{
_loc9 = "<a href=\"" + _loc3.childNodes[_loc2].childNodes[0] + "\" target=\"_blank\">" + _loc9 + "</a>";
continue;
} // end if
if (_loc3.childNodes[_loc2].nodeName == "item")
{
for (var _loc4 = 0; _loc4 < _loc3.childNodes[_loc2].childNodes.length; ++_loc4)
{
if (_loc3.childNodes[_loc2].childNodes[_loc4].nodeName == "title")
{
_loc7 = _loc3.childNodes[_loc2].childNodes[_loc4].childNodes[0];
continue;
} // end if
if (_loc3.childNodes[_loc2].childNodes[_loc4].nodeName == "link")
{
_loc8 = "<a href=\"" + _loc3.childNodes[_loc2].childNodes[_loc4].childNodes[0] + "\" target=\"_blank\">" + _loc7 + "</a>";
continue;
} // end if
if (_loc3.childNodes[_loc2].childNodes[_loc4].nodeName == "category")
{
_loc6 = _loc3.childNodes[_loc2].childNodes[_loc4].childNodes[0];
continue;
} // end if
if (_loc3.childNodes[_loc2].childNodes[_loc4].nodeName == "pubDate")
{
var _loc5 = _loc3.childNodes[_loc2].childNodes[_loc4].childNodes[0].toString().split(" ");
_loc6 = "<font color=\"#" + cscontent + "\">" + _loc5[0] + " " + _loc5[1] + " " + _loc5[2] + " :: " + _loc6 + "</font>";
news.push("<font color=\"#" + ccontent + "\">" + _loc8 + "</font>
" + _loc6);
} // end if
} // end of for
} // end if
} // end of for
if (_loc9 != null && _loc9 != undefined && news.length > 0)
{
fadePopolation(_loc9);
}
else
{
write(__news__title__, "Error", bf);
write(__news__content__, "Bad RSS 2.0, unable to parse.", nf);
} // end else if
};
this.__xml.onLoad = function (s)
{
if (s)
{
this.__intervall = setInterval(this, "__onRealLoad", 50);
}
else
{
write(__news__title__, "Access denied", bf);
write(__news__content__, "Unable to open request url", nf);
} // end else if
};
this.__xml.load(what);
if (this.__interval != undefined)
{
clearInterval(this.__interval);
} // end if
this.__interval = setInterval(this, "__onLoadProgress", 10);
};
xml.load(curl);

Rispondi quotando