Desperately need help with AS3 and Twitter Feed!

Hi all

I took another developer and try to add a Twitter feed to my flash application. The twitter feed has, but only the first title and loops. It does not show the other tweets, just the first title and repeat over and over again. Please help me with this because I'm desperate to fix.

Here is my source code for Twitter.as

I use Flash develop to make it the main.swf, but I don't know the code below for the Twitter account is wrong because it shows more then 1 tweet.

package src.main

{

import com.greensock.TweenMax;

import com.theppc.cmstools.CmsVars;

import com.theppc.cmstools.TextTool;

import com.theppc.visualtools.DrawBox;

import flash.display.MovieClip;

import flash.display.Sprite;

import flash.errors.IOError;

import flash.events.Event;

import flash.events.IOErrorEvent;

import flash.events.SecurityErrorEvent;

import flash.events.TimerEvent;

import flash.net.URLLoader;

import flash.net.URLLoaderDataFormat;

import flash.net.URLRequest;

import flash.text.TextFieldAutoSize;

import flash.utils.Timer;

Import src.utils.TitleBlock;

import com.greensock.easing.Back;

import com.greensock.easing.Strong;

import of CBC. Main;

Import src.utils.HandleXml;

/**

* ...

* @author Joshua King

*/

SerializableAttribute public class extends MovieClip TwitterBox

{

private var _title:TitleBlock;

private var _bg:Sprite

private var _width:int;

private var _height:int;

private var _tweetholder:MovieClip;

private var _txt:ContentTxt;

private var _mask:Sprite;

private var _user:String = "PPC_Creative";

private var _tweetcount:int = 5;

private var _tweets:Array = [];

private var _times:Array = [];

private var _gap:Number = 55;

private var _tweetmove:int = 0;

public void TwitterBox (_w:int, _h:int)

{

_width = _f;

_height = _it;

init();

}

private function init (): void

{

_bg = new Sprite();

addChild (_bg);

_bg. Graphics.LineStyle(1,0x00ccff);

_bg. Graphics.beginFill (0xFFFFFF);

_bg. Graphics.drawRect(0,0,_width,_height);

_bg. Graphics.endFill ();

_tweetholder = new MovieClip();

_tweetholder.y = 55;

_tweetholder.x = 5;

addChild (_tweetholder);

_MASK = new Sprite();

_MASK. Graphics.beginFill (0xF09FFF);

_MASK. Graphics.drawRect (0, _gap, _width, _height - _gap - 5);

_MASK. Graphics.endFill ();

addChild (_mask);

_tweetholder. Mask = _mask;

_txt = new ContentTxt();

_txt.txt.text = ";

_txt.Alpha = 0;

_txt.txt.width = 537;

_txt.txt.height = _height - _gap - 5;

_tweetholder. AddChild (_txt);

addContentboxes();

}

private function addContentboxes (): void

{

_title = new cartridge (Main._sitedata ['text'] [5] .we, 547);

addChild (_title);

addTweets();

}

public function addTweets (): void

{                    /*

var urlReq:URLRequest = new URLRequest (_url);

var loader: URLLoader = new URLLoader();

loader.addEventListener (Event.COMPLETE, getTweets);

loader.addEventListener (IOErrorEvent.IO_ERROR, IOError);

loader.addEventListener (SecurityErrorEvent.SECURITY_ERROR, SError);

Loader.Load (urlReq);

*/

var loader: URLLoader = new URLLoader();

loader.dataFormat = URLLoaderDataFormat.TEXT;

loader.addEventListener (Event.COMPLETE, getTweets);

var url: String = " " https://API.Twitter.com/1/statuses/user_timeline.RSS?screen_name=PPC_Creative ";

must use a proxy due to security sandbox issues if you call this twitter url directley to flash

var req:URLRequest = new URLRequest ("rssProxy.php? rss =", CmsVars.PHP_ROOT + url)

trace (CmsVars.PHP_ROOT + ' rssProxy.php? rss =' + url);

Loader.Load (req)

}

private void getTweets(evt:Event):void

{

var twitterXML:XML = new XML (evt.target.data);

var tweetList:XMLList = twitterXML.children ();

var tweetItem:String;

var timeItem:String;

var _counter:int = 0;

_tweetmove = 0;

_tweets = [];

for (var i: int = 0; i < tweetList.length (); i ++)

{

tweetItem = cheat [i]. *: title;

trace (tweetItem);

If (tweetItem! = "")

{

_tweets.push (tweetItem);

_Counter ++

If (_counter > = _tweetcount)

{

break;

}

}

}

moveTweet();

}

private function moveTweet (): void

{

_txt.Alpha = 0;

TextTool.setText (_txt.txt, _tweets [_tweetmove], true);

TweenMax.to (_txt, 1, {delay: 1, alpha: 1, replace: 0});

TweenMax.to (_txt, 1, {delay: 12, alpha: 0, crush: 0, onComplete:moveTweet});})

_tweetmove ++

If (_tweetmove > = _tweets.length) _tweetmove = 0;

}

private void IOError(e:Event):void

{

trace ("io error!");

}

private void SError(e:Event):void

{

trace ("security error!");

}

}

}

First of all, your cheating XMLList length is only 1. I like to use E4X rating rather than the old children() as you're here, so I might suggest to change this:

var tweetList:XMLList = twitterXML.children ();

in your getTweets() method to:

var tweetList:XMLList = twitterXML.channel.item;

Then you have all your items. I liked so much out of each of them:

for (var i: int = 0; i< tweetlist.length();="">

{

trace (tweetList [i] .title);

}

Also, I had no trouble calling Twitter directly from Flash using:

var loader: URLLoader = new URLLoader();

Loader.Load (new URLRequest ("https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=PPC_Creative"));

loader.addEventListener (Event.COMPLETE, getTweets);

However, there is a typing error in what you had posted - you had a space in the URL - after the C in C reactive...

Tags: Adobe Animate

Similar Questions

  • Need help with AS3!

    Hello! I need help on as3. I'm still a noob at this stuff.

    I'm doing a simple game. You must click on the bugs that moves randomly to the bottom of the screen. When you click on the bugs, they will become invisible

    and if none of the bugs through the bottom of the screen, you lose 1 live.

    But right now, im of the problems with the script. When I click on the bugs and she go, life is further reduced. I don't understand.

    And theres also error coming out. "TypeError: Error #1009: cannot access a property or method of a null object reference."

    " to buh_fla::MainTimeline/tekan().

    Here is the script:

    ===================================

    Stop();

    import flash.events.Event;

    import flash.events.MouseEvent;

    var iscore:int = 0;

    score. Text = iscore.toString ();

    var health: int;

    health = 3;

    trace (Health);

    for (var i: int = 0; i < 10; i ++) {}

    var f: bug = new bogues();

    addChild (f);

    var fn = Math.round (Math.random () * 2) + 1;

    f.gotoAndPlay (fn);

    f.x = Math.random () * stage.stageWidth;

    f.SP = Math.random () * 7;

    f.addEventListener (Event.ENTER_FRAME, animate);

    f.addEventListener (MouseEvent.CLICK, klik);

    }

    function klik(e:MouseEvent) {}

    e.target.visible = false;

    iscore += 1;

    score. Text = iscore.toString ();

    }

    function animate (e: Event) {}

    e.Target.y += e.target.sp;

    if(e.Target.y > stage.stageHeight) {}

    -health;

    trace (Health);

    e.Target.y = - 20;

    e.Target.Visible = true;

    {if(health==0)}

    gotoAndPlay ("gameover")

    }

    }

    }

    ============================================

    You lose life because you are not to remove bugs or their listener but only making them invisible

    function klik(e:MouseEvent) {}

    e.Target.Visible = false;

    iscore += 1;

    score. Text = iscore.toString ();

    to this code

    var delbug = e.currentTarget
    delbug (Event.ENTER_FRAME, animate) .removeEventListener;

    removeChild (delbug)

    }

    --

    http://ww.darshanrane.com

  • Need help with drag and drop

    IM really new to this program as a

    day new hehe and I need help. im making a game quiz and your supposed

    ED to score in the hoop with a circle.  I have the

    codes for the drag and drop for the circle, but I need help with the collision between the Hoop and the ball, I want to go to the image next or gotoandPlay when the ball touches the ring. HELP PLEASE

    You should not attach code to objects.  and you can be able to happen by using a loop.

    Start by removing all the code the suggested by maqro (i.e. as3) and by removing all the code attached to objects.

    use:

    {yourobject.onPress = function ()}

    this.startDrag ();

    }

    {yourobject.onRelease = yourobject.onReleaseOutside = function ()}

    this.stopDrag ();

    {if (this.) HitTest (whatever))}

    do something

    }

    }

  • HP laptop: need help with internet and search for things

    whenever I'm on chrome internet explore google ect and go to tab it is says unknown error or no internet connection or anything and just takes me chrome ect. I need help with this im involved in a byod class and my computer won't let me on what whatever usually it just starts out black and white and the seeds I my search request

    Yes it's a Windows 10 and it arrived already installed I'll take the other info now

  • Need help with sizing and save files in batches

    Hi need help with a project.

    I have thousands of vector files that I need size of 350px X 350px, and then place it on a work plan x 600px-600px.

    Then I need to save it to the web as a PNG with a transparent background.

    Could I do a script for? or is there another way to do it in batches?

    I wouldn't have to open them one by one and resize the work plan then the image and save it one by one as that would take forever.

    Any help some suggestions would be greatly appreciated.

    ID do as a series of actions photoshop if the end result is png,

    pro image processor can help you make automatically, if you must resize batch additional... >

    https://sourceforge.NET/projects/PS-scripts/files/image%20Processor%20PRO/v3_2%20betas/

    I think that your work can run in a few steps, but for simplicity, I would like to start / test with a new photoshop action recording

    Open a file, change the size of the image to 350 x 350

    Change the canvas size,

    then save under...

  • No support for pse4, don't need help with aid and all the rest. What is a layer? How can I get help PDF from CD? I don't have any idea how to use it. I have a Macbook pro.

    Need help with using pse4 not taken in charge by adobe. How subjects do not available and I have never used something like that. Aide said there is a download but have not been able to do. What is a rookie to do? Y at - it somewhere that I can go to learn how to use PSE4?

    To find out how your problem:

    http://kb2.Adobe.com/CPS/402/kb402107.html

    To get help from the CD files you double-click in the finder, go to PDF help and drag it to the desktop or elsewhere.

  • Need help with as3 for pop-up window

    I'm nearing the end of the semester in my Flash Animation class. I learned things very simple AS3, extracted etc. code. I'll try to find the actionscript code to encode a simple popup window, but have not found a clue.

    Here's what I want to do... I have a white box with a certain guy on the stage. When a person clicks on the white box, I want a popup to open which is larger, which contains the same type but bigger. This box will have an x, so it may be rejected. I don't want to do it in html, only in Flash CS5. I don't want a browser window, I want just a larger version of the smaller area. I know how to build the two boxes, do not know how to write the code. I know there will be a click on the mouse event listener, and then I'm lost.

    Can someone help with the code that I could use? It would be most appreciated.

    It would be something along the lines of... (using the names of instance from your description)...

    Popup.Visible = false;

    whiteBox.addEventListener (MouseEvent.CLICK, showPopup);

    function showPopup(evt:MouseEvent):void {}

    Popup.Visible = true;

    }

    popup.popupX.addEventListener (MouseEvent.CLICK, hidePopup);

    function hidePopup(evt:MouseEvent):void {}

    Popup.Visible = false;

    }

  • Urgent need help with find and change / GREP

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    gd247 wrote:

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    No need for GREP. If "TABLE 7.1:" is text, you can create a nested character style that extends through the colon, in the paragraph style. "

    If "TABLE 7.1:" is created by a numbered list of automatic type paragraph style, you can specify a character style named for the part of automatic numbering in the drop-down menu Style of character, in the Style of numbering of the chips section and numbering of the dialog box Options of paragraph style. If the character style does not exist, you can stay in the operation of paragraph options by choosing 'New Style of character' in the menu. After you create the new style, you're back in the process of definition of the paragraph.

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • Need help with WRT54G2 and network at home

    OK, I got the WRT54G for a long time and recently updated for the WRT54G2 but now can't access the file sharing and running Windows Vista from Windows XP using wireless.

    Here is my set upward,

    Desktop running Windows Vista connected to the router (that's the computer with folders and printers)

    2 - Windows XP laptop computer connected wireless

    All 3 are defined on the same workgroup can be seen on Windows XP machine when you go to, favorite network, also all can get on the internet.

    Any ideas what the problem might be? I'm guessing a setting somewhere but I was not able to find it.

    After a lot of research and help from this forum, I finally got to work, it was a firewall issue

    Thanks for the replies.

  • Desperately need help with the Flash tool bone

    Hello, I recently started to animate with flash and I have a very annoying problem with the BONE tool. I can't apply the bone to Jpeg etc. I import my images for flash and have tried to make the symbols etc., the only thing that worked it is breaking apart. Then when I use the BONE tool it cuts the image on the screen

    PIC of the problem

    1.jpg

    2.jpg

    Trying to animate his arm, no luck. Is there something im missing?

    If it's important, specifications and software:

    Adobe Master Collection CS5.5 commercial version

    I7 2600 k 3.7 Ghz

    16 GB RAM DDR3

    Config Raid 6 to HARD drive

    GTX 580 x 2

    Thanks in advance, Karl

    No, he just put in place and make sure that test the various movements of the arm before you start to create poses for the frame. If you take a look at the example file (using clips), you will see that the symbol is slightly overlap at the level of the joint and the transformation point is also at the level of the joint. If you want your figure to change when you move it then your image must not be bitmap and vector.

  • Need help with html and as3 dropdown

    First of all Hello!  I need to create a html for a company Web site. The design that I did is in photoshop... .and I need to create a menu drop-down. The first question is: can I create the drop in flash without having to use html frames? Can I connect one of the menu buttons in an html page so that it loads in the same window of the browser to another html page (If Yes... with what?)?  Please... I need to know... because I prefer simply to apply it in flash rather then html. And the second question is: If the scene in flash can be transparent? Because if I do the menu inside, it will be impossible to match all the dimensions of the stage... and I would like to integrate it in an html page, if possible without the stage color >... Thanks in advance!    Tudor

    For the opening of the pages you wish to study using the navigateToURL() function.  The help documentation provides information abiout it year how to control the appearance of the window as well.

    To make the transparent scene is more than a html one aspect of Flash element, if you can set it to publish it.  The key is to set the wmode paraemter which is located in the "transparent" html embed code  I don't know if all browsers supports this feature, but I think that many are willing to.

  • Desperately need help with simple program crashing using Qt and stdlibc ++

    I have a really trivial example that I was unable to get it running no matter what I try. I use ndk2.0.1. The configuration to recreate the problem is simple; the project should link to qt (4.8.2) and stdlibc ++ (not libcpp, libstdc ++).

    (main.cpp)

    #include 
    #include 
    int main(int argc, char *argv[])
    {
        std::cout << "This doesn't work\n";
        return 0;
    }
    

    That's all. You can use any toolchain you want (ntoxg ++ or CQS), seems not to matter. If you use the string of tools qcc, you must explicitly include the paths libstdc ++ and link to him, because it uses default libcpp. Build the project: it should compile correctly. The handle bar I used is here (http://pastie.org/4018541).

    Create the folder bar and deploy. Once I have started the program at this point, it show me the splashscreen for a few seconds and quit (crash)... You will notice:

    * No log output (we expect something of the call cost)

    * a nice base file pending crash

    Browsing the ntox-gdb core file gives you:

    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    36  atomicity.cc: No such file or directory.
        in atomicity.cc
    
    (gdb) backtrace
    
    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    
    #1  0xb8b03471 in __exchange_and_add_dispatch (__val=,
        __mem=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/ext/atomicity.h:79
    
    #2  _M_remove_reference (this=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/bits/locale_classes.h:505
    
    #3  std::locale::~locale (this=0xb837d5fc, __in_chrg=)
        at ../../../../../libstdc++-v3/src/locale.cc:89
    
    #4  0xb8b0faa9 in ~basic_streambuf (this=,
        __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/streambuf:193
    
    #5  std::basic_filebuf >::~basic_filebuf (
        this=0xb837d5e0, __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/fstream:215
    
    #6  0xb0bbd205 in __cxa_finalize ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #7  0xb832de67 in _btext ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #8  0xb836a265 in _fini ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #9  0xb0bd46d3 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #10 0xb0bd5d38 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #11 0xb0bbd052 in _cleanup ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #12 0xb0bbd337 in exit ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #13 0x080487b0 in _start ()
    

    I have no idea what to do with this stack trace and I was not able to debug the problem more far.

    This question is particularly messed because I did not add any code to Qt on demand; just link to bookstores. Do not link to the Qt libraries will make this piece of code will work perfectly. A link to the Qt code with libcpp instead of libstdc ++ will also code to run as expected.

    This problem has been driving me crazy for the last days coueple and I would really really appreciate help or advice.

    KDAB guys told me it's a bug and they're looking into it.

  • Need help with menus and lists

    Hi, first of all, im new here and im hoping to get help

    I have a school assignment to do with dreamweaver, where I need to build an e-book

    Specifically, Ive got a roll more images that I was planning to do a menu bar on

    I was told to use spry, but they help at all.

    I was hopeing that my reversal, buttons could be roles more and a list/menu appears, such as on many sites

    Like this one http://projectseven.com/tutorials/navigation/auto_hide/workpage.htm

    (with a black background which comes down from the roll over image)

    How would I go about this

    I don't have much experience with CSS aswell

    A tutorial or any help would be appreciated

    Thanks in advance

    Arron

    Get rid of the image swaps, they add nothing to your page and the code is horrible.

    Copy and paste your code top table in the page menu above the list.

    Copy and paste your low table code in the menu page below lists.

    Validate your code, it should work.

    Code Validation tools
    ------------------------------------
    HTML - http://validator.w3.org/

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • I need help with copy and paste does not

    I already asked this question, but no one seems to want to help or does not know the answer.  I can't afford to pay microsoft $49 help. It is their dang opertating system and you would think they would help the customers who buy their products.  Don't think!  Please, someone help me.  I am a graphic designer and need to copy and paste all the time, but it does not work.  It's so frustrating.  Should have bought a Mac time... next.  If no one here can help... where can I go for help?  Here the question again.

    Copy and paste the orders have stopped working in all my software programs (Photoshop, CorelDraw, Corel Painter, etc.).  When I type "copy", or "control c", it crashes and whatever program I use becomes inoperative, as well as all my programs, until I can get the specirfic program to close.  I ran Services.msc to ensure than the Clipboard (did not find Clipboard so I assumed it was changed to album) has been activated, which he was, but when I click on 'Start service' it says "cannot start service on local computer album.  "Error: 1068: the dependency service or group could start. It started several weeks ago and I have not installed new programs during this period.  Only my computer display was the automatic updates of Windows.  It's very frustrating... How can I copy and paste to work.  I got this computer less then 4 months.  Thank you

    To all with this problem, try this:

    http://support.Microsoft.com/kb/309662

  • Need help with charger and power adapter

    I can't find my charger for HP Elitebook 8570p.

    I need the specs for the power supply cable and adapter. If anyone can help. Be good if you have a photo too.

    Hello:

    You can find the necessary information in Chapter 3, pages 51 and 52 of the repair... Articles and part numbers.

    Power cords are classified separately according to the countries.

    http://h20628.www2.HP.com/km-ext/kmcsdirect/emr_na-c03565466-1.PDF

    The 90 Watt adapters are larger that the 65W those, the latter are more suited to travel with.

    If you want the 65 W adapter, then you want this one...

    AC adapter smart HP 65 W (RC/V, EM, 3-wire) HP Part # 693710-001

Maybe you are looking for