Take the 2-minute tour ×

Im not have much luck into finding some Docs on this subject:

   var videoTexture = new VideoTexture("test.flv",512,512,true,true);
   var textureMaterial = new TextureMaterial(videoTexture);
   var planeGeom = new PlaneGeometry(200,200,1,1,false);
   var planeMesh = new Mesh(planeGeom,textureMaterial);
   planeMesh.z = -100;
   planeMesh.y = 25;
   textureMaterial.smooth = true;
   textureMaterial.alphaBlending = true;

how would i make a listener for a loading event, all my generic loaders don't work, i tried a net streaming listener but it keeps throwing errors... ideally i cant add the child until i know its complete...

share|improve this question
What is a VideoTexture? What class(es) are you using to load things with? It would be helpful to know what you are using (a 3d library? Your own class? Etc.). –  Sunil D. Aug 21 '12 at 0:33
sorry, Away3d Class..the video texture is material to be put on a mesh to display video in their 3d environment –  joshua Aug 21 '12 at 1:03

2 Answers 2

up vote 1 down vote accepted

I don't know what kind of listener you're trying to add but if your video class is not extended from an event dispatcher it won't work.

In any case away3d does have API documentation. None of pre-build events help you?

If you're already extending from their classes then you could stay on target with what I'm suggesting.

If you dispatch events you create in from your own Event class at the different stages of your VideoTexture class then you can set up your listeners where you need them. For example in the VideoTexture class say you dispatch a "CONNECT" event at the connect() method. Then you can listen for that particular event in the class you're working out of.

share|improve this answer

If you create your own events this will be much easier for you to set and listen for the trigger points. Just extend the Event class and create your own.

share|improve this answer
i don't know where to have the listener, for example if i was to make my own net stream i would check example: var meta:Object = new Object(); meta.onMetaData = function(meta:Object) trace(meta.duration); –  joshua Aug 21 '12 at 4:49
i cant seem to add a listener to the material texture that the video is loaded into –  joshua Aug 21 '12 at 4:50
Type Coercion failed: cannot convert flash.media::Video@2d906ee1 to away3d.materials.TextureMaterial. –  joshua Aug 21 '12 at 6:13

Your Answer


