actionscript 3 - image from xml in as3 -
actionscript 3 - image from xml in as3 -
i'm new as3 excuse me if i'm not using right terms. have xml file periodically update twitter info. i'm able dynamic text xml file loaded fine, don't know how image loaded , onto stage. xml has image file name listed. pic save c:\twitter. can help me?
code:
import flash.net.urlrequest; import flash.net.urlloader; import flash.events.event; var xmldata:xml = new xml(); var theurl_ur:urlrequest = new urlrequest("streamcontrol.xml"); var loader_ul:urlloader = new urlloader(theurl_ur); loader_ul.addeventlistener("complete", fileloaded); function fileloaded(e:event):void { xmldata = xml(loader_ul.data); picfilename.load = xmldata.twitter.picfilename; username.text = xmldata.twitter.username; twittertext.text = xmldata.twitter.text; }
here xml file
!doctype streamcontrol> <items> <timestamp>1402974867</timestamp> <ap1>bankai213</ap1> <ap2>princemurphy</ap2> <bp1>d3v</bp1> <bp2>gptv|iori sei / reiji</bp2> <cp1>hamill</cp1> <cp2>stonehead</cp2> <dp1>eat jolly hotdog</dp1> <dp2>ricardo fellini</dp2> <ep1>jav|krimpai</ep1> <ep2>hashtag2dlifetnk1</ep2> <fp1>jav|krimpai</fp1> <fp2>btas|conroy</fp2> <gp1>mark hamill</gp1> <gp2>kr|swordy</gp2> <ctitle1>current topic</ctitle1> <ctitle2>spurs/heat</ctitle2> <mtext1></mtext1> <mtext2></mtext2> <mtext3></mtext3> <mtext5></mtext5> <pcountry1>ph</pcountry1> <pcountry2>us</pcountry2> <pname1>dru</pname1> <pname2>princemurphy</pname2> <pscore1>0</pscore1> <pscore2>0</pscore2> <twitter> <username>mashable</username> <twittername>mashable</twittername> <text>listen these 23 songs feed rebellious side. #musicmonday http://t.co/xl4wpdhix1 http://t.co/4yrsdqyzyr</text> <created>tue jun 17 03:01:29 +0000 2014</created> <picfilename>5c348fee8afbcefa1978004a864a51ce.png</picfilename> </twitter> <game>vampire savior</game> </items>
xml actionscript-3
Comments
Post a Comment