How to pull videos from xml AS 3.0

Hello all,
I am pulling  videos form an 'video API' called 5min which is in xml format.
using the below code :
naming my video player instance as = videocontainer
XML.ignoreComments = false;
XML.ignoreProcessingInstructions = false;
import flash.events.TimerEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
import flash.ui.Mouse;
import fl.motion.MotionEvent;
import flash.net.URLRequest;
import flash.display.Shape;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.net.URLRequestMethod;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.media.*;
var url:String = "http://api.5min.com/search/videos.JSON?q=";
var req:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader();
loader.load(req);
loader.addEventListener(Event.COMPLETE, completeHandler);
var myxml:XML;
function completeHandler(evt:Event):void{
myxml = new XML(evt.target.data);
var fl_NC_2:NetConnection = new NetConnection();
fl_NC_2.connect(null);
// starts a connection; null is used unless using Flash Media Server;
var fl_NS_2:NetStream = new NetStream(fl_NC_2);
fl_NS_2.client = {};
var fl_Vid_2:Video = new Video();
fl_Vid_2.attachNetStream(fl_NS_2);
addChild(fl_Vid_2);
//videocontainer.play("http://avideos.5min.com//423/5180423/518042244_2.mp4");
var media:Namespace = myxml.namespace("media");
videocontainer.play(myxml.channel.item[0].media::content.@url);
out put:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at tesvideo2_fla::MainTimeline/frame1()
TypeError: Error #1088: The markup in the document following the root element must be well-formed.
          at tesvideo2_fla::MainTimeline/completeHandler()
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at flash.net::URLLoader/onComplete()
Can some one kindly help, where i am making the mistake. thank you

could it be sth as simple as having two slashes in an URL:
http://avideos.5min.com//423/5180423/518042244_2.mp4
If i give link, i wud end up displaying only preticular video. in fact i tried it and commented on my code since it will not help with my requirment.
yeah a videoservice called 5min, which is a property of my office here is the link to "5min API" 
http://api.5min.com/search/videos.JSON?q=
this API will be updated everytime we upload a new video same as RSS.
So I wanna display latest video same as like how we do RSS feed.
Hope i am clear this time atleast.

Similar Messages

  • How to delete video from iTunes library? del and shift+del are not working - no any reaction

    how to delete video from iTunes library? del and shift+del are not working - no any reaction.

    seb963 wrote:
    Hi
    Currently, iMatch is turned off on my computer, as I do not want to upload any more songs. If I turn it on, will it upload all songs that are currently in my library? Is there another way that deleting them one by one?
    You must enable iTunes Match on the new computer. The best way to accomplish what you want to do is to create a new, empty library by launching iTunes while holding down the Option key (Shift on Windows) and choosing "new library." Do not let iTunes scan for new content, but do enable iTunes Match on the empty library. Once the scan is finished you may delete tracks from the cloud. When you are done switch back to the main iTunes library.

  • How to delete video from iTunes library

    Hello, I've only had my ipod for a few weeks now. I've finaly figured out how to rip dvds/encode them, etc. During this trial and error period I was putting all kinds of junk in my itunes library.
    My question is how to remove videos from my itunes library.
    ..one more question.
    I've been using a dvd ripper and video converter made by Xilisoft. After I import the movie from my pc to itunes video library and ipod, I've noticed that the audio doesn't match up with the video. Its like watching a poorly dubbed kung fu movie. Has anybody used Xilisoft software and had the same problems? If so, what did you do to recify the problem?
    Thanks in advance for any help.
    self-built   Windows XP Pro  

    OK, I finally figured it out. I still don't have the clear option available. I had to double click on video, highlight, then press delete.
    I'm curious why I don't have a clear option like I do in library.
    Oh well, at least I can delete old files from my itunes now.
    Thanks for the quick responses.

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • How to transfer video from hard disk to i tune?

    how to transfer video from hard disk to i tune? can any one please?? help me also in guiding if  anything else is required to be done to transfer the content to ipad....

    Drag it into the open iTunes application window. You may need to use a product such as MPEG Streamclip to convert it to MPEG-4 first.
    (59829)

  • How to transfer video from macbook to ipad2

    How to transfer video from macbook to ipad2

    Haryati-
    I found your question while researching another one on the same topic.  I found it hard to believe that iPad videos could not be transfered to a computer!
    I made a short video on my iPad 2.  It showed up in the Photos camera roll.
    Running iPhoto and connecting the iPad to my Mac Pro, I selected the iPad under DEVICES.  The video was at the end of the photos, I selected it and clicked on "Import Selected".  I then dragged the imported video to my desktop and it played in QuickTime Player when I double-clicked it.
    Then I tried it with Aperture.  The dragged copy appeared to play in QuickTime Player, but the screen was black.  However an Exported Version played correctly.
    Fred

  • How to import videos from iPhone 4 to PC?

    I'm trying to get a video that I recorded and edited with my iPhone 4 and iMovie, on my PC so I can share it with others. It won't email because the file size is too big (but the video is only 1:20...) and I uploaded it to YouTube but they removed the audio because it's copyright infringment. I've going through My Computer and a few other things and all the photos get imported but when I try and play an imported video it won't load and just freezes. Any tips?

    http://lmgtfy.com/?q=how+to+import+videos+from+iphone

  • How to transfer video from pc to iphone

    how to transfer video from pc to iphone

    Welcome to the Apple Community.
    Put it in iTunes and sync it.

  • How to get videos from touch, in full resolution?

    How to get videos from touch, in full resolution?
    I tried email, but that compresses them.

    Import them as you would from any digital camera.
    http://manuals.info.apple.com/enUS/iPod_touch_iOS4.1_UserGuide.pdf

  • How to remove Unicode from XML file

    I get following error when unmarshal xml:
    [java] org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
    Anyone know how to remove Unicode from xml file? Can I remove the unicode by rebuild the file?
    Thanks

    These sort of error usually occur when you're using a different character encoding to read the file than the one you wrote it with. Perhaps if you were to post the problem section of the file and/or the code that created it in the first place.

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • How to get videos from my camera on ipad 2 to my iMac

    how to get videos from my camera on ipad 2 to my iMac

    Photos/videos in the Camera Roll can be imported by your computer as with any other digital camera.
    If you use iPhoto for this with any other digital camera, you can use iPhoto for this. Or you can use the Image Capture application for the import if you don't use iPhoto.

  • How to get video from archived DVD projects (.dvdproj)

    how to get video from archived DVD projects (.dvdproj)

    Command (right) - click on the archived project file to open the package with the Finder. Go to the Contents/Resources/Assets/AV folder where the media files are stored.
    OT

  • How to pull data from oracle GL to planning

    Hi all
    Can one suggest me how to pull data from oracle GL in to hyperion planning(we are using hyperion planning 9.3 with limited licence for analytic services). i guess we can use HAL ..any thing else
    any help is appreciable
    regards
    M.V

    Hi
    I appreciate for your response. Yep you are exactly right it is data only, but I do have a problem these people have their licence of limited version of Essbase.
    Let me give you the information of their licence agreement.
    The licence for the hyperion planning- sytem9 programs includes a limited use license for both the hyperion Essbase- system 9 and hyperion Financial reporting - system 9 programs. Such limited use license means that the hyperion Essbase- system 9 and Hyperion financial reporting -system 9 programs may only be used to access data from the Hyperion planning -system 9 program.
    Specifically, the hyperion essbase- system 9 program cannot be used to create Essbase cubes that do not contain data used by the Hyperion planning- system 9 program and the Aggregate storage option component of the Hyperion Essbase - system 9 program may not be used.
    1) what it(licence agreement) really means - can you install Essbase, if not how can you create dimensions dynamically using planning.
    2) Is it possible without Essbase as far as I know its not possible
    3) are we going to face any issues with this licence.
    4) Is it possibe to pull data with planning
    I appreciate if any one resolve this issue
    regards
    M.V

  • Can anyone explain how to download videos from iPhoto to view on my apple tv?

    can anyone explain how to download videos from iPhoto to view on my apple tv?

    Welcome to the Apple Community TKBsr.
    Add them to iTunes and view them through Computers > Home Video.

Maybe you are looking for