I have implimented a video handler class to part of my project. What it is intended to do is remove the playing video using the netStream method and create a new instance with a new video file.I can remove it using a standard removeChild function. However the pain occcurs when I can still hear the audio palying.I guess my issue is that this is handled in a class and every time I create a new video it creates a new instance of the class.My question is then how do I call netStram.close() from another class before creating a new video instance.[code]
i have a problem with a back button when i click BACK the video of the FLV video component continue and also when i'm back in the home page i can hear the sound...how can i stop it here is the code of my back button
stop(); back_btn.addEventListener(MouseEvent.CLICK,backvid eo); function backvideo(event:MouseEvent):void { gotoAndPlay("1"); }
the video instance name is my_video I try to put my_video stop(); but nothing
On the Flash client side,how do I detect when the server purposely closes the TCP connection to its video stream? I'll need to take action when this occurs - maybe attempt to restart the video or display an error message. Currently, the connection closing and the connection being slow look the same to me. The NetStream object ushers a NetStream.Play.Stop event in both cases. When the connection is slow, it usually recovers by itself within seconds.I wish to only take action when the connection is closed, not when it is slow.Here's how my general setup looks like. It's the basic NetConnection->NetStream->Video setup.
this.vidConnection = new NetConnection(); this.vidConnection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, this.connectionAsyncError);[code].....
So I'm a flash game developer trying to make the transition from AS2 to AS3+OOP, only 3 years or so after everybody else did. There's a plethora of free, very helpful material to go through and I've been spending 2-3 days wrapping my head around some of it, but by now I feel like I just want to start and try it out and learn the harder stuff as I go (just like I did with AS2).
I get the benefits of (most aspects of) OOP and I was once forced to learn to do a couple of games in Processing which had me write a few classes and I really liked the whole inheritance thing, which is the biggest reason I'm keen to move on, I think.
I just wanted to ask about game structure - is my current way of AS2 programming (see the example below, with some pseudo code) close to the way you'd organize things in OOP, or are there some big flaws in my game logic/structure that I can't see? The way I understand I would have to do differently in AS3/OOP is to have a class for moving stuff such as the player, hero, missiles etc, then have an enemy class that extends that class, then have classes for each enemy that extends the enemy class, unlike now where each "class" is instead an object and a function called from the main game loop, and sub-classes are instead "if"-clauses in each function. But except for that, is my programming style on the right track or do I need to re-think the logic behind my code for it to work effectively in an AS3/OOP setting?
I pose this question to you. I have created a video player that functions off of the Video Class, netConnection and NetStream and up until this very moment works 100% as it should.The hang up I'm getting is that I have a onMetaData function that checks ALL of the flv's or f4v's metadata as it is loaded into the player, so i can use it to control some other elements of the player. Here is the code I am using:
Code: my_ns.onMetaData = function (md:Object) { for (propName:String in md){;
I am trying to put together a class for playing video using the Video object. So far, I have only been successful in getting the Video object to fully work when not using a class setup. In the documentation, I have read that to use the Video object you have to actually drag/create the video object onto the stage. So, in my next attempt, I created the video object onto the stage within a MovieClip but still trying to use a class/linkage setup with the Video inside inside of a MovieClip container. No luck there either. Here is the basic AS2 script that is linked to a MovieClip that contains the Video object ("video" instance) within it.
Code: class VideoTest { private var nc:NetConnection; private var ns:NetStream;
[code].....
I am getting the following error with this script.
Code: Line 14: There is no property with the name 'video'. Line 15: There is no method with the name 'video'.
I've got a document class (EgoGame.as) and another class (Ball.as) which has been duplicated to deal with several different video pieces. Inside the document class is a list of 'if' statements which decide which video should be played. At the moment I'm doing it the old fashioned way whereby if the condition is true....it tells the relevant Ball class to gotoAndPlay a certain frame within the linked movieclip...
I am creating a full screen projector with flash CS4. In the projector I have more videos, starting from an swf player-
The problem I encounter is this:
The projector starts correctly FULLSCREEN (using AS). The video plays 900x506 correctly. If I click on the player, to get the video full screen, it works. But when I press ESC, not only the video, but also the PROJECTOR looses full screen.
This is a bit annoying. Is there a way to apply the "back to normal size" only to the video? I do not want to prevent the app to be exited from full screen, it's not a problem if the user wants to exit the projector full screen. But not when the user exits the video from fullscreen mode.
*let say i have a mc called A. it can call a MC with an instance name called window_btn.window can be drag and double click.i want to put a close button in the window MC to close the window.
I'm using Adobe Flex Builder 3 with Flex 3.1 SDK. There is a sample code in documentation to play flv files, however I have compilation errors when I try to use it. Basically it says that there is no such method NetStream.play("file.flv") which takes string argument. There is one without arguments. Plus, It could find method attachNetStream in Video class. I'm confused, what I'm doing wrong!?
i've made my own video player class, which uses the flash's natural video class (flash.media.Video) and the netStream and netConnection class. all works fine when i test it from a server (not locally) using IE 8, untill i refresh the page i get the following error:
I have been trying to put the As3 video tutorial into a class which works fine if I keep the url of the file to play within the class. But I want to be able pass the url from the actual swf file... I have had limited success.
When I try and use the video class in as3, I get this error:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property onMetaData not found on flash.net.NetStream and there is no default value.
I am trying to load video using NetStream. I am able to do this by using the Video Class, but is it possible with the FLV Playback? I would like to add a seek bar so people can scroll the video if they want to.
I know the FLV Playback Component has this built in so I would use it BUT I can't load a stream to the FLV Playback, I can only set it's source. This works fine, but it doesn't allow me to unload it, the sound keeps playing, which is why I ended up using the NetStream instead.
So I have 2 questions. 1) Is it possible to load the NetStream to the FLV Playback component? 2) If not, how do I add the seek functionality to my Video Class?
I have a buttons class that puts 9 pictures on the stage and each one represents a different movie and leads to that movie when clicked (or will lead there once I figure out how to reference it to the specific movie). I have 9 movies referenced through XML. And I am using flvPlayer. Currently I can only have one movie loading. I am not sure how to get each one to play upon click of the respective btn.
Here is some of the code I think is pertinent if figuring how to go about this: ProjectOneButtons class //I have each picture loaded through an array and each button is waiting for the right code through a Switch statement: public function onButtonClick(e:MouseEvent):void { var releventImageAray:Array = this["rowOfImages" + MovieClip(e.currentTarget).row]; var imageWanted:String = relaventImageArray[MovieClip(e.currentTarget).column]; switch (imageWanted) { case "Video1" : [Code] .....
The reason I included a bunch of code is to show that there is a play/pause button that is supposed to play the movie. But the thing is I only have the one movie referenced and I am not sure how to have it variable as to which movie is played and make it depend on the button that is clicked from the button class above. All of this code works as it is and I am getting no errors.
How do I maintain aspect ratio using the Video Class object "<media:Video id="video" />", not the VideoDisplay or FLVPlayback objects. I am using the Video Class object, Netstream and NetConnector, using LifeSize as my server, protocol is RTMP and the url is like: [URL]
Everything plays back fine and for the most part my code is like this:
I have an application, implemented using the Flash Video class. How do I make it run a .flv video in full resolution? All videos are running in the default 320x240 resolution.
i am creating a package, MainTimeLine.as, to extend my main timeline. i use the FLVPlayback component under the package. however, i get the compile error:
1172: Definition fl.video:FLVPlayback could not be found. so i added the "import fl.video.FLVPlayback;" line to my MainTimeLine.as file, but flash gives the above error. now i had this problem when i added this code directly under a frame of the main timeline until i added a FLVPlayback instance to my library. now, i am trying to simply embed all of the code under the MainTimeLine.as file and have the as file encapsulate all of it. but, i still get that error.
so, how do i get flash cs4 to recognize and use the import properly
I'm trying to use the NetConnection class to connect to a live video feed on an external server. I have it set up to start playing my video when the user clicks a Play button, however, this appears in my output every time I click the Play button:
ArgumentError: Error #2126: NetConnection object must be connected. at flash.net::NetStream/ctor() at flash.net::NetStream() at Over/connectLiveStream()[Over::frame2:31]
Here is the (I think relevant) code: if (playVid.label == "Play") { nc = new NetConnection(); nc.objectEncoding = flash.net.ObjectEncoding.AMF0; nc.connect("rtmp://my.rtmp.server:1935/live/"); nsPlay = new NetStream(nc); nsPlay.play("livestream.flv"); }
Is it possible to use the FLVPlayback class to play an instance of the Video class? I'm loading the video (which is just an audio track with cue points) in using GreenSocks LoaderMax (along with the rest of my assets) and so have various instances of Video. The FLVPlayback class only accepts a String as its' source. Is there any way to hack it to bypass whatever loading it does and just feed it the video directly?
I'm building a video chat in flash and everything works really well, except for the part where I'm trying to detect if the other user is sending a working video stream. There's a couple of reasons why the other user isn't sending video. -The other user got no camera -The other user got a camera, but the camera is currently being occupied by another application(Skype, Photo Booth, Google Talk, etc.) -The other user got a camera but hasn't allowed the use of his/hers camera. (Other unexpected problems I guess...)
So how do I detect if the stream I receive from the other user is a black stream(because of the reasons above) using the NetStream class? The closest thing I have came up with is by adding a timer that polls the currentFps() function from the stream I receive from the other user. But so far this seems pretty unreliable because I might get currentFps() == 0 and show an error because of this even though I actually got video from the stream in some cases. The reason for this is because I poll the API every 4 seconds for the currentFPS function and let's say at 00:00:04 I get "no video" according to the poll but at 00:00:05 the video kicks in, and therefor I need to wait until the next tick until the error message disappears
This is what my current poll looks like function subscribingStatusPoll(e:TimerEvent):void { if (subscribingStream.currentFPS == 0){ error.text = "No video found from the other user... } else { error.text = ""; }}
This is the only hack I that I can come up with to detect this, but this is unreliable and I actually would prefer a way to instantly detect if the stream I receive got a working video attached to it.
I just made a class that fits a video to the fullscreen of the browser. I need some input on functionality of the class. What would you like to see added to the class. Though keep in mind that this is meant to be a backdrop to a site and not a video player. Link to class. [URL]
just implemented the 3D Video Flip in one of my projects and I would like to add a dynamic reflection to it. I tried using the pixelfumes class to no avail. It seems like the fact that there is a button in the mc is messing it up. The pixelfumes class is pretty close to being what I want. It just seems to create a reflection way out of range.