How to get the NetConnection out of a flvplayback component in AS3?

http://www.flashcomguru.com/index.cfm/2009/8/14/flvplayback-obtain-nc-reference
I followed the above example in AS2,but only get the error:
Call to a possibly undefined method getNetConnection through a reference with static type fl.video:INCManager.
Here's my code:
             this.addEventListener(Event.ENTER_FRAME,
                                   function() {
                                       if ((nc = player.ncMgr.getNetConnection()) != undefined)
                                           trace(nc);
Anyone knows how to do it in AS3?

This has worked for me.
package  
com.video{
import flash.display.Sprite; 
import flash.events.*; 
import flash.media.Video; 
import flash.net.NetConnection; 
import flash.net.NetStream; 
public class FLVStream extends Sprite{
public static const ERROR:String="vidError"; 
private var videoURL:String = ""; 
private var connection:NetConnection; 
private var stream:NetStream; 
private var vidW:Number; 
private var vidH:Number; 
public function FLVStream(arg_url:String,arg_w:Number,arg_h:Number){
videoURL = arg_url;
vidW = arg_w;
vidH = arg_h;
connection =
new NetConnection();connection.client=
this;connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(
"rtmp://FEED GOES HERE/");}
private function netStatusHandler(event:NetStatusEvent):void { 
switch (event.info.code) { 
case "NetConnection.Connect.Success":connectStream();
trace ("success connecting"); 
break; 
case "NetStream.Play.StreamNotFound": 
trace("Unable to locate video: " + videoURL);dispatchEvent (
new Event(ERROR)); 
break;}
private function connectStream():void {stream =
new NetStream(connection);stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
var client:Object = new Object();client.onMetaData = onMetaData;
//client.onBWDone = onBWDone;stream.client = client;
var video:Video = new Video(vidW,vidH);video.attachNetStream(stream);
stream.play(videoURL);
addChild(video);
private function securityErrorHandler(event:SecurityErrorEvent):void { 
trace("securityErrorHandler: " + event);}
private function asyncErrorHandler(event:AsyncErrorEvent):void { 
// ignore AsyncErrorEvent events.}
public function onBWDone():void{ 
trace("onBWDone");}
public function onFCSubscribe(info:Object):void{ 
trace("worked");}
public function onXMPData(infoObject:Object):void{
//trace("onXMPData Fired\n"); }
public function onMetaData(infoObject:Object):void{
//trace("FLVPlayer -> onMetaData");}

Similar Messages

  • How to get the elements out of a for loop simultaneously during the loop execution

    Hi, 
    I am student. I would like to know how to get the counter values outside the For loop parallely while the loop runs rather that getting the finally value outside the For loop. Looking forward for answers.
    Thanks,
    Athira
    Solved!
    Go to Solution.

    You could use a notifier (since it is a single value) or a reference (with a property node) to a control that gets the value elsewhere in another VI.
    If it is within the same VI, you could use a property node (right click > create > property node > value) from the control within the same VI located outside the loop.
    If you promiss NOT to abuse the use of Local Variables, you could use that to only write from ONE location within the For Loop to a control outside the loop, similar to the property node mentionned earlier.  (Of course, I will be struct by lightening for mentionning that and scolded by other LabVIEW coders for having a change of heart on the use of Locals....  Shivers are already crawling up my spine).
    You could use a queue, but that might be an overkill, unless:  the count is generated faster than it is being read elsewhere...
    As crossrulz mentionned, can you describe what you will be doing with the count?  Because synchronizing data (fresh / stale / etc) is very important within LabVIEW as it executes based on dataflow rather than a sequential order.
    Hope this helps. 
    EDIT: 
    You have not fully provided the answer.  We figured that much of your code from your description, but what is reading the value of the count?  Is it in a separate loop?  If not, it may only deal with the first value, which is likely 0.  The proper advice depends on how you process the received data (count).

  • Need advice on how to get the most out of iDVD.

    My wife and I do wedding Photography - Videography as a source of extra income.
    My question is: How can I produce the highest image quality dvd for our clients using iDVD.
    I dont quite under stand the difference between exporting from iMovie to iDVD and Sharing the
    movie from iMovie to the media browser, then opening iDVD and adding the movie that way.
    I shoot the movies with my Sony HDR-SR12 Camera and edit the footage with iMovie 09'.
    "please explain slowly and clearly" I am good with what I already know, however can quickly get
    confused when taking on new methods and or terminology...
    Thanks in advance.

    My question is: How can I produce the highest image quality dvd for our clients using iDVD.
    "please explain slowly and clearly"
    If only it WERE simple.....
    Your camera shoots HD video in AVCHD format. DVDs use mpg-2 compression and are really 4:3 devices; 16:9 content is anamorphically squeezed to the SD format. DVD players unsqueeze it on playback.
    Converting you HD AVCHD video to anamorphically squeezed mpg-2 content offers lots of opportunities for quality loss.
    You can try simply 'Sharing' your iMovie '09 movie with iDVD but I expect this will not produce maximum quality.
    I probably would choose the Share>Export using QuickTime option and then select the QuickTime Option>Video Setting of Apple Intermediate Codec. This conversion may take quite a while.
    For single layer media, if your content is under 60 minutes Best Performance encoding will probably give you the best results; if it's over 60 and under 120 minutes use Professional Quality. Personally, I try to stay away from DL media.
    What I suggest you do is create a short (say 15 minute) demo video clip and then try the various output option from iMovie and encoding options in iDVD to see what you like.
    When the iApps first came out (about 8 years ago), most prosumer video shooting was done in the DV format (digital video on mini-tape cassettes). DV is an easy format to edit because it is 'lightly' compressed and all the information needed to edit is easily accessible. The newer formats (like your AVCHD) are much more highly compressed and are more complicated to work with.

  • How to get the ipad out of recovery mode

    I tried to update my ipad and instead of updating it it is now stuck in recovery mode please help me to get out of this

    FORCE IPAD INTO RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port.
    DO NOT RELEASE BUTTON until you see picture of iTunes and plug
    5. Release Home button.
    ON COMPUTER
    6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
    7. Select "Restore iPad"...
    Note:
    1. Data will be lost if you do not have backup
    2. You must follow step 1 to step 4 VERY CLOSELY.
    3. Repeat the process if necessary.

  • How to get the table out put

    Hi
    I have a function in a package where it's out put is a table.
    I call it from FORM level procedure.
    Could anybody help me with view the data of my out put for the purpose of debugging.
    (Note: I use SQL Navigator as the db tool , Forms Builder (9.0.4.2.0))
    Rgds
    shabar

    I don't exactly know how your datablock is, the aray you are returning but you can use code like this to populate the data block.
    Write this code in when new form instance trigger.
    declare
      type pkarray is varray(100) of <table_name>.<column_name>%type; --table name on which your varray returning from function is based.
      id_arr pkarray := pkarray();
    begin
      id_arr := <function_name>; -- call to your function which returns the array
      go_block('<block_name>');
      clear_record;
      first_record;
       For i in 1..id_arr.count
       loop
           :<block_name>.<item_name> :=  id_arr(i);
           next_record;
       end loop; 
    end;You can tweak this code to suit your requirement.
    Hope it helps.
    Please mark answer as helpful / correct, if it helps you
    Navnit

  • How to get the data out of the phone when the touch panel is cracked?

    Hello,i break my front touch panel accidently, means i couldn't un-lock my phone anymore..but, there has some very important data and file in the phone memory.is it possible or any ways to get those data/files out???  i don't want to repair the front panel of this phone anymore.. (2nd time already.. ) i would get a new model.  thanks in advance.Sean

    Hi zienab_samir, welcome to the community!
    You can get an OTG cable which connects to your phones charging port, the other end of the cable is a female USB - which allows the USB of a mouse cable to be plugged into it. You can then see whether you can use the mouse to unlock the screen.

  • How to get the most out of my setup...

    As most of you know if you've read previous posts, I've recently had trouble with my hard disks, so, after I finish this project I'm ready to 'revamp' my setup, so it's ready for future use and some advice would be really useful...
    I have a Mac Pro machine, two years old, Quad-core Intel Xeon, 2.8ghz processor, 8gb memory.
    2 internal Hard Disks - 1 Capacity 297.77gb and the other 465.44gb, I've been using the smaller one as bootup disk for apps and os x and the bigger one for capture scratch.
    Then I have a USB external hard disk plugged in which is 1TB and backs up all my data with Time Machine.
    I also have one more external Hard disk, which is 297.77gb and has more input options (USB, firewire 400 and 800) but I like to keep this space to transport data, however at the moment I'm using it as a temporary startup disk with OS X and Final Cut, to finish my current project.
    So, after reading previous posts and knowing I work as a film editor, what do you suggest I do?
    My plan is to backup all files from internal disks to external ones, while I perform Disk warrior directory maintenance. I'll try to clear some data and then I'll set it up as it was.
    I can't think of a more appropriate way for it all to work?
    Ultimately I'd just like to get it back to working to its full potential, so I can do my work with confidence.
    Any suggestions?
    Thanks.

    Rendering times are pretty much based on processor speed if I have that right. Not much you can do about that other than buy a new computer. Your day to day work in the finder and accessing of files would be faster with your boot drive internal. One thing you can do is ensure your FCP System Settings are on the fastest disk you have. If you put a pair of drives internal and made a RAID volume for them you would improve your write speed when capturing and for any other read/write operations. You would have to be sure you kept that backed up properly because you double the odds of a failure when two drives spread the data between them. There are many RAID options.
    You could also bump up the RAM but you'd have to look at your processes to see if you are being limited by RAM. I'm guessing not but it's not impossible. If you are accessing scratch disks due to RAM limitations that would be one thing you could do.
    I would never bother connecting an external via USB if there was an esata or firewire option. I use an esata card internally to give me access to estata storage. I also keep an external FW800 drive for a mirror backup of my boot drive. All my data and booting is internal with all my backups external. Each internal has an external and I have additional externals that I keep off site to protect against fire and theft.

  • How to get the most out of a Macbook Pro?

    I'm about to attend Full Sail University for a baccalaureate in Game Design. They'll be sending me a brand new macbook pro with a bunch of software, and I'll be using it 8+ hours per day. I want to have this laptop last at least the 4 years I'll be in college, and then some. What are some things that I can do to make sure this thing stays in top condition?
    I've already looked around for some cooling pads, as I know that would be one essential. What are others?

    If the school does not purchase it, then you should - Apple Care Protection Plan. 

  • How to get the number from a xml file to flash as3 Text Box "Get_Days"?

    Hi,
    I have to daily update the number of days finished from the specified days. Say, One work to be finished in 30 days. And the start day is today. So, tomorrow it will be 29 days left. and so on....
    So, instead of reducing one number everyday from the last days number using flash, it will be easy changing in xml file.
    How can I do that?
    I have a simple text box "dynamic text box" and the instance name : "Days_Left". Since I am learner, I cannot make complex projects. I am learning small things with very few lines of code which can be modified using xml files.
    So, Whatever I type in a xml file, it should appear in a text box called "Days_Left".
    Thanks.

    then you can use:
    var currentDate:Date = new Date(); 
    // this is today's date
    var projectDueDate:Date = new Date(2010,11,29); 
    // use whatever date you want for the due date.
    // months are zero-based.  (ie, jan is month 0, dec is month 11.)
    var daysToCompleteProject:Number = (projectDueDate.getTime()-currentDate.getTime())/(1000*60*60*24);
    // this is number of days between currentDate and projectDueDate.  you probably want to round or use days:hours:minutes for your display

  • I installed iworks on my mac pro.  how do i get the disk out of my laptop

    I installed iworks on my mac and I don't know how to get the disk out.  please tell me how to get the disk out of my mac.  thanks

    The Mac Pro is not a laptop. If you're talking about a MacBook Pro, you hold down the eject key at the far top right of the keyboard until the disk ejects. You can also drag the disk's icon from the desktop to the trash.
    Matt

  • HT2293 How do I get the sensor out of my shoe

    I just got a pair of Nike free run 3's. I just need to know how to get the sensor out of my shoe to activate it

    Never mind, I was ripped off and didn't have a sensor in my show

  • How Can I get the MOST out of my Ipod?

    greetings yall!!
    Sean Price in the house.. this is NOW my third Ipod..its the Product RED Ipod Nano.. mad nice..
    but I feel as if I'm missing something.. I mean all I do is put music on there and JUST NOW i have learned to put my music videos on it..
    BUT come on.. I have heard YOU can do SO MUCH more then just that..
    I mean its like i have these video Ipods and I'm just using them as SHUFFLE ipods, you feel me?
    I mean I also have the red shuffle 2nd generation Ipod as well... and for that one yeah it makes sense all I CAN DO is play music on that one..
    but please SOMEBODY please give me the FULL breakdown on how to get the MOST out of my Ipods..
    PLEASE do advise!!
    I want it all, games!!! hacks, other OS's whatever.. just somebody school me!!
    THANK YOU!!!

    Click here for information.
    (30988)

  • Get the most out of a Mega PC

    Hi. I'm new :D
    I recently bought a Mega 651 to make a bit of a media project
    [that I don't really need since my internet PC is already next to the TV and stereo]
    and now I am looking at how to get the most out of it.
    So I'm interesting in knowing what you've done, or know can be done, with this box. Be it software, hardware or modifications. I know there are alot of threads out there, and I've read alot of them, but I wanted to do a new one which focused a bit on possibilities.
    I've fitted mine with a celeron 2.4, 1 gig ram, and a 80 or so GB HDD.
    The box is as noisy as a 21" industry rack   I have to do something about it.
    Some of the blame has to be put on the disk and I'm gonna replace it when I have time for two windows reinstallations  
    So, here are some conversation starters.
    Motherboard
    MS-6760. Does it conform to any size/form standard?
    Are there other motherboards that can be fitted into this box?
    Would the boards of other Mega PCs fit? Are they available for sales?
    Power Supply Unit
    Something is making noise, even when I remove the hard drive.
    The PSU in my box is a FSP250-60MS, max 250 W.  
    However, on a review I saw it to be fitted with an ENHANCE ENP-2920, 200 W.
    I understand the PSU is custom made to give power to the HIFI parts. But are there alternatives that will fit? Are there alternatives if I don't need the radio/CD? Or are the dimentions all wrong anyway... (Measured it to roughly something like 7x14x10 cm)
    System fans
    The PSU, the CPU and the mainboard have fans. Has anyone had any luck in reducing noise by replacing any of these? What is required (screws, soldering...), are the fan sizes standard? Did you burn down your house?
    Remote Control Unit
    I believe the key word here is "Girder". I've briefly encountered this program before - a program to read the signal of a remote, and assign actions. If I remember correctly, it is not freeware? Is it so, that the remote can be used with  Girder? Will Girder read another remote on the same sensor? Are there alternatives to Girder?
    Display
    From what I've read, this display is no fun what so ever. Or? Anyone done anything neat with it?
    TV/Video
    I have a ATI all in wonder lying around somewhere, TV tuner and video out. Are you people all using the default TV software or are there alternatives worth playing with?
    Radio Software
    Anyone using something other than the default MSI software?
    Media Center Software
    I've never tried anything like Media Portal and frankly I'm a bit uncertain of what makes it different from a media player. What are you using, and why?
    Anything else you'd like to mention?
    Please do!
    It's okay if you point me to another thread that already describes something like this, as long as you leave a hint at what you're finding interesting in the other thread. And you only have to answer the questions you want to
    Let the ideas flow.
    .t

    here are a few replies to your queries about the Mega 651:
    Motherboard:
    this is a custom built board designed for the mega 651. you might find that the boards in other megas MIGHT work, but they are not available for sale
    in any case, i think the 865 and 180 would be different anyway as they use a different LCD display and i imagine the connector might be slightly different
    Power Supply Unit:
    again this is a custom design for the Mega series, the only way you might quieten it down is by opening it up and replacing the fan for a quiet type
    System fans:
    having looked inside my mega 651 a few times, there is only one fan for the CPU, the chipset is passively cooled. the cpu fan noise has never really bothered me as it is temperature controlled - when the cpu is under load it does speed up, when it is not it stops! as far as i can see, the heatsink/fan is also a custom design
    Display:
    forget about it - msi won't release any SDKs for this and probably never will
    TV / Video:
    you can use any tv card and its software that you are happy with - there is no specific reason to use an MSI card
    media center software:
    the intervideo software provided with the mega 180 and 865 also works with the 651 (if you can get hold of it anywhere). however it is a load of rubbish, and if you do need anything like that, then media portal is going to be your best bet
    find out more at http://mediaportal.sourceforge.net
    the trick with these mega pcs is not to expect too much from them!! they are a nice idea, but i think they were rushed to the market too soon in order to steal a march on their other SFF rivals - the next generation of mega PC will hopefully address all the issues we've experienced and make them proper HTPCs!!
    good luck!

  • How to get the most of PowerBook G3 233Mhz

    its been a while since I dint post on Apple discussions, about one year ago, I was thinking I would get a PowerBook G3 Pismo, one year later evry thing was diffrent, I ordered a 233Mhz PowerBook G3 Wallstreet (It was the only choice with the money I had) and now I really want to know how to get the most out of it.
    I want to do the following
    -Browse the web
    -Listen to music
    -do keynote presentations
    -word proccesing
    -storage
    The powerBook that I am going to get comes with a nice 233Mhz G3 chip, 64MB of RAM a 12 inch screen and running Mac OS 9.2.2 (my favorite).
    I have alot of knowledge on old Macintosh, and I know almost anything if some asks me things about acient macintosh, but you know, some times you need a little help from other mac fans and share your thoughts...
    So what apps should I get? I do know that if you use the commom low requirements apps, It will run smoothly.

    iBook,
    Yes, you can add a USB 1.1 or 2.0 PC card to the PCMCIA/CardBus slot. A few suggestions:
    -Combo FireWire/USB CardBus PC cards do not work well with OS 9.x; either the USB or FireWire port does not work. This is a software problem in 9.x since these combos work fine under 10.x. My suggestion would be to buy a separate USB PC card and/or FireWire PC card for your connectivity.
    -USB 2.0 PC cards will only run at the slower USB 1.1 speeds under 9.x but this is fine for printers, etc. If you wanted to connect an HD, I would use the FireWire interface.
    -FireWire and USB PC cards supply insufficient bus power to power a FireWire or USB HD; any device like a printer or HD will have or should have its own power supply.
    -Since FireWire and USB are not native to the Wallstreet, the necessary USB and FireWire extensions have not been installed. Open your Extensions Mananger and see if you have these extensions:
    USB Mass Storage Extension
    USB Support
    USB Mass Storage Support
    USB Software Locator
    USB Device Extension
    If the above are not present, I recommend you download this USB extension package from OWC; they assembled various version numbers of the Apple USB extensions to correct a problem OS 9.2.2 has with USB PC cards but they can be used with any version of OS 8.6 > 9.2.2.
    http://eshop.macsales.com/tech/ftp/usb/usbextensions.sit
    A file titled 'usbextensions.sit' will appear on your desktop assuming you have set the browser to download files to your desktop. Double-click the file to decompress it and you will have a folder on the desktop with these extensions:
    USB Support v1.4.1
    USB Software Locator v1.5.6
    USB Device Extension v1.5.6
    USB Mass Storage Support v2.0.4
    USB Mass Storage Extension v2.0.4
    Highlight all five extensions, then drag them on top of the closed System Folder icon; they will be automatically installed in the Extensions folder. Before restarting, go to Apple menu > Control Panels > Energy Saver > Advanced Settings and uncheck 'Allow Processor Cycling' for •BOTH• the power adapter and battery. If not unchecked (disabled), the powerbook will freeze with a USB PC card.
    Now restart to make the USB extensions active. Insert the USB PC card; you should see a USB PC card icon on the desktop. Connect a USB mouse (there is sufficient power for it) and test the USB PC card.
    If no desktop USB PC card icon appears, make sure the PC card is fully inserted. You may have to place a hand on the side of the powerbook opposite the PC card slot so you can push hard. If the card fails to seat, the card slot may be in the locked position. Push an opened paperclip into the small hole next to the slot to unlock, then try the card again.
    http://docs.info.apple.com/article.html?artnum=16167

  • I have an iPOD mini library and now have a IPhone 4S.  I updated my library and synced my phone to the library but can not figure out how to get the music library to download to my  iphone

    I have an iPod mini library which I have update. I now have an iPhone 4S which I have synced to the library using a MS XP computer. I can not figure out how to get the library to download to my iPhone?

    Thanks,  This caused me to go back and try again since the solution seemed so simple.  What I did was when it started downloading, it started with the iphones apps to my computer.  I did not want the apps downloaded on my computer so I stopped it.  If I would have waited, the music was uploaded right after the apps were downloaded.

Maybe you are looking for

  • Memory upgrade to 1GB RAM on Satellite A60

    I have Satellite A60 and I want to update the memory from 256MB to 1GB Please can I do it?

  • If my code displays a recordset, how can I limit the number of results to display?

    I have the code below: <div id="content">     <table width="998" border="0" cellspacing="4" id="stuff">         <?php do { ?>           <tr>             <td><?php echo $row_Recordset1['name']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetc

  • How do you go about purchasing microsoft word for your mac laptop?

    i was just wondering how you go about buying microsoft office for your mac air? can you buy the package online and download it? or do you have to go into a retail store and physically purchase it? thanks

  • How to lock a Particular Scenario

    Hi, I would like to lock a particular scenario. The situation is like this: I have 2 cubes MTHCLS and MTHDEF, All my numbers and scenarios are on MTHCLS. MTHCLS is an ASO cube. I have given the read access to all the groups for this cube. MTHDEF is a

  • Webi report display splits a column

    Hi fairly new to Webi so I hope this doesn't sound too basic. I have a Webi report that is 30 odd columns wide (this is currently BOXI R2 on Windows 2003); it's displayed in Landscape mode and splits several columns down the middle. How can you defin