To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 11-07-2009, 06:46 PM   #1
databell
Senior Member
 
Join Date: Jul 2000
Posts: 320
Twitter feed not exactly appearing in .swf

I'm trying to get the last post of a clients' Twitter feed embedded into a dynamic .swf file. I thought I had it and indeed if you go here it works:

http://204.12.3.54/twitter.swf

but then I embedded it into the page and now I get the .swf to appear but no feed!

http://h186498wp.setupmyblog.com/

It's supposed to connect to a php page that does the work and I'm enclosing it here. I do have crossdomain.xml set up properly. Anyone know why it doesn't connect on my page but it does by itself?

<?php
/*
* @return string
* @param string $url
* @desc Return string content from a remote file
* @author Luiz Miguel Axcar (lmaxcar@yahoo.com.br)
*/

function get_content($url)
{
$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 0);

ob_start();

curl_exec ($ch);
curl_close ($ch);
$string = ob_get_contents();

ob_end_clean();

return $string;
}

#usage:
$content = get_content ("http://twitter.com/statuses/user_timeline.xml?screen_name=big_pearl");
echo $content;
?>
__________________
Adam Bell
dzign@datatv.com
--
Over 90% of all websites
suck......
Join the minority.
databell is offline   Reply With Quote
Old 11-08-2009, 11:58 AM   #2
Ralgoth
newb of many sorts
 
Ralgoth's Avatar
 
Join Date: Apr 2002
Posts: 376
Here's the error that pops when trying to run it on the page...

Code:
TypeError: Error #1010: A term is undefined and has no properties.
	at twitter2_fla::MainTimeline/processXML()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()
It looks like a variable is being overlooked in the processXML function. Without seeing your code, I can't help much beyond that.
__________________
Search first, asked questions later.
Ralgoth is offline   Reply With Quote
Old 11-08-2009, 06:26 PM   #3
databell
Senior Member
 
Join Date: Jul 2000
Posts: 320
Yea, I can help you there

Here's the only AS3 code I'm using on the timeline:

var myXMLLoader:URLLoader = new URLLoader();
myXMLLoader.load(new URLRequest("twitter.php"));
myXMLLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
var myXML:XML=new XML(e.target.data);
tweet_1.text=myXML.status[0].text;
}

followMe_btn.addEventListener(MouseEvent.CLICK, onFollow);
function onFollow(e:MouseEvent):void{
navigateToURL(new URLRequest("http://twitter.com/big_pearl"));
}

Obviously, the onFollow function works. It's the processXML function that's the issue.
__________________
Adam Bell
dzign@datatv.com
--
Over 90% of all websites
suck......
Join the minority.
databell is offline   Reply With Quote
Old 11-08-2009, 08:08 PM   #4
Ralgoth
newb of many sorts
 
Ralgoth's Avatar
 
Join Date: Apr 2002
Posts: 376
hmmm. It may be a hosting thing actually.

if you try to access your "twitter.php" on the blog site, you get this message...

/statuses/user_timeline.xml?screen_name=big_pearl Rate limit exceeded. Clients may not make more than 150 requests per hour.

Either the Rate limit needs to be lifted, or you'll have to come up with ways to reduce the amount of requests going out.

in php, you could write the twitter results to a file on the server. Then when a user goes to the site, your "twitter.php" would look and see if the file is >1 minute old. If so, update it, then serve to flash.
__________________
Search first, asked questions later.
Ralgoth is offline   Reply With Quote
Old 11-08-2009, 08:24 PM   #5
databell
Senior Member
 
Join Date: Jul 2000
Posts: 320
Yea, I had a feeling about that. I think it's a Twitter issue where a host can't make so many requests per hour. I guess I'm going to have to try the other solution with the flat file. Hopefully, I can make that work.
__________________
Adam Bell
dzign@datatv.com
--
Over 90% of all websites
suck......
Join the minority.
databell is offline   Reply With Quote
Reply

Tags
as3, feed, swf, twitter

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:51 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.