ActionScript 3.0 :: Can't Seem To Call The NetStream.onStatus Event

Jul 23, 2009

I'm just trying to build as simple of a player as possible, and I have it working how I want it to, but I need to figure out how to know when the video ends so I can call any callback functions I might want to be called.I've spent the better part of the last 3 hours trying different examples online, but none do anything. It compiles fine, but just doesn't do anything...

I'm attaching the code I already have, and would appreciate it if anyone could point me in the right direction.

ActionScript Code:
var _path:String = root.loaderInfo.parameters.Path;
var _w:int = root.loaderInfo.parameters.Width;
var _h:int = root.loaderInfo.parameters.Height;

[code]....

View 4 Replies


Similar Posts:


ActionScript 2.0 :: Event Handling Using NetStream.onStatus?

Nov 8, 2010

I am trying to detect the end of a streaming video using NetStream.onStatus in AS2. It worked like a charm in a Flash app but I started having problems when I decided to put it in a separate AS class. Here's the snippet -->

class MyClass
{
�.
// Properties & variables

[Code]....

The code works fine and fires an event when the stream stops (I get the trace output without a hiccup). Problem is: it doesn't seem to recognize MyMethod function - or any other method of this class for that matter - for some reason! Just ignores it! When I set trace traps inside MyMethod they don't fire.

View 0 Replies

Flash :: NetStream.Buffer.Full Not Fired After Call To NetStream.pause?

Jul 6, 2011

I'm making a small video players in AS3, and I've found that after calling NetStream.pause() or NetStream.togglePause(), no status messages are being fired any more.If I click the "pause" button while the video is buffering, I never get the Buffer.Full message.Here is some code:

_connection = new NetConnection();
_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_connection.connect(null);[code].....

View 1 Replies

ActionScript 3.0 :: Used NetStream.appendBytes() ,but Cannot Call BitmapData.draw()?

Nov 14, 2011

the tips: Error #2123: Security sandbox violation: BitmapData.draw: cannot access null. No policy files granted access.
 
Here is some sample code

[Code]...
 
This is only sample code use for an explanation. The error would happen when calling the getImage method while the video is playing. The error mentions a policy file not found. Since the file is loaded locally there isn't really a place to put a policy file. Is there a policy setting somewhere that needs to be set or is the BitmapData.draw feature just not available when using appendBytes? It is a local flv file,  not an ramp stream from a server.

View 9 Replies

ActionScript 2.0 :: Ns.onStatus Not Returning A Value?

Jan 22, 2009

The following snippit:

// FLV Completion
ns.onStatus = function(info){
if(info.code == "Netstream.Play.Stop"){

[code]....

Is not returning anything at the end of my flv. I have also tried: Netstream.Play.Complete to no avail.

View 1 Replies

Actionscript 2.0 :: Ns.onStatus Is Not Returning A Value?

Jan 22, 2009

The following snippit...

ns.onStatus = function(info){
trace("The movie has ended keptain!");
if(info.code == "Netstream.Play.Stop"){

[code].....

View 2 Replies

ActionScript 3.0 :: Why Is NetStream.onMetaData A 'callback Function' And Not An Event

Nov 5, 2009

I rarely use NetStream or any video in my projects, but someone I email with was wondering this, and I have no earthly idea.

Is there any reason why the NetStream's "onMetaData" event cannot be listened to using addEventListener, but instead requires you to use a callback function?

Is it faster, avoiding the overhead of events? Is it to prevent more than one listener being attached?

View 2 Replies

ActionScript 3.0 :: Attaching Event Listener To NetStream Time?

Jun 4, 2010

So Im trying to get the current time (play head time) for a video on the stage and am using Netstream. I have a timer with an event listener pinging a function every 1000ms. But it is not smooth and the numbers jump a bit.

Is there a way to attach an event listener to the netstream time itself?

I tried ns.addEventListener(NetStatusEvent.time, monitorTime); but as you probably know that Dog wont hunt.

View 1 Replies

ActionScript 2.0 :: MovieClipLoader Event - Getting OnloadComplete Event To Call A Method In The Main Body Of The Class

Apr 17, 2007

I'm newish to OOP AS... trying to build a image loader that wipes between loads. having trouble getting my onloadComplete event to call a method in the main body of the class. what am I missing?

[Code]...

View 1 Replies

Media Server :: OnStatus Returns Wrong Codes?

Jun 15, 2010

I'm using the following code to record a stream on the server side,,,,,,the problem is onStatus only reports NetStatus.data.start and no other codes i don't even know what the code it does returns means as it is undocumented .....how can i make onStatus report properly?[code]

View 2 Replies

ActionScript 3.0 :: Main.swf Event Handler - Close NetStream In Impoted Swf

Nov 26, 2010

I import a external SWF into a UILoader, the SWF contains a netStream that I need to close from a Main.swf event handler, slideShow_btn. Basically from Main.swf when/if slideShow_btn event happens I need to check and close the nsStream in videoplayer.swf Here are my event handlers in Main.swf

[Code]...

View 3 Replies

ActionScript 2.0 :: Control A MovieClip Animation Based On A NetStream Event?

Jul 29, 2006

[URL]

What I am trying to do is get the animation of the audio levels (red bars next to the power switch) to only happen while a video is actually playing (videos are in the video gallery section). I have the animation done and I can easily get it to start and stop based on pressing the play and stop buttons, but since they start and pause the video you would get instances where the video isn't playing but the audio levels would be animated, which I don't want.

Here is an example of the code in the play button (using NetConnection and NetStream to play the videos):

Code:
play_btn.onPress = function() {
playSound.start();
infoText_txt.text = "PLAY";
my_ns.pause(spotToPlay);
};

The only way I can think to make it work exactly as I want it is to have Flash look to see if the video is actually playing or not and I can't figure out how to do this or if its even possible using the NetStream command I am using to start and stop the videos.

View 5 Replies

ActionScript 3.0 :: SoundMixer.stopAll(); Affecting NetStream  Event.info.code - Bug?

Sep 10, 2009

I'm loading and progressively streaming an F4V Video using pure actionscript code (No playback component used) and after the video begins streaming I place a MUTE button on the stage that when clicked executes the SoundMixer.stopAll(); instruction.
 
When the movie completes playing I use the following code to monitor the NetStream state changes and place a NEXT button on the stage when the video finishes.
 
When the video completes there is a NetStream event.info.code issued - "NetStream.Play.Stop"

[Code]...

View 2 Replies

ActionScript 3.0 :: Error On BitMapData.draw() After NetStream.pause() Then NetStream.seek()

Feb 25, 2010

I am working on an app that will take a snapshot of an rtmp stream of an archived video, save it to a file, and ExternalInterface the file name to the hosting page to javascript it up for display.

I actually have all pieces working great. The only time an error is thrown is when I pause the video, seek to somewhere, and then try to take a snapshot. Then there is a runtime error of:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: mySwf.swf cannot access rtmp://myFlashServer/myApp. No policy files granted access.I've seen post after post of suggestions and have tried them, but without success.

I have the crossdomain.xml and my FlashMediaServer security setup fine (it is actually working, except for this one glitch). It just seems to be the pause-then-seek-then-BitMapData.draw() combination which is creating issues.

Another weird thing: after the error is thrown, if I resume the stream and take a snapshot, it works flawlessly again.

View 5 Replies

Can't Trigger "NetStream.Seek.InvalidTime" Event?

May 13, 2009

I made an interface that laods a FLV video (as far as I know this is progressive download as I'm not using any Flash Media server or whatever).The point is that I added a Button on the stage with the following code:

on (release) { _root.stream_ns.seek(15);  }

I also have a event catcher like this in the main timeline:

stream_ns.onStatus = function(infoObject:Object) {  if (infoObject["code"] == "NetStream.Seek.InvalidTime") {  _root.text_display = "Not loaded yet";  }}

[code].....

View 8 Replies

Call A Function With Event Parameter When Have No Event Parameter To Pass?

Aug 14, 2009

Forgive me for this stupid noob question but I want to call a function (loadList) that originally gets triggered after a mouseevent from another function (addToXML) that does not have an event.

The loadList function takes info from a XML var, sticks it into an array which then gets loaded into a tile list and that is working fine.

The addToXML function when called adds elements to the XML var after which I want to call the first function with the event parameter so it refreshes the items in the tile list.

I know it can do this by creating a new array and loading that into the tile list in the addToXML function, but it be much simpler to just recall the function.

I have tried things like

Code:
addToXML.addEventListener(Event.COMPLETE, loadList);

but all the event constants I have tried give me error messges like "1061: Call to a possibly undefined method addEventListener through a reference with static type Function."

View 3 Replies

ActionScript 3.0 :: Error: "NetStream.Play.StreamNotFound" While Playing Mp4 File Using NetStream Object?

Jan 7, 2010

I am using NetStream, NetConnection and Video object to play an mp4 file which is hosted over a web server using http.This is an AIR application and the relevant code is pasted below:

var url:String = <some http url>;
connect_nc = new NetConnection();
connect_nc.connect(null);

[code]........

View 0 Replies

Actionscript 3 :: NetStream.info, Getting Error #2154 "The NetStream Object Is Invalid"

Mar 20, 2012

In my application I have a video playing from a NetStream. Every second on timer I update a text label with statistics like stream.info.currentBytesPerSecond. The problem occurs when the NetConnection associated with this NetStream closes: the getter for stream.info throws

[Code]...

View 1 Replies

ActionScript 3.0 :: Call A Function With Event?

Apr 15, 2009

How do I call a function with a event inside it?[code]...

View 2 Replies

ActionScript 3.0 :: Call Event From One Class To Another?

Feb 9, 2010

I have a simple event im trying to listen for in one class and dispatch in another but it does not seem to be working. Before I start tearing this apart is this even possible. A quick test shows its being dispatched fine (checked with trace) but my listener never gets called.[code]...

View 1 Replies

IDE :: Use An OnEnterFrame Event To Call A Function Just Once?

Oct 5, 2009

I need to use an onEnterFrame event to call a function just once. Here's the code:

my_object.onEnterFrame = function() {
if (this._y == 100) {
my_function();
}
};

So say i drag "my_object" to a y-coordinate of 100, how do i make it so it only calls the function once. Then if i drag the object away from y=100, and then back to y=100, i want it to call the function again.

I'm using the onEnterFrame event b/c i need it to constantly look for the object to be at y=100, maybe except when its actually at 100.

View 4 Replies

ActionScript 3.0 :: Artificially Set An Event Call?

Dec 2, 2009

i'm creating a menu that of course calls some functions then items are clicked. the problem i'm having is i want to fake one of these menu click events from a function when the menu loads and i can't figure out how to do it.

here's a sample of the function(not complete).

function itemClicked(e:Event):void {
trace("activeMenu:"+e.target.name); //traces out menuItem0, menuItem1, etc.
trace("moveItems:"+e.currentTarget.name); //traces out menuItem0, menuItem1, etc.

[Code].....

so i guess what i'm asking is how do you artificially set an event call if you know the name of the movieclip that you want to simulate a click on?

View 5 Replies

ActionScript 3.0 :: Pass A Parameter With An Event Call?

Dec 23, 2010

In actionscript3 how do i pass an parameter with an event call. when i use dispatch.
 
like  dispatchEvent(new Event("Loaded", myvariable));

View 4 Replies

C# :: Call A Flash Method Using A C# On-click Event?

Sep 26, 2011

I have integrated C# and Flash with "Sockwave Flash Object".I am trying to call a Flash method using a C# on-click event.

View 2 Replies

ActionScript 3.0 :: Possible To Call Event.target From Another Function

Oct 11, 2009

ActionScript Code:
import gs.TweenMax;
import fl.motion.easing.*;
var where:String
buttongroup.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
buttongroup.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
[Code] ......

View 1 Replies

ActionScript 3.0 :: Call The Function Based On The Event?

Dec 12, 2009

I have some movie clips that I want to load by using a text box. The way I want to do it is to have a text box and based on the word typed into it call the respective movieclip. My problem is that I do not know how to call the function based on the event of someone hitting the "enter" key.

View 3 Replies

ActionScript 3.0 :: Call Event When Child Is Added To A MC?

Jun 8, 2009

Is there an event that is triggered when a new child is added to a MovieClip?[code]

View 5 Replies

ActionScript 3.0 :: Event Versus Function Call?

Aug 4, 2009

I'm playing with the event system and my own custom event class for a project I'm working on. I'm wondering if it's better to use obj.dispatchEvent(new CustomEvent(event)) or if I should just use a regular function call.

It seems to me that in most cases when one object is detecting the event and another is responding to it it is better to use the event system so I'm not passing around objects too much.

I was also wondering what the performance hit of using the event vs. the function call is. I'm sure the event is more cpu intensive but is it negligible?

View 2 Replies

ActionScript 3.0 :: Call The XML Class When Event COMPLETE?

Nov 16, 2009

I written a class, loading XML. How can I call the XML class when Event COMPLETE, because now it trace me NULL.

View 8 Replies

ActionScript 3.0 :: Run Event Listener Through Dynamic Object Call?

Apr 27, 2009

I have a movie clip being dynamically added to the stage via an AS3 linkage call:

gameOver_mc = new GameOver();
stage.addChild(gameOver_mc);

The movie loads as required.But when the movie has been added I want the user to be able to press spacebar and a function to run.So in the GameOver.as class I wrote the following:

Code:

package
{
import flash.ui.Keyboard;

[code]...

But as soon as the movie clip tries to load I get the error message: TypeError: Error #1009: Cannot access a property or method of a null object reference.I would have thought this would work fine. When I trace the statement in the Constructor function is works. Its only when I try to add an event listener that I get the problems. So am I not allowed to add event listeners from a dynamically loaded class?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved