ActionScript 3.0 :: Why OnMetaData Handler Doesn't Be Called When Playing Some .flv

Dec 20, 2011

I am using NetStream to play some .flv files on local disc. My code skeleton is:

public class AdvertisPanel extends MovieClip
{
private var _video:Video;
private var _connection:NetConnection;

[Code].....

I used some .flv files that I download from YouTube to test; and I found that the handler metaDataListener would not be called when playing some .flv files, but some would. Is the problem caused by the video file? Because I may resize the video before play it on the screen, and I really need to know its original width & height.

View 3 Replies


Similar Posts:


Actionscript 3 :: URLLoader Handler In Child Movie Not Being Called?

Jul 16, 2010

I am writing a flex application that has a MainMovie that loads flex programs (ChildMovie) depending on what the user selects in the MainMovie.

class MainMovie{
private var request:URLRequest = new URLRequest();
public function callPHPfile(param:String, loader:URLLoader,

[code]....

I can see that the callPHPfile function is being executed and received xml data from in httpFox, the problem is that the code in the handlerInChild function is not being executed.

View 1 Replies

Actionscript 3 :: Force Program To Wait Until Event Handler Is Called

Apr 3, 2010

I have an AS 3.0 class that loads a JSON file in using a URLRequest.

package {
import flash.display.MovieClip;
import flash.display.Loader;

[Code]....

When the file is finished loading, the mapHandler event makes changes to the class properties, which in turn are accessed using the getMapWidth function. However, if the getMapwidth function gets called before it finishes loading, the program will fail.

How can I make the class wait to accept function calls until after the file is loaded?

View 2 Replies

ActionScript 2.0 :: Referencing Movieclip Event Handler Is Called From When Using Delegate?

Aug 24, 2006

I'm using Delegates in a new project I'm working on to call an event handler in my class with the scope of the class.

I'm having an issue referencing which button is calling this handler. Since all of my buttons are created dynamicly, this is a big problem.

I'm used to using forms and components where I had no problem with this and could reference who was calling the event handler by using - event.target

This doesn't seem to be the case with movieclips though, is there another way to do this?

View 1 Replies

Actionscript 3 :: Flex's FileReference.save() Can Only Be Called In A User Event Handler

Jul 21, 2010

I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception." (from the documentation here)

This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so then exactly which user events are valid? (Perhaps there's an event that will never be dispatched by user interaction with my application and I could register an event handler function for that event type and make the save() call from within that function?)

My difficulty is that I can't safely call the FileReference.save() method until my web service returns with the data that will be used as the argument of the FileReference.save() method call, so the event that triggers the FileReference.save() call is actually a ResultEvent rather than a user event, and I'm leery of dispatching a new (faux) user event type in order to be able to trigger the FileReference.save() call unless it's definitely a user event that would never be dispatched as a result of actual user interaction with my application.

In a nutshell what I'm doing now is this: I have a function that is registered as a handler for a button click. In this function I make my web service call to fetch data from the server. I also have a result handler function which gets invoked when the web service call completes, and it's in here that I want to call the FileReference.save() method since it's at this point that I know that the data is ready to be saved to a file. But the aforementioned restriction is blocking me from doing this -- I get an error:

Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.

I've tried many things to get around this such as creating a second mouse click event handler function with the FileReference.save() call within and calling it after a timeout interval (to give the web service time to complete), but I keep running into the same error -- maybe that approach doesn't work since the second function isn't registered as an event listener for the event type used as its argument.

View 3 Replies

ActionScript 3 :: Anonymous Function As Click Handler Is Called Multiple Times Per Click

Aug 16, 2010

I have a button labeled 'blueButton' and I'd like to use an anonymous function to handle the click, like so:

blueButton.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void {
trace( "-----click detected-----" );
// now do other stuff
});

Problem is, the click handler is called multiple times per click. The number of times called seems to be random (sometimes 2, sometimes 4, sometimes 3 etc). could I be missing something in my code, or maybe I set up the button wrong?

also I noticed that it seems to always get called once on the first click. After the first click is when it starts getting called additional times, maybe that has something to do with it?

View 3 Replies

ActionScript 3.0 :: ChangeWatcher - Handler Function Doesn't Fire?

Jun 19, 2007

I am having problems with a ChangeWatcher.Everything seems to be set up correctly.The canWatch method returns true, the isWatching method returns true and if I query the return value of the getValue method I get the correct information, including changes. But for some reason the handler function just doesn't fire.

View 1 Replies

Flash :: Add Such A Handler, The NetStream Client Doesn't Function As It Did Before?

Nov 2, 2010

I'm trying to add a custom callback handler to a NetStream client in a p2p application. The problem is, when I add such a handler, the NetStream Client doesn't function as it did before. It seems the NetStream.client object is changed. I know the default object is this. But changing the client to this doesn't solve the problem.The remoteControlStream, is the incoming stream. And the localControl stream is the stream being publishedThis is the localControlStream that's being send by the peer, and received as remoteControlStream:

private function initLocalControlStream():void{
localControlStream = new NetStream(nc, NetStream.DIRECT_CONNECTIONS);
localControlStream.addEventListener(NetStatusEvent.NET_STATUS, localControlHandler);
localControlStream.publish(myPeerID+"control");[code]...

The onPeerConnect method of the localControlStream doesn't get called when I connect when the above handler is added. When I remove the that handler, the onPeerConnect method gets called.

View 1 Replies

ActionScript 2.0 :: FLVPlayback: Event Handler If The File Doesn't Exist?

Jan 19, 2009

if I put in the contentPath of a FLVPlayback component a file that doesn't exist, how can I catch an error event? (All files are loaded locally, without a FMS) I tried to dodge the problem using other events, but if the file doesn't exist, pretty much none of the events will work.

View 1 Replies

ActionScript 2.0 :: Call The RemoveMovieClip Function In A Callback Handler, It Just Doesn't Work?

May 6, 2007

whenever I try to call the removeMovieClip function in a callback handler, it just doesn't work! Maybe I'm tired, or I've just missed something this is apparantly obvious. In my code exert below, is just a simple script that attaches a movie clip to stage (square_mc) and creates a duplicate instance. When the component button is clicked, I want the original movie clip to be deleted, but nothing happens!

Code:
this.attachMovie("square", "square_mc", this.getNextHighestDepth());
square_mc.duplicateMovieClip("square_mc2", this.getNextHighestDepth(),
{_x:50}) var listener:Object = new Object;[code].............

View 3 Replies

Flash :: Playing One Sound At A Time In Called From Javascript?

Jul 15, 2010

I'm working on a site, for kids, which has a small avatar in the corner that talks.The avatar is a flash file and the plan is to determine what it says through a mix of javascript and ajax.

Unfortunately when I make the flash file play an Mp3 file through JavaScript, I can't seem to stop the sound.. so when I keep clicking on a link which causes it to talk, I hear the sound repeated x times.

The odd thing is, when I attach the very same code to a button in flash, there seems to be no such limitation. It seems as if it won't store anything in global variables when calling from JavaScript.

View 2 Replies

ActionScript 3.0 :: Get A Called Swf To Stop Playing After A Button Is Clicked?

May 9, 2010

I'm trying to get a called swf to stop playing after a button is clicked.

I also need to have other swfs called on other btn clicks.

you'll see what I mean at

[Code]...

View 1 Replies

Flex :: Method Doesn't Work When Being Called On ParentDocument?

May 8, 2010

I wonder is anyone can look at this code and tell me why calling the removeSelectedChild works when called from the same document, but returns the following error when called from the child document/component.

"ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller."

<?xml version="1.0" encoding="utf-8"?>

[Code]...

View 3 Replies

ActionScript 2.0 :: Function Called By SetInterval, But Doesn't Work?

Dec 14, 2009

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */

[code].......

View 1 Replies

ActionScript 2.0 :: Google Maps Error Doesn't Appear When Its Swf Is Being Called By The Main Swf?

Nov 20, 2009

Im trying to call to the main.swf other swf that contains some text and a google map. The swf that contains the google map is working fine...but everytime i play the main one, the text appears but the gmap doesnt.the code that i put on the main.swf refering to the google maps one is below (i followed the logic of the gallery that came with the presentation .fla):

// google-maps module
case "google-maps" :
if (firstLoad != true) {
var move1Content:Tween = new Tween(contentBG_mc, "_x", Strong.easeIn, contentBG_mc._x, -500, 0.5, true);

[code]....

View 13 Replies

ActionScript 2.0 :: OnSoundComplete - Get An Equalizer Animation To Redirect To A Url AFTER The Called On MP3 Track Has Finished Playing

Feb 7, 2010

I am trying to get an equalizer animation to redirect to a url AFTER the called on MP3 track has finished playing. But I am pulling my hair out in trying to figure out how to do this... Based on some help and more research, I think i need this following action script inserted somewhere into the original action script, but i'm not sure. Am I even on the right track?

[Code]....

View 3 Replies

ActionScript 2.0 :: [Flash Cs3] Make A Button Called Textchange That Detects If The Movie Clip Meditext Is Playing?

Jan 16, 2008

I need to know how to make a button called Textchange that detects if the movie clip Meditext is playing, and if it is then largetext will start playing and Meditext will stop. But if it isn't playing, then nothing happens.

View 2 Replies

ActionScript 3.0 :: Event Handler For MC - Start A Timer When A Dynamic Movieclip ("mySlide") Has Finished Playing

Apr 11, 2010

I am simply trying to start a timer when a dynamic movieclip ("mySlide") has finished playing. Here's my code:

[Code]...

View 5 Replies

Actionscript 3 :: Facebook Login Handler Doesn't Get Fired In Flex4 Facebook API?

Mar 13, 2011

I have literally spent HOURS trying to solve this mystery... but simply can't seem to get hold of it.
I am using the same code lines (literally!) as the example here (official adobe tutorial) and I get different result.

[Code]...

Everything works fine, i.e. everything till it is time to fire the loggedin event. I get asked to log in and all permissions are asked correctly. After I log myself in to facebook, the loggedin event doesn't fire. Is there any way of solving this problem??

View 1 Replies

ActionScript 2.0 :: MX: Attach An "onRollOver"-handler To The Movieclip But It Doesn't Respond - Array

Sep 28, 2005

I have a loop that goes through an array and duplicates (and positions) movieclips on the scene and loads JPGs into them with "loadMovie". I then try to attach an "onRollOver"-handler to the movieclip but it doesn't respond. Here's the thing: It works fine when I don't load the images into the MC instances... but as soon as I do, the onRollOver is not responsive anymore.

I read the telltale line "loading a JPG or SWF into a movieclip replaces it"... is that the cause of the problem? I mean- can I not refer to the duplicated MCs anymore as soon as I load something into them? How could I work around it?

[Code]...

View 2 Replies

ActionScript 2.0 :: XML - Get It To Preload The Contents/images Being Called In The XML File So It Doesn't Run As Soon As The XML File Is Loaded?

Jun 21, 2007

I'm building a flash movie for something at work and im loading in some images using an XML file but when i use a preloader it only preloads the XML file (as in just the text inside) and not the images.

This causes the movie to start playing without having the images loaded.Does anyone have any ideas about how i could get it to preload the contents/images being called in the XML file so it doesn't run as soon as the XML file is loaded.

View 1 Replies

Flash :: Deal With Late OnMetaData In IE?

Apr 7, 2010

I am trying to dynamically resize an flv playing back in a flash player. To do this, I need to get the flv's width/height so I can maintain the original aspect ratio. I have noticed that in Firefox the onMetaData event will be hit right away, and the video will resize properly. In IE however, onMetaData is not hit until the buffer is full and video starts playing.

One solution I have thought of is to set the initial buffer to something close to 0 (e.g. 0.01). Then the buffer will instantly hit full, and the video will be resized. The issue I have with this is low bandwidth users will have a a short 'sputter' of video (0.5 seconds say) at the beginning before it goes to the next, larger, buffer. Is there any better way to deal with this behavior in IE? Can you manually "get" the metaData from an FLV file before it even plays?

View 1 Replies

ActionScript 3.0 :: Can't Create Property OnMetaData

May 27, 2010

I'm puling in a FLV via a NetConnection (NetStream), and I've got it all working well EXCEPT for the scrubber. Here's the code I'm using for the scrubber[code]...

View 5 Replies

Actionscript 3.0 :: Cannot Create Property OnMetaData?

May 27, 2010

I'm puling in a FLV via a NetConnection (NetStream), and I've got it all working well EXCEPT for the scrubber. Here's the code I'm using for the scrubber:

****
//Scrubber
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;[code]....

View 1 Replies

ActionScript 2.0 :: Ns.onMetaData Within Class Function?

Apr 3, 2008

I am trying this function in a class, but i can only trace duration A and not duration B

Code:
public function playVideo():Void {
if(!isStarted) {

[code].....

View 4 Replies

ActionScript 3.0 :: OnMetaData Video Progress Bar?

Apr 2, 2010

I've been following a couple of tutorials on making a custom video player and they all use the onMetaData event of the NetStream class to get the duration of the video. I always get this error though ns.onMetaData = function(obj:Object){1119: Access of possibly undefined property onMetaData through a reference with static type flash.net:NetStream.Here's what I have, sorry about the commented stuff I've been trying different things:

Code:
import flash.media.Video;
import flash.net.NetStream;

[code]....

View 3 Replies

ActionScript 3.0 :: Scale Video Using OnMetaData?

Jul 14, 2010

Im just a few week into AS and scripting in general so Im not sure why what I've got is working.

I want to create a scaling video that is full screen - from scratch.
I later want to dynamically load a graphic and tile it over the video - I've done that here

I was at the point that the video I was loading would only resize to the stage when the stage Event.RESIZE fired. I need the video scaled when it loads - so my approach was to try and do something with the onMetaData height and width values. I was going to create a function which returned the proportionally scaled native values back to Video(). However I'm not savvy enough to know how to get those values back into the playVideo function.

Along the way I stumbled on something that seems to work - but I dont really undersand why! - or if its 'best practice'.

Code:

import flash.net.URLRequest;
import flash.events.Event;
//variables

[Code].....

Im trying to take on board around methods, objects, callback functions and how to create variables that are more then a known values.

I honestly need a video of some guy with a chalk board drawing arrows to demonstrate how all these things connect

View 7 Replies

ActionScript 3.0 :: OnMetaData Gets Triggered Multiple Times?

Nov 8, 2010

I have a class set up that should just spit back the duration of a loaded video file. It works, but my onMetaData handler seems to get triggered twice, even though I can only see one place that should trigger it:

Code:
public function PENetConnection (obj:Object=null)
{

[code]....

View 1 Replies

Media Server :: OnMetaData Properties Missing When Playback With HDS

Oct 13, 2011

Currently we have updated to FMS4.5 and doing some evaluation on HDS. We published our RTMP streams to the livepkgr application and successfully setup and playback HDS. However, we found that a we can't access some onMetaData Properties during playback. Our player use onMetaData - "videodatarate" and "audiodatarate" properties. We are trying to migrate it to playback HDS, however, we don't seems to be able to get back the two fields?

View 7 Replies

ActionScript 3.0 :: FLVPlayback Fail To Invoke CallBack OnMetaData

Mar 24, 2008

i'm using FLVPlayback in order to load a movie. i keep getting this error: Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property duration not found on Number and there is no default value.

if i get it right, it means that inside built-in onMetaData there is no duration property. so, i tried adding my own call back function:

//creating a custom client
var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;

[Code]....

View 8 Replies







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