Hi everyone,
It’s been way back since I’ve build Flash site’s, but the project I’ve just started seemed so easy…
Scenario:
I’ve made a AS which simply reads the last 5 tweets from Twitter and shows them in Flash.
I’m struggling with 2 issues:
The first one is that I can seem to get my dynamic text (the tweet) visible on the web.
When I preview my movie offline everything seems fine, but when I upload it to my server there is no
text visible.
Flash already told me that I need to enclose the font (something that is new for me), but even when I enclosed the font (with the little button in the properties screen)
the text is still not visible.
I also tried changing the aliasing options and even tried to use the “use font from device” option, but nothing seems to work.
This is the AS I’m using:
var loadXML:XML = new XML();
loadXML.ignoreWhite = true;
loadXML.onLoad = processXML;
loadXML.load("twitter.php"); //used when swf in placed on server
loadXML.load("http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=studiodrgroove");
function processXML(loaded:Boolean)
{
if(loaded)
{
var node = this.firstChild;
tweet_1.text = node.childNodes[0].childNodes[2].firstChild;
tweet_2.text = node.childNodes[1].childNodes[2].firstChild;
tweet_3.text = node.childNodes[2].childNodes[2].firstChild;
tweet_4.text = node.childNodes[3].childNodes[2].firstChild;
var follower_count = node.childNodes[9].childNodes[11].childNodes[9].firstChild;// Creates variable
trace(follower_count); //loads variable into output
follower_count_txt.text = follower_count;// show follower count in text box
}
else
{
error_txt.text = "Error loading XML file";
}
for (i=0; i<follower_count; i++) // <-- problem occurs here
{
_root.attachMovie("tweep_mc", "tweep"+i+"_mc", i);
_root["tweep"+i+"_mc"]._x = 150 + random(500);
_root["tweep"+i+"_mc"]._y = 150 + random(500);
trace(i);
}
trace(i);
}
follow_btn.onRelease = function()
{
getURL("http:///twitter.com/studiodrgroove");
}
facebook_btn.onRelease = function()
{
getURL("http://www.facebook.com/pages/Studio-DR-Groove/415605851839285");
}
stop();
I made a new, empty, flash movie to isolate the problem an uploaded it.
As you can see right here… there is no text showing.
The second thing is that we’ll be using this Twitter feed to keep people updated about projects.
That’ll mean that the Tweet will almost always contain hyperlinks to photo’s.
When a tweets (and the hyperlinks) are displayed in Flash, the links are not clickable.
Is there a (easy way) to make them clickable?
Hope you guys can help me out!
Thanks in advance,
Karim